D Programming Language for Systems & Embedded Programming

Greg and I are working at X-Rite these days on an extended assignment. We’re part of a team developing a new color measurement device. It’s a complicated embedded system and the first large-scale implementation of our Agile and TDD approaches to embedded system development (incidentally, thanks, X-Rite, for your faith in us). One of our team members, Mark, has some familiarity with the D programming language. I’ve heard of it. It’s been in development for quite some time. Version 1.0 was just released in January of 2007. Because of Mark I just checked it out. It’s nice.

For anyone who’s worked with high-level programming in say Java or C# and also used C or C++ for low-level systems programming, you know that feature lust you get. You love working in a language like C close to the hardware but simultaneously long for capabilities more advanced languages provide. For instance, in our project we’re using C. We just implemented a simple exception handling mechanism based on setjmp/longjmp. While it’s definitely making error handling much simpler, it’s not fully featured exception handling.

Boy oh boy, does D look nice. Rather than try to summarize its niceties here, go read more about it on Wikipedia and check out its feature/language comparison page too. I wouldn’t be surprised if D picked up some decent steam in the systems programming world (there’s already support for Win32, x86 Linux, and OS X). Unfortunately, given the slow-moving software engineering culture surrounding embedded systems, I doubt D will make an appearance any time soon. Still, we can dream…



3 Responses to “D Programming Language for Systems & Embedded Programming”

  1. slide Says:

    Is there any active development that you know of to get D running on embedded, bare-metal type platforms?

  2. Mark Says:

    slide:

    This is the current state of things as far as I know:

    The official D versions (D1 and D2) by Digital Mars (DMD) are only x86 so far

    GDC – this is a D front-end with a gcc backend. Theoretically this means you can target anything gcc can (which is almost everything). The work I’ve done with it (mostly ARM) has been pretty tricky to get working, though.

    LDC – this is a D front-end to LLVM. Again, this means you should be able to target anything LLVM can. LLVM has a lot of momentum lately… and this port seems to be pretty active too. I have done some small experiments with getting it to target an ARM9. It seemed to work well. I hope to have more time to work on that in the future.

    For either LDC or GDC, you’re getting D version 1, which is missing some of the new (in-progress) features. But, they’re more stable, so that’s nice.

    D links easily to C, so bringing in libraries, RTOS’s etc is pretty easy.

    I hope this helps.

    Mark

  3. insurancebuild Says:

    Interesting…and I agree with all of it. Keep up the excellent work…I will undoubtedly be back soon


Leave a Reply

  

  

  

Stay Connected