avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Programming AVRs in D?


From: David Brown
Subject: Re: [avr-gcc-list] Programming AVRs in D?
Date: Fri, 29 Dec 2006 10:51:44 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

Rick Mann wrote:
I just got ahold of of a D Programming Language compiler for Mac OS X. I'm wondering if it's possible to write code for AVRs in D? Does anyone know?

Can I build the GCC toolchain and enable D for it?

--Rick


There are basically three parts to getting a gcc-based programming language compiler working for a given target - front-end support, back-end support, and a library. There is already back-end support for the avr in the main line, and there is front-end support for D (although I'm not sure it is part of the main distribution). So theoretically, it should be possible to build support for the D language for the AVR just as you suggest. The library is going to be a different matter - it's going to need a lot of porting to make it suitable for use on an AVR. I don't know D (I've read a little on the web - it looks interesting), but I believe it needs library support for the language itself (such as for garbage collection). This "library" is more akin to the level of avrgcc's arithmetic routines rather than the standard C library (which you can choose to use or not). I don't know whether or not you can get D compiled for the AVR without the support library - you are certainly unlikely to get it linked without a minimal library.

Have a look at the avr ada project - they have dealt with exactly the same issues regarding ada compilation for the avr. It's clearly not just a matter of a download and build, but it is also clearly possible to do.

There is a big question as to whether it is worth the effort, however. D is not a language well suited to the AVR - it specifically assumes a minimum of 32-bit support on the target, so I'd imagine it would take a lot of effort to tune the compiler into making decent code for the AVR (it is bad enough with C requiring 16-bit for ints). A powerful automatic garbage collection system is nice on a big system, but doesn't really fit in the world of small microcontrollers.

Still, it will be very interesting to hear how you get on (even if it is only "I tried, but it didn't work" !)

mvh.,

David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]