On Tue, Sep 27, 2011 at 6:30 PM, Ruben <[email protected]> wrote: > Hello, is there a chance an ARM backend can be written for dmd this year? I > realize this question has been asked periodically going back 4-5 years, but > ARM is turning into a major platform and I feel D2 could do very well in > this market, particularly with the renewed emphasis on mobile performance > favoring a native compiled language. Looking at previous newsgroup posts, > it appears that those wanting to use ARM are pointed at gdc/ldc, but it > seems like those two projects are usually behind in D2 support. I think it > would help D2 if dmd directly supported ARM, even Windows 8 runs on ARM. > > I don't know how much time it would require to port dmd's backend to ARM, > but it may not require much more than that. Android comes with an ARM > emulator powered by QEMU, one could probably try the port simply using the > free Android NDK. Iain mentioned getting a SheevaPlug almost a year ago; > I'd chip in a donation towards getting Walter or whoever a Pandaboard > (http://pandaboard.org/content/platform) or Trim Slice > (http://trimslice.com/web/models) to work on. Some estimate of when dmd > might come to ARM or why such a port is not a priority would be appreciated. >
Frankly, I don't think this will happen. GDC is generally only a few weeks behind DMD when a new version is released, and GCC already has a mature backend for ARM. 64 bit DMD took at least a few months, and ARM requires a different set of optimizations to deal with the different challenges a RISC architecture has. GDC has a few ARM-related bugs (I had to RMA my Trim Slice or I'd be working on them now), but getting it running will be simpler than trying to do a full blown DMD port, and given that GCC already does well there performance-wise and supports the many many variants of the ARM instruction set, porting DMD doesn't seem to have a good cost/benefit ratio. I do agree with you that native languages are going to get a very firm foothold in ARM (the best VM I've seen so far on ARM is Mono, and it has half the performance of C - Java is a few orders of magnitude slower), and I too hope to see D moving onto ARM, but I think GDC is probably the best bet at this point. As for LDC, I've really used LLVM on ARM (although apparently Mono uses it for codegen there). When I tried to build LDC there a while back, it segfaulted while building the standard libraries, and I never really investigated why. Hopefully someone with more knowledge of the DMD backend code can chime in with a firmer assessment, but I think an ARM port would wind up taking much longer than the 64 bit port did, and that efforts are probably better spent elsewhere at the moment.
