Discussion:
What would you rewrite in D?
(too old to reply)
sybrandy
2010-10-05 22:27:09 UTC
Permalink
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.

For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite
bug free, but some probably could use a rewrite. Some may even benefit
for threading.

Anyone else?

Casey
bearophile
2010-10-05 23:07:57 UTC
Permalink
Post by sybrandy
Anyone else?
There are several things I'd like to translate to D. Some of them are:
- a constraint solver that I use in Python
- many small things to perform combinatorics (this is partially fit for Phobos2 too).
- The mem.c/mem.h memory management utility written by Walter for C programming, from here: http://c.snippets.org/code/temp/snip-c.zip for when you need to use manual memory management in D :-)
- A hierarchical memory manager, http://swapped.cc/halloc/ again for low-level manual memory management.
- This little C++ solver for the fifteen puzzle: http://www.codeguru.com/dbfiles/get_file/puzzle_src.zip
- Some other small and medium-sized bioinformatics tools.

Bye,
bearophile
BCS
2010-10-06 02:04:50 UTC
Permalink
DMD
--
... <IXOYE><
Michael Chen
2010-10-06 02:25:00 UTC
Permalink
There is DDMD.
Post by BCS
DMD
--
... <IXOYE><
Andrei Alexandrescu
2010-10-06 03:16:41 UTC
Permalink
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite bug
free, but some probably could use a rewrite. Some may even benefit for
threading.
Anyone else?
Casey
I wouldn't spend much time on rewriting classic utilities in D. There's
plenty to be done anew. One category of tools to be written in D are
utilities aimed at D itself (parsers, analyzers, Thrift bindings,
protocol buffers bindings, code for DB interface, etc.)

Andrei
Jonathan M Davis
2010-10-06 05:05:54 UTC
Permalink
Post by Andrei Alexandrescu
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite bug
free, but some probably could use a rewrite. Some may even benefit for
threading.
Anyone else?
Casey
I wouldn't spend much time on rewriting classic utilities in D. There's
plenty to be done anew. One category of tools to be written in D are
utilities aimed at D itself (parsers, analyzers, Thrift bindings,
protocol buffers bindings, code for DB interface, etc.)
Andrei
Indeed.

It could be reasonable to convert existing C or C++ code to D if you're going to
be heavily changing it, but converting pre-existing applications which are
currently in C or C++, and which you don't need to maintain, seems like a waste
of time. It _could_ be an interesting exercise in how to do things in D and
could very well show shortcomings in D, dmd's current implementation, and/or
shortcomings in Phobos, but then so would new applications.

At this point, if I can choose what language I'm going to write something in,
I'm almost certainly going to choose D (though obviously stuff like GUI apps may
not really be properly feasible in D yet, and some things are just gonig to work
better in other languages), but I have enough to do (and not enough time to do
it) without spending the time to rewrite entire, working applications in D.

