Blaming the D language
Domingo Alvarez Duarte via Digitalmars-d
digitalmars-d at puremagic.com
Tue Oct 21 22:17:51 PDT 2014
Hello !
I'll start here a place to blame the D language with the intent
of register here the dark sides of the language and it's
libraries with the hope that it will drive efforts to fix then.
First a bit of my experience with the D language, I hear about it
some years ago and it was an interesting language but it gave me
the impression of immaturity like a bit more than a toy language,
most recently I gave it another look and it seems that it
progressed a lot since then.
I started searching the net for interesting opensource projects
using D language to test then and compare with C/C++ in terms of
performance.
Here are my folder with what I found interesting:
ae dmd-script harmonia-dad
arsd DMDScript harmonia-dad.tgz
tango-trunk
bcd.gen dmd-script-1 HarmoniaDemo
Tiny-Redis
dmd-script-2 Higgs
bindings dranges languagemachine-0.2.5
ubjsond
Croc dstep ldc2-0.13.0-linux-x86_64
userman
ctags-d D-templates-tutorial libasync uv.d
d2sqlite3 d-tui LuaD
vibe.d
decimal d-tut-master
vibed.org
deimos dwt minwin
dmd1 monodHello
vibelog
dmd2 GDC
vibenotes
dmd-c++ goldie Pegged
dmd-newmagic harmonia
Then I started compiling then to test, most of then do not
compile with the latest dmd compiler, I tried to fix then and on
some of then after fixing several things I end up finding bugs on
DMD compiler that I submit and some of then god fixed but then
one dark side of the D language came to light:
There is no backport/bug fix for the stable releases like gcc or
other well know software, gcc has at least the latest 3 stable
version maintained, when a bug is found it's fixed on all of the
maintained versions that suffer from it. The D language should
take note/learn from gcc here. Another interesting example is
Freepascal when a new compiler version is released they also
release a guide that highlight the major changes and how old code
will be affected by the changes and examples on how to change the
code to work with the new compiler version.
I would like to see the dub packages to declare the minimal dmd
compiler version that they guarantee it'll work, and before any
new release of dmd use the whole dub packages as a test bed and
for every project that do not compile write a how to on how to
convert the code to compile or somehow modify the compiler to
recognize old constructions and through warnings or other way
compile then.
It's so sad to see interesting projects using the D language
abandoned tired of code breakage with any dmd compiler evolution.
Let's talk about libraries now, there is some silly things like
associative array not having a "clear/lenght=0" way to reset it,
and people sugest create templates that does:
foreach(string key; aa.keys) aa.remove(key);
If we are on a memory pressure to liberate memory we need to
allocate more memory for big associative arrays that's insane and
generate more garbage to be collected (this is a small/silly
insane dark side).
Now let's see std.str I expect some functions that are widely
available on other languages to be present there but some of then
are std.algorithm, std.array, std.container, std.format and even
on std.str it's crazy for a new developer to find things on
phobos.
And then the massive/crazy attributes/properties and its
combinations that makes even harder to understand why some code
do not compile and give error messages miles away from our actual
offending code (thanks for templates everywhere).
Well I'll update time to time this post and encourage others to
do the same hopping that this will drive positive changes to the
D language.
Cheers !
More information about the Digitalmars-d
mailing list