safeD

jerro a at a.com
Sat Mar 9 11:07:29 PST 2013


> Is this suitable for embedded targets such as ARM Cortex 32 bit?

For ARM, your best bet is to follow this guide to build a GDC 
cross-compiler (probably easiest to build on a Linux host):

http://gdcproject.org/wiki/Cross%20Compiler/crosstool-NG

I don't know what kind of ARM Cortex you have in mind and what OS 
do you need to use. If you mean Cortex A8, A9 or A15 and if your 
target OS is GNU/Linux, then you can use Druntime and Phobos. I 
haven't used GDC on ARM enough to know if everything in Druntime 
and Phobos works, but the parts that I have used did work. In 
this case you should be able to SafeD too, as it's just a subset 
of D.

For Android there's a fork of GDC at 
https://github.com/jpf91/GDC/tree/android, but it hasn't been 
updated for some time now. There are build scripts that build NDK 
with gdc support at https://github.com/jpf91/gdc-android-scripts. 
I don't know how well that fork works. Also, GDC's Druntime does 
not support shared libraries, which is a problem if you want to 
call D functions from java apps.

If you are using some other OS or no OS at all, I don't think 
there is a working version of Druntime you can use. In that case, 
you could probably still use D, but without Druntime. You would 
need to write stubs for some Druntime functions to avoid linker 
errors, and you would need to avoid any D features that use 
Druntime. Because of that, you couldn't use any feature that use 
a GC, such as operator new, associative arrays, closures or 
appending to slices. This would also make it impossible to 
effectively use SafeD (because you wouldn't be able to allocate 
memory). You could port Druntime to your platform, but I guess 
this is a lot of work.


More information about the Digitalmars-d mailing list