- Jonathan M Davis
JMRyan
2010-10-06 18:13:08 UTC
Permalink
Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote in news:i8gpne
Post by Andrei Alexandrescu
I wouldn't spend much time on rewriting classic utilities in D. There's
plenty to be done anew. One category of tools to be written in D are
utilities aimed at D itself (parsers, analyzers, Thrift bindings,
protocol buffers bindings, code for DB interface, etc.)
Andrei
If there are old standby's to be rewritten in D, my first choice would not
be full programs (for the reasons you suggest). But I might like to see
some C++ or even Java libraries rewritten in D to make the more easily
available or reliable. wxWidgets, Qt, or SWT make for obvious choices.
I'm not the only ones to whom these were obvious as the wxD, QtD, and DWT
projects indicate. Not that I want to take on such a project myself, but
it's good to see others working on them. (Well, wxD, and QtD are not
translations, but oh well).
Nick Sabalausky
2010-10-06 21:20:02 UTC
Permalink
"JMRyan" <nospam at nospam.com> wrote in message
Post by JMRyan
Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote in news:i8gpne
Post by Andrei Alexandrescu
I wouldn't spend much time on rewriting classic utilities in D. There's
plenty to be done anew. One category of tools to be written in D are
utilities aimed at D itself (parsers, analyzers, Thrift bindings,
protocol buffers bindings, code for DB interface, etc.)
Andrei
If there are old standby's to be rewritten in D, my first choice would not
be full programs (for the reasons you suggest). But I might like to see
some C++ or even Java libraries rewritten in D to make the more easily
available or reliable. wxWidgets, Qt, or SWT make for obvious choices.
I'm not the only ones to whom these were obvious as the wxD, QtD, and DWT
projects indicate. Not that I want to take on such a project myself, but
it's good to see others working on them. (Well, wxD, and QtD are not
translations, but oh well).
Yea, I've been thinking it would be nice to have, at the very least, an
overly-simplified D interface to Qt, that at least worked, even if it wasn't
as fully-fleshed-out and ideal as QtD was aiming to be. Just so D2 users
could make cross-platform GUI apps without having to resort to GTK. I'm sure
the GTKD devs did a fine job and all, so nothing against them, but frankly I
think I'd rather go around beating up old ladies and baby seals than be the
author of a GTK-based app.
Daniel Gibson
2010-10-06 21:26:02 UTC
Permalink
Post by Nick Sabalausky
I'd rather go around beating up old ladies and baby seals than be the
author of a GTK-based app.
because ... ?
Robert Clipsham
2010-10-06 21:27:44 UTC
Permalink
Post by Daniel Gibson
Post by Nick Sabalausky
I'd rather go around beating up old ladies and baby seals than be the
author of a GTK-based app.
because ... ?
If you'd used GTK you'd know ;D
--
Robert
http://octarineparrot.com/
Nick Sabalausky
2010-10-06 21:34:36 UTC
Permalink
"Robert Clipsham" <robert at octarineparrot.com> wrote in message
Post by Robert Clipsham
Post by Daniel Gibson
Post by Nick Sabalausky
I'd rather go around beating up old ladies and baby seals than be the
author of a GTK-based app.
because ... ?
I have a severe distate for non-native-GUI apps. (And even moreso when the
result is a UI that's all big-n-chunky.)
Post by Robert Clipsham
If you'd used GTK you'd know ;D
Heh, actually, I haven't used GTK. At least not from the programmer side
(just the end-user side).
Daniel Gibson
2010-10-06 21:47:58 UTC
Permalink
Post by Nick Sabalausky
"Robert Clipsham" <robert at octarineparrot.com> wrote in message
Post by Robert Clipsham
Post by Daniel Gibson
Post by Nick Sabalausky
I'd rather go around beating up old ladies and baby seals than be the
author of a GTK-based app.
because ... ?
I have a severe distate for non-native-GUI apps. (And even moreso when the
result is a UI that's all big-n-chunky.)
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK
had themes to look native on Windows?

If that isn't the case I do understand your objection.. I hate non
native GUIs as well (java swing is particularly bad).
Post by Nick Sabalausky
Post by Robert Clipsham
If you'd used GTK you'd know ;D
Heh, actually, I haven't used GTK. At least not from the programmer side
(just the end-user side).
I have to admit that I don't have much experience with GUI programming
(in general and GTK in particular) either.
Nick Sabalausky
2010-10-06 22:03:31 UTC
Permalink
"Daniel Gibson" <metalcaedes at gmail.com> wrote in message
Post by Daniel Gibson
Post by Nick Sabalausky
"Robert Clipsham" <robert at octarineparrot.com> wrote in message
Post by Daniel Gibson
Post by Nick Sabalausky
I'd rather go around beating up old ladies and baby seals than be the
author of a GTK-based app.
because ... ?
I have a severe distate for non-native-GUI apps. (And even moreso when
the result is a UI that's all big-n-chunky.)
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK had
themes to look native on Windows?
It does make a vague attempt to look native on Windows, and is FAR better in
that regard than, say, Swing, Winamp, Iron/Chrome, or pretty much anything
from Apple. But there's still rather noticable differences in both look (the
chunkiness I mentioned, just as one example) and in feel (particulary if
you're using GIMP). It's kinda like gluing a picture of some wings overtop
the logo on a Ferrari and saying "See, it's an Aston Martin!"
Robert Clipsham
2010-10-06 22:26:47 UTC
Permalink
Post by Nick Sabalausky
Post by Daniel Gibson
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK had
themes to look native on Windows?
It does make a vague attempt to look native on Windows, and is FAR better in
that regard than, say, Swing, Winamp, Iron/Chrome, or pretty much anything
from Apple. But there's still rather noticable differences in both look (the
chunkiness I mentioned, just as one example) and in feel (particulary if
you're using GIMP). It's kinda like gluing a picture of some wings overtop
the logo on a Ferrari and saying "See, it's an Aston Martin!"
Platform wise, GTK looks appalling on OS X, acceptable, if non-native on
Windows (I think there's a GTK theme that fixes this, not sure), and,
well, you use it on linux. As for Qt, it uses the native GUI for all the
platforms it works on (and if you don't like that there's a config tool
to make it look as ugly as you like :)).

From a developers standpoint, GTK is a lot more awkward to work with
(whether you're using the C interface or the GtkD wrapper), and is
generally not as nice to work with (based on a few hundred lines of code
that did very little, I switched to Qt at that point). Qt on the other
hand I've found a pleasure to work with from day 1, everything seems to
work as expected, and typically needs far less code.
--
Robert
http://octarineparrot.com/
Nick Sabalausky
2010-10-06 23:28:49 UTC
Permalink
"Robert Clipsham" <robert at octarineparrot.com> wrote in message
Post by Robert Clipsham
Post by Nick Sabalausky
Post by Daniel Gibson
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK had
themes to look native on Windows?
It does make a vague attempt to look native on Windows, and is FAR better in
that regard than, say, Swing, Winamp, Iron/Chrome, or pretty much anything
from Apple. But there's still rather noticable differences in both look (the
chunkiness I mentioned, just as one example) and in feel (particulary if
you're using GIMP). It's kinda like gluing a picture of some wings overtop
the logo on a Ferrari and saying "See, it's an Aston Martin!"
Platform wise, GTK looks appalling on OS X, acceptable, if non-native on
Windows (I think there's a GTK theme that fixes this, not sure), and,
well, you use it on linux.
Unless you're a KDE (or Xfce) user. Which actually brings up another thing:
It's my understanding that wxWidgets can use other things than just GTK on
Linux. And AIUI, Qt and KDE are tied togther in the same way as GTK and
GNOME, so does that mean Qt won't use GTK for Linux users running GNOME?
Daniel Gibson
2010-10-06 23:36:26 UTC
Permalink
Post by Nick Sabalausky
"Robert Clipsham" <robert at octarineparrot.com> wrote in message
Post by Robert Clipsham
Post by Nick Sabalausky
Post by Daniel Gibson
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK had
themes to look native on Windows?
It does make a vague attempt to look native on Windows, and is FAR better in
that regard than, say, Swing, Winamp, Iron/Chrome, or pretty much anything
from Apple. But there's still rather noticable differences in both look (the
chunkiness I mentioned, just as one example) and in feel (particulary if
you're using GIMP). It's kinda like gluing a picture of some wings overtop
the logo on a Ferrari and saying "See, it's an Aston Martin!"
Platform wise, GTK looks appalling on OS X, acceptable, if non-native on
Windows (I think there's a GTK theme that fixes this, not sure), and,
well, you use it on linux.
It's my understanding that wxWidgets can use other things than just GTK on
Linux. And AIUI, Qt and KDE are tied togther in the same way as GTK and
GNOME, so does that mean Qt won't use GTK for Linux users running GNOME?
Lots of Qt applications don't use kdelibs and lots of GTK applications
don't use gnomes libs so I wouldn't say they're tied together.
Newer Qt versions can use GTK themes and even GTKs filepicker, so they
feel native for non-kde-users. (Getting this to work can however be a
bit tricky, at least when using xfce the correct theme isn't detected
out of the box)
Jonathan M Davis
2010-10-06 23:40:06 UTC
Permalink
Post by Nick Sabalausky
"Robert Clipsham" <robert at octarineparrot.com> wrote in message
Post by Robert Clipsham
Post by Nick Sabalausky
Post by Daniel Gibson
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK had
themes to look native on Windows?
It does make a vague attempt to look native on Windows, and is FAR better in
that regard than, say, Swing, Winamp, Iron/Chrome, or pretty much anything
from Apple. But there's still rather noticable differences in both look (the
chunkiness I mentioned, just as one example) and in feel (particulary if
you're using GIMP). It's kinda like gluing a picture of some wings overtop
the logo on a Ferrari and saying "See, it's an Aston Martin!"
Platform wise, GTK looks appalling on OS X, acceptable, if non-native on
Windows (I think there's a GTK theme that fixes this, not sure), and,
well, you use it on linux.
It's my understanding that wxWidgets can use other things than just GTK on
Linux.
That's definitely cool if it can, but as far as I know, I've never seen it done.
wxwidget apps always seem to look like gtk in Linux (aka butt-ugly - I hate the
look of gtk; I'd have to be truly desperate to even consider writing an ap that
used gtk).
Post by Nick Sabalausky
And AIUI, Qt and KDE are tied togther in the same way as GTK and
GNOME, so does that mean Qt won't use GTK for Linux users running GNOME?
There may be a gtk theme that gnome could enable (they have a qt theme for gtk
in KDE, but since it only changes the look somewhat and the functionality not at
all - like using a proper, Qt/KDE file dialog - the gain is minimal), but I
rather doubt that Qt makes an attempt to look like gtk on its own. Regardless,
since I'm a diehard KDE user, I wouldn't know. The whole idea of "native" gets a
bit funny on Linux anyway, since there really isn't such thing as a native GUI
on Linux. The closest that you'd get is whatever GUI toolkit your DE uses, but
it still isn't really native like you get with Windows.

- Jonathan M Davis
Seth Hoenig
2010-10-07 02:53:25 UTC
Permalink
Open SSL
http://www.peereboom.us/assl/assl/html/openssl.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101006/13ef52f3/attachment.html>
Jimmy Cao
2010-10-07 02:56:36 UTC
Permalink
Yes! When I was trying to get D to work with HTTPS, it took me a long time
to figure out how to do it.
I ended up using GnuTLS, somehow, with someone's help.
Post by Seth Hoenig
Open SSL
http://www.peereboom.us/assl/assl/html/openssl.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101006/f819aba4/attachment.html>
Brad Roberts
2010-10-07 04:29:41 UTC
Permalink
On Wed, Oct 6, 2010 at 9:53 PM, Seth Hoenig <seth.a.hoenig at gmail.com
Open SSL
http://www.peereboom.us/assl/assl/html/openssl.html
Yes! When I was trying to get D to work with HTTPS, it took me a long time to
figure out how to do it.
I ended up using GnuTLS, somehow, with someone's help.
If you're tempted to replace or rewrite battle hardened crypto code, you're not
paranoid enough. As much as I've hated every little bit of my work with
openssl, I'm not nearly crazy enough (and I'm fairly crazy sometimes) to believe
it's worth the pain to start over. I'd LOVE to do it, but no way would it be
worth it.

And thanks.. now I'm gonna have another nightmare filled night. OpenSSL.. shudder.

Later,
Brad
Nick Sabalausky
2010-10-07 04:55:09 UTC
Permalink
"Seth Hoenig" <seth.a.hoenig at gmail.com> wrote in message
Post by Seth Hoenig
Open SSL
http://www.peereboom.us/assl/assl/html/openssl.html
Boy, that describes sooo many things I've had to deal with. Including the
entire (VB6) codebase at a company I used to work for. (Let's name a
function that loads a file "save"! Yea! Oh, and "ccc" is a useful variable
name, isn't it? Let's use it everywhere! And let's do an NIH "else" by
goto-ing over the next 400 lines starting at the end of a "then" clause! And
then pretend that we're all professionals! Fuck, I still have nightmares
about that shithole.)
Gour D.
2010-10-07 04:02:28 UTC
Permalink
On Wed, 6 Oct 2010 16:40:06 -0700
Jonathan> That's definitely cool if it can, but as far as I know, I've
Jonathan> never seen it done. wxwidget apps always seem to look like
Jonathan> gtk in Linux (aka butt-ugly - I hate the look of gtk; I'd
Jonathan> have to be truly desperate to even consider writing an ap
Jonathan> that used gtk).

Well, wxQt is work in progress and when done, then wxwidgets would
have a chance to work differently on Linux.


Sincerely,
Gour
--
Gour | Hlapicina, Croatia | GPG key: CDBF17CA
----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101007/18d6edca/attachment.pgp>
Robert Clipsham
2010-10-07 13:58:13 UTC
Permalink
Post by Nick Sabalausky
It's my understanding that wxWidgets can use other things than just GTK on
Linux. And AIUI, Qt and KDE are tied togther in the same way as GTK and
GNOME, so does that mean Qt won't use GTK for Linux users running GNOME?
Dunno about GTK, you can set Qt to use your GTK theme though, thus
keeping your theme in sync across both Qt and GTK apps.
--
Robert
http://octarineparrot.com/
Jacob Carlborg
2010-10-07 08:46:07 UTC
Permalink
Post by Robert Clipsham
Post by Nick Sabalausky
Post by Daniel Gibson
Ok, for me GTK is native because I use Linux and a GTK based desktop.
I know that there's a native GTK port for OSX/Quartz and I thought GTK had
themes to look native on Windows?
It does make a vague attempt to look native on Windows, and is FAR better in
that regard than, say, Swing, Winamp, Iron/Chrome, or pretty much anything
from Apple. But there's still rather noticable differences in both look (the
chunkiness I mentioned, just as one example) and in feel (particulary if
you're using GIMP). It's kinda like gluing a picture of some wings overtop
the logo on a Ferrari and saying "See, it's an Aston Martin!"
Platform wise, GTK looks appalling on OS X, acceptable, if non-native on
Windows (I think there's a GTK theme that fixes this, not sure), and,
well, you use it on linux. As for Qt, it uses the native GUI for all the
platforms it works on (and if you don't like that there's a config tool
to make it look as ugly as you like :)).
I haven't seen any native looking Qt application on Mac.
Post by Robert Clipsham
From a developers standpoint, GTK is a lot more awkward to work with
(whether you're using the C interface or the GtkD wrapper), and is
generally not as nice to work with (based on a few hundred lines of code
that did very little, I switched to Qt at that point). Qt on the other
hand I've found a pleasure to work with from day 1, everything seems to
work as expected, and typically needs far less code.
--
/Jacob Carlborg
Robert Clipsham
2010-10-07 14:00:58 UTC
Permalink
Post by Jacob Carlborg
I haven't seen any native looking Qt application on Mac.
When did you last use a Qt application on a Mac? The cocoa backend for
OS X is fairly new - Qt apps I've written look native on a Mac
(admittedly the spacing's a bit off in places, that's not a huge issue
though).
--
Robert
http://octarineparrot.com/
Gour D.
2010-10-07 03:58:46 UTC
Permalink
On Wed, 06 Oct 2010 23:47:58 +0200
Daniel> If that isn't the case I do understand your objection.. I hate
Daniel> non native GUIs as well (java swing is particularly bad).

Although I'm still hankering to see QtD, I'm just curious (not having
experience with) how does SWT (DWT) can compare in regards?


Sincerely,
Gour
--
Gour | Hlapicina, Croatia | GPG key: CDBF17CA
----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101007/13457048/attachment.pgp>
Nick Sabalausky
2010-10-07 05:00:02 UTC
Permalink
"Gour D." <gour at atmarama.net> wrote in message
Post by Gour D.
Although I'm still hankering to see QtD, I'm just curious (not having
experience with) how does SWT (DWT) can compare in regards?
SWT/DWT uses the native GUI, at least on windows. I have no idea what it
uses on Linux, my guess would be GTK-only, but that's only a guess. But I
think DWT is D1-only right now (so is wxD).
Jonathan M Davis
2010-10-07 06:37:06 UTC
Permalink
Post by Nick Sabalausky
"Gour D." <gour at atmarama.net> wrote in message
Post by Gour D.
Although I'm still hankering to see QtD, I'm just curious (not having
experience with) how does SWT (DWT) can compare in regards?
SWT/DWT uses the native GUI, at least on windows. I have no idea what it
uses on Linux, my guess would be GTK-only, but that's only a guess. But I
think DWT is D1-only right now (so is wxD).
SWT uses GTK on Linux (unfortunately), so presumably DWT does as well. It's what
Eclipse uses. However, I do believe that you're right and that it's currently
only D1 compatible.
Jacob Carlborg
2010-10-07 08:45:29 UTC
Permalink
"Gour D."<gour at atmarama.net> wrote in message
Post by Gour D.
Although I'm still hankering to see QtD, I'm just curious (not having
experience with) how does SWT (DWT) can compare in regards?
SWT/DWT uses the native GUI, at least on windows. I have no idea what it
uses on Linux, my guess would be GTK-only, but that's only a guess. But I
think DWT is D1-only right now (so is wxD).
It uses native controls on all supported platforms. If there isn't a
native control available it will emulate it. On Linux GTK and Motif is
supported, I think they're working on a Qt port as well.
--
/Jacob Carlborg
Jacob Carlborg
2010-10-07 08:47:40 UTC
Permalink
Post by Jonathan M Davis
"Gour D."<gour at atmarama.net> wrote in message
Post by Gour D.
Although I'm still hankering to see QtD, I'm just curious (not having
experience with) how does SWT (DWT) can compare in regards?
SWT/DWT uses the native GUI, at least on windows. I have no idea what it
uses on Linux, my guess would be GTK-only, but that's only a guess. But I
think DWT is D1-only right now (so is wxD).
SWT uses GTK on Linux (unfortunately), so presumably DWT does as well. It's what
Eclipse uses. However, I do believe that you're right and that it's currently
only D1 compatible.
Correct, though I think they're working on Qt port. I'll try to do my
best to make DWT work with D2.
--
/Jacob Carlborg
sybrandy
2010-10-06 23:02:15 UTC
Permalink
Post by Jonathan M Davis
Post by Andrei Alexandrescu
I wouldn't spend much time on rewriting classic utilities in D. There's
plenty to be done anew. One category of tools to be written in D are
utilities aimed at D itself (parsers, analyzers, Thrift bindings,
protocol buffers bindings, code for DB interface, etc.)
Andrei
Indeed.
It could be reasonable to convert existing C or C++ code to D if you're going to
be heavily changing it, but converting pre-existing applications which are
currently in C or C++, and which you don't need to maintain, seems like a waste
of time. It _could_ be an interesting exercise in how to do things in D and
could very well show shortcomings in D, dmd's current implementation, and/or
shortcomings in Phobos, but then so would new applications.
At this point, if I can choose what language I'm going to write something in,
I'm almost certainly going to choose D (though obviously stuff like GUI apps may
not really be properly feasible in D yet, and some things are just gonig to work
better in other languages), but I have enough to do (and not enough time to do
it) without spending the time to rewrite entire, working applications in D.
- Jonathan M Davis
All true. I just figured that it's 1) a nice benchmark to show that
yes, D can replace C/C++ and 2) a way to review the existing utils and
potentially make them work a bit better. I also have a sneaking
suspicion that there may a few hidden bugs that could be prevented by
good D programming.

Casey
Nick Sabalausky
2010-10-06 04:19:40 UTC
Permalink
"sybrandy" <sybrandy at gmail.com> wrote in message
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite bug
free, but some probably could use a rewrite. Some may even benefit for
threading.
Not that I would want to do it myself, but I'd like to see LLMV and
Scintilla moved to D.

But really, just about anything in C/C++ that I might ever want to modify.
If I never have to touch another line of C/C++ it'll be too soon.
Andrej Mitrovic
2010-10-14 15:05:50 UTC
Permalink
Post by Nick Sabalausky
"sybrandy" <sybrandy at gmail.com> wrote in message
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite bug
free, but some probably could use a rewrite. Some may even benefit for
threading.
Not that I would want to do it myself, but I'd like to see LLMV and
Scintilla moved to D.
But really, just about anything in C/C++ that I might ever want to modify.
If I never have to touch another line of C/C++ it'll be too soon.
FYI, there's a DFL Scintilla component you can use in D2, which is
downloaded separately from DFL. I've made a small update to it in the
DFL forums although you would also need to add one more method in the
scintilla class to get messages back from Scintilla itself (I'll post
an update to the DFL forums some time later for that).

So basically the DFL component loads the scintilla DLL, and you can
use message passing or optionally get a function pointer for direct
access. It's really easy to use the editor from D in this way. In
fact, you can port *Scite* source code to a D equivalent that uses the
Scintilla DLL with ease. It only took me a minute to port the
automatic indentation functionality from Scite to a fresh project that
uses the DFLs Scintilla class.

I wouldn't know if there are any bottlenecks in the Scintilla
codebase, so I can't judge if it's worth porting to D. But it already
works and you can use it from D already, so why go through all the
trouble of rewriting it? :-)
Michael Stover
2010-10-14 17:32:44 UTC
Permalink
An operating system written in D would be really interesting.

On Thu, Oct 14, 2010 at 11:05 AM, Andrej Mitrovic <
Post by Nick Sabalausky
Post by Nick Sabalausky
"sybrandy" <sybrandy at gmail.com> wrote in message
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite
bug
Post by Nick Sabalausky
Post by sybrandy
free, but some probably could use a rewrite. Some may even benefit for
threading.
Not that I would want to do it myself, but I'd like to see LLMV and
Scintilla moved to D.
But really, just about anything in C/C++ that I might ever want to
modify.
Post by Nick Sabalausky
If I never have to touch another line of C/C++ it'll be too soon.
FYI, there's a DFL Scintilla component you can use in D2, which is
downloaded separately from DFL. I've made a small update to it in the
DFL forums although you would also need to add one more method in the
scintilla class to get messages back from Scintilla itself (I'll post
an update to the DFL forums some time later for that).
So basically the DFL component loads the scintilla DLL, and you can
use message passing or optionally get a function pointer for direct
access. It's really easy to use the editor from D in this way. In
fact, you can port *Scite* source code to a D equivalent that uses the
Scintilla DLL with ease. It only took me a minute to port the
automatic indentation functionality from Scite to a fresh project that
uses the DFLs Scintilla class.
I wouldn't know if there are any bottlenecks in the Scintilla
codebase, so I can't judge if it's worth porting to D. But it already
works and you can use it from D already, so why go through all the
trouble of rewriting it? :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101014/76076fa5/attachment.html>
Denis Koroskin
2010-10-14 17:43:29 UTC
Permalink
On Thu, 14 Oct 2010 21:32:44 +0400, Michael Stover
Post by Michael Stover
An operating system written in D would be really interesting.
http://wiki.xomb.org/index.php?title=Main_Page
Andrej Mitrovic
2010-10-15 19:46:07 UTC
Permalink
Just in case you're interested, I did an update in the DFL forums for
interfacing with Scintilla:

http://www.dsource.org/forums/viewtopic.php?t=5605

My last two posts show how to get messages from Scintilla, and I've
added a basic text editor example that has D syntax highlighting and
maintains indentation. You would need to build DFL, and put it's files
to DMD/windows/lib and build scintilla.lib which you passs to DMD when
you're buildling your editor. + you need to build the Scintilla DLL,
which will be called ScintillaLexer.dll, or something like that. (The
DFL build script does need some modification though).
Post by Nick Sabalausky
"sybrandy" <sybrandy at gmail.com> wrote in message
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite bug
free, but some probably could use a rewrite. Some may even benefit for
threading.
Not that I would want to do it myself, but I'd like to see LLMV and
Scintilla moved to D.
But really, just about anything in C/C++ that I might ever want to modify.
If I never have to touch another line of C/C++ it'll be too soon.
Iain Buclaw
2010-10-15 20:12:45 UTC
Permalink
== Quote from Andrej Mitrovic (andrej.mitrovich at gmail.com)'s article
Post by Andrej Mitrovic
Just in case you're interested, I did an update in the DFL forums for
http://www.dsource.org/forums/viewtopic.php?t=5605
Nice.
Post by Andrej Mitrovic
Post by Nick Sabalausky
"sybrandy" <sybrandy at gmail.com> wrote in message
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to
read and maintain as well as potentially improve the quality of the
software. Of course, most of these are so old they're probably quite bug
free, but some probably could use a rewrite. Some may even benefit for
threading.
Not that I would want to do it myself, but I'd like to see LLMV and
Scintilla moved to D.
But really, just about anything in C/C++ that I might ever want to modify.
If I never have to touch another line of C/C++ it'll be too soon.
I can imagine the next project I'd work on being an ICCCM and EWMH compliant
Window Manger.
Nick Sabalausky
2010-10-17 21:04:10 UTC
Permalink
"Andrej Mitrovic" <andrej.mitrovich at gmail.com> wrote in message
Post by Andrej Mitrovic
I wouldn't know if there are any bottlenecks in the Scintilla
codebase, so I can't judge if it's worth porting to D. But it already
works and you can use it from D already, so why go through all the
trouble of rewriting it? :-)
I've been tempted to try to add support for elastic tabstops, but the idea
of diving into a C/C++ codebase again is rather off-putting. But I'm not
actually going to go and port Scintilla just to do that ;)
Andrej Mitrovic
2010-10-17 22:29:42 UTC
Permalink
I think you might get away with modifying Scite, not necessarily
Scintilla. Since Scite is the one that takes care of indentation,
folding, etc., maybe it can be modified to use elastic tabstops.
Personally I find Scite's C++ codebase quite readable. (at least after
a pass of the uncrustify code beautifier :p).

I'll take a look at the full documentation of that elastic tabstops
trick and see if I can recreate it in D. It sounds like a fun project.
Post by Nick Sabalausky
"Andrej Mitrovic" <andrej.mitrovich at gmail.com> wrote in message
Post by Andrej Mitrovic
I wouldn't know if there are any bottlenecks in the Scintilla
codebase, so I can't judge if it's worth porting to D. But it already
works and you can use it from D already, so why go through all the
trouble of rewriting it? :-)
I've been tempted to try to add support for elastic tabstops, but the idea
of diving into a C/C++ codebase again is rather off-putting. But I'm not
actually going to go and port Scintilla just to do that ;)
Andrej Mitrovic
2010-10-17 23:02:44 UTC
Permalink
Well disregard that, it looks like the original author already tried
it with Scintilla, but it didn't work out:

