5 ms·
Great article! I'd like to add that the D programming language also offers a lot of features to create robust code with multiple paradigms, although the syntax
by jeremiep 14y ago
Great article! I'd like to add that the D programming language also offers a lot of features to create robust code with multiple paradigms, although the syntax is heavily C oriented rather than functional.
'immutable' and 'shared' are added to the known C 'const' qualifier for data that will never change (contrary to not changing in the declaring scope only) data which is shared across threads, everything else is encouraged to use MPI using the std.concurrency module.
Pure functional code can be enforced by the compiler by using the 'pure' qualifier. There is even compile time function evaluation if called with constant arguments, which is awesome when used with it's type-safe generic and meta-programming.
There's unit tests, contracts, invariants and documentation support right in the language. Plus the compiler does profiling and code coverage.
I'd be curious to test D against Erlang for such a system. (Not saying Erlang shouldn't be used, it's the next language on my to-learn list, just that the switch to functional might be too radical for most developers used to imperative and OO and D provides the best of both worlds.)
- misnome 14y agoI've been interested in D for a while, for these reasons and more - it's features look nice, but it never seems to have gotten much popularity/mindshare. Could you hazard a guess why?
- pjmlp 14y agoIn the early days there were some issues in the community which lead to the Phobos/Tango divide in the standard library for D1. This is now past history as the community has joined around D2, just known as D, and strives to reach compliancy with the "The D Programming Language" book written by Andrei Alexandrescu. D2 development is made in the open with source code available in GitHub. Besides the reference compiler, dmd owned by Digital Mars, there are also LDC and GDC compilers available. Currently it seems that GDC might be integrated into GCC as of 4.8 release. Right now it seems more people are picking up D, mainly for game development projects.
- CJefferson 14y agoIndeed, the D1 splits, and and also questions being answered with "that will be in D2". There is now a problem that there is not yet a consensus about how D2 compares to C++11.