Slashdot Mirror


Is D an Underrated Programming Language?

Nerval's Lobster writes: While some programming languages achieved early success only to fall by the wayside (e.g., Delphi), one language that has quietly gained popularity is D, which now ranks 35 in the most recent Tiobe Index. Inspired by C++, D is a general-purpose systems and applications language that's similar to C and C++ in its syntax; it supports procedural, object-oriented, metaprogramming, concurrent and functional programming. D's syntax is simpler and more readable than C++, mainly because D creator Walter Bright developed several C and C++ compilers and is familiar with the subtleties of both languages. D's advocates argue that the language is well thought-out, avoiding many of the complexities encountered with modern C++ programming. So shouldn't it be more popular? The languages with the biggest gains this time around include JavaScript, PL/SQL, Perl, VB, and COBOL. (Yes, COBOL.) The biggest drops belonged to the six most popular languages: Objective-C, C, Java, C++, PHP, and C#.

10 of 386 comments (clear)

  1. Should be, but it isn't. by Anonymous Coward · · Score: 5, Interesting

    Should be, but it isn't.

    Here are couple of reasons why (IMHO):

    1. The main compiler is not free-software (as in freedom).
    The compiler package (called 'dmd' [http://dlang.org/download.html]) has a non-free license,
    and regardless of any wishi-washi explanations about front-end/back-end freedom, the fact is - it is not free, and will never be included in any distribution's main repository.

    2. The free-software compilers (GDC, based on GCC and LDC, based on LLVM) are always lagging behind in features and compatiblity.
    Walter Bright and Andrei Alexandrescu (the two lead developers) focus mainly on DMD, and so the free-software version will never catchup.

    3. Building the compiler and the 'standard library' (which was itself a moving target up until recently) is done with really broken 'makefile' system, which requires one to put things in specific directories. Not fun for package maintainers, or for people wanting to build the lastest versions. Time to move to CMake (or autotools).

    4. poor eco-system and package-manager. There is 'dub' (http://code.dlang.org/) but it is barely useable in the real-world. For example, the slightest error in the 'package.json' file of a package, and not only nothing works, but also the error messages are next to useless.

    5. Less-than-great platform support. Despite claims to supporting Windows,Linux and FreeBSD - it seems some compilation/linking things are not functional on Linux (haven't tested FreeBSD). There's seem to be a big focus on Windows, and little motivation from the top-brass to give a 'push' to make it work perfectly on Linux.

    6. A pet-peeve: The 'string' type is very annoying. Regardless of how marvelously it is engineered to fit perfectly within the D-language paradigm, using it is a pain, especially when needing to pass it around or modifying it.
    An example is http://stackoverflow.com/questions/20747893/convert-auto-string-to-char-in-d

    That being said,
    The compiler 'dmd' is blazingly fast,
    and once everything is setup correctly (and if one ignores the non-free issue), then programming in D is so much fun! It really feels like this: http://xkcd.com/353/

  2. I tried it by gabereiser · · Score: 4, Interesting

    and I liked it, until I tried to deploy it. I think D could really use some more documentation on deploying applications written with it outside of the systems applications. I tried making a desktop application (opengl based) with it and found it extremely difficult to deploy to other machines let alone Mac OSX. But then again, it could have just been my naiveté.

  3. PL/I on TIOBE by Rob+Riggs · · Score: 3, Interesting

    Who knew that PL/I was still a thing? Hell, even IBM is releasing a compiler update for this language. Somehow it is about as popular as D.

    --
    the growth in cynicism and rebellion has not been without cause
  4. Re:COBOL by firewrought · · Score: 5, Interesting

    I never understood what D offered that wasn't offered elsewhere.

    Mainly, it's a systems programming language, meaning that it gives the programmer fine-grained control over memory and operations so that you can write operating systems, drivers, and high-performance applications. This is relevant because, aside from the two biggies (C and C++), there aren't a lot of other languages in this space. I mean, there's Objective-C (which sort of half-asses it), and recently Go and Rust arrived on the scene. All the other popular languages are pretty much for scripting (Python, JavaScript, PHP, etc.), or running atop a managed virtual machine (Java and C#).

    As for what it offers... it's basically a re-invention of C++. No, no... it's deeper than that. It's the idea of C++ re-invented in such a way that you get most all the power and low-level control of C++ without so many of the dangers and difficulties.

    Unfortunately, D has struggled to gain wider acceptance. It fractured it's community when D version 2 broke backwards compatibility with D version 1, and the forums (which run on a dedicated Usenet server, FFS) are filled with endless commentary about what does and doesn't work in the latest point release of the DMD compiler. Bright and Alexandrescu have certainly designed a compelling language, but they seem (from my distant vantage point) to be mired in implementation details... yeah there's a standard library and everything, but the surrounding ecosystem (standards, tutorials, tools, IDE's, API's, packaging, etc.) hasn't made the leap to that sort of functional minimum you see with (for instance) node.js or Haskell's "batteries included" experience.

    TL;DR - D's a super awesome low-level language, but it's not yet a platform.

    --
    -1, Too Many Layers Of Abstraction
  5. Re:COBOL by OrangeTide · · Score: 3, Interesting

    That's your argument?

    It wasn't an argument, it was a statement to illicit answers to an unsaid question. But let's pretend it was argument, since that is how you chose to interpret it.

    There are technical merits that D has over C, I'm not likely to use D over C, but that's really orthogonal as my job requires I use C and it's not really up for debate. There are some niceties(?) that D has over C++, but I'm even less likely to use a language because it seems nicer. The features of D doesn't seem like anything that isn't solved (but perhaps in an ugly way) by C++11 and Boost.

    D's biggest strength is also it's biggest weakness. It's not a huge leap for a developer that knows C++ (or C) to learn D. But if you're going to switch tools, why not go for broke and switch to a pure functional language that will completely alter the way you have to design your software, perhaps in the ML family?

    --
    “Common sense is not so common.” — Voltaire
  6. Re:COBOL by OrangeTide · · Score: 3, Interesting

    I'll give you some context on where I come from, I'm professionally 100% C. Kernels, RTOSes, etc.

    I played with D a bit, it's not for me, and I'm not here to sell people on it. I appreciate the effort you put into your response, but my original lack of understand on what D really offers remains. Responses like "high-performance applications" tend to flow over my like water over a duck's ass. (I'm the ass)

    JavaScript isn't just for scripting anymore. The run-time performance is acceptable for some rather serious scalable software. And there are better static analysis tools now, although Java and a few others still beats JS at unit testing and validation.

    There seems like there are a dozen new languages every year, D has been around for a while. I wonder if it hasn't taken off because of people like me not really getting why I would switch over.

    --
    “Common sense is not so common.” — Voltaire
  7. Re:COBOL by david_thornley · · Score: 3, Interesting

    AFAICT, it's an effort at C++ done right.

    C++ has a whole lot of infelicities that it acquired for historical reasons and can't really get rid of. The really big problem was C compatibility. Remove the need for that and you can get all of C++'s benefits (except C compatibility, which is usually not important) with a lot less hassle. There's lots of other things over the development of the language that sure are not what people would do nowadays. When the first standard came out, it had lots of implications that were not well understood, such as exception safety and the fact that templates are Turing-complete. The more recent standards make it a much better language, but about the only C compatibility that has been ditched is the repurposing of "auto", which nobody used anyway.

    The question is whether this is worth it. There's lots of good C++ compilers out there. There's lots of books and tutorials and websites on how to write good C++. There's tons of C++ code that isn't going to be rewritten any time soon. There's oodles of C++ developers (not all of whom are good). Given a choice between C++ and D, with no other considerations, I suspect D would be by far the better choice. Given the existing situation, it's unclear that D will ever be more than a niche language.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  8. c++11 does it in by Anonymous Coward · · Score: 3, Interesting

    'D' was somewhat appealing until C++11 was released and support started. That removed any core feature advantages 'D' had.

    The whole mess of 'D' having automatic garbage collection as part of the language turned systems programmers who the language is supposed to target and also makes the language much more difficult to implement. Yes the compiler is easier to write but 'D' is much heavier than C++ feature wise erasing any advantage it may have had on the compiler side.

    So other than compilation speed what 'D' offers is marginally nicer than C++ but brings along with it a bunch of baggage, limited platform support and some very questionable engineering decisions.

    I personally would rather see C++ resyntaxed so that it's easier to compile. Unfortunately that would break source compatibility and have a bunch of other issues as well.

  9. Re:COBOL by DuckDodgers · · Score: 3, Interesting

    The features of D doesn't seem like anything that isn't solved (but perhaps in an ugly way) by C++11 and Boost.
    Except D has compile-time evaluation of a significant subset of the language as its alternative to the C++ preprocessor. That, among other things, means large D projects compile orders of magnitude faster than equivalent size C or C++ projects. Fast compile times were one of the killer features touted when Google launched their 'Go' language, but D compiles as quickly or more quickly and is a lot closer to "C++11 with simpler syntax" than Go.

    But if you're going to switch tools, why not go for broke and switch to a pure functional language that will completely alter the way you have to design your software, perhaps in the ML family?
    Fair point. I can't argue with that.

  10. NO by russotto · · Score: 1, Interesting

    As long as it's a garbage collected language it goes in the heap with Java, C# and the rest of the garbage collected languages. If you want to compete with C and C++, you need real memory management.