http://groups.google.com/group/scintilla-interest/browse_thread/thread/44fca717735f860e/9275ab81016110a5?lnk=gst&q=elastic+tabstop#
Post by Andrej Mitrovic
I think you might get away with modifying Scite, not necessarily
Scintilla. Since Scite is the one that takes care of indentation,
folding, etc., maybe it can be modified to use elastic tabstops.
Personally I find Scite's C++ codebase quite readable. (at least after
a pass of the uncrustify code beautifier :p).
I'll take a look at the full documentation of that elastic tabstops
trick and see if I can recreate it in D. It sounds like a fun project.
Post by Nick Sabalausky
"Andrej Mitrovic" <andrej.mitrovich at gmail.com> wrote in message
Post by Andrej Mitrovic
I wouldn't know if there are any bottlenecks in the Scintilla
codebase, so I can't judge if it's worth porting to D. But it already
works and you can use it from D already, so why go through all the
trouble of rewriting it? :-)
I've been tempted to try to add support for elastic tabstops, but the idea
of diving into a C/C++ codebase again is rather off-putting. But I'm not
actually going to go and port Scintilla just to do that ;)
Kagamin
2010-10-06 06:29:24 UTC
Permalink
What would you rewrite in D?
Phobos.
Denis Koroskin
2010-10-06 08:30:08 UTC
Permalink
Post by Kagamin
What would you rewrite in D?
Phobos.
Nice one!
Andrei Alexandrescu
2010-10-06 14:23:40 UTC
Permalink
Post by Kagamin
What would you rewrite in D?
Phobos.
The irony/joke is lost on me, so I'll bite: how do you mean that?

Andrei
Denis Koroskin
2010-10-06 14:27:59 UTC
Permalink
On Wed, 06 Oct 2010 18:23:40 +0400, Andrei Alexandrescu
Post by Andrei Alexandrescu
Post by Kagamin
What would you rewrite in D?
Phobos.
The irony/joke is lost on me, so I'll bite: how do you mean that?
Andrei
He emphasized on "rewrite" rather than on "D".
Andrei Alexandrescu
2010-10-06 15:13:21 UTC
Permalink
Post by Denis Koroskin
On Wed, 06 Oct 2010 18:23:40 +0400, Andrei Alexandrescu
Post by Andrei Alexandrescu
Post by Kagamin
What would you rewrite in D?
Phobos.
The irony/joke is lost on me, so I'll bite: how do you mean that?
Andrei
He emphasized on "rewrite" rather than on "D".
Oh, okay. Well it is funny. Thanks!

Andrei
Kagamin
2010-10-07 06:28:39 UTC
Permalink
Post by Andrei Alexandrescu
Post by Kagamin
What would you rewrite in D?
Phobos.
The irony/joke is lost on me, so I'll bite: how do you mean that?
Don't worry, I didn't mean std.algorithm.
Emil Madsen
2010-10-18 10:27:48 UTC
Permalink
I would love to rewrite the copybyvalue and copybyreference schematics, to
one, and then keep that one. I think its counter intuitive that the same
syntax is used for both, and tbh, if everything was just copybyvalue, one
would be able to use by reference, if they wanted to by explicitly declaring
so, using pointers/references/ect., this is the one thing that bugged me
mostly in Java, when coming from C, and the thing that bugs me the most
about D.
Post by sybrandy
Just asking out of curiosity. With all the great language features, I'm
sure that many of you have thought about this.
For me, I figured a good start would be your basic Unix/Linux/BSD
utilities, like cat and grep. I figure it may make the code easier to read
and maintain as well as potentially improve the quality of the software. Of
course, most of these are so old they're probably quite bug free, but some
probably could use a rewrite. Some may even benefit for threading.
Anyone else?
Casey
--
// Yours sincerely
// Emil 'Skeen' Madsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101018/7abe0c1f/attachment.html>
Continue reading on narkive:
Loading...