开发者

D programming on Fedora 16

I've recently installed Fedora 16 (which is great), mostly because I wanted to try LDC2 but also because Gnome Shell runs much smoother on Fed开发者_运维知识库ora than Ubuntu 11.10 (at least on my hardware).

LDC2 works great, but I'm wondering if, by outputting LLVM .ll/.bc code, I can compile AND RUN the application on Windows/Mac/Android. I can compile .ll/.bc files to a ASM .s on my Windows machine with LLVM. However, my first attempts at compiling the ASM gives me the error: "'main' functions not found.". Looking through the ASM I do see a _Dmain function. I have no prior experience compiling ASM so I'm a bit lost.

I understand DRuntime comes into play here, but up-to-date information on the state of LDC2's DRuntime platform support is scarce. So I'm wondering what my options are here. Can LDC2 compile code for Windows at this point? Is cross-compiling for any other platform/architecture supported at this time?

What about GDC? I'd like to try GDC but I can't find it on the Fedora Software Center, and I'm a bit new to Linux so I'm having difficulties building it from source.


D (version 2) is my favorite language (C# at second), and I'm looking forward to the day I can write games/apps in D without having to worry about hardware or platform support. I'm rooting for the language and I hope the Open Source community embraces D strongly in the future. It truly is the best balance of power, performance, and productivity I've ever seen.


I'm wondering if, by outputting LLVM .ll/.bc code, I can compile AND RUN the application on Windows/Mac/Android.

The standard library and language runtime have plenty of code conditionally-compiled depending on the current platform, so no.


LDC2 works great, but I'm wondering if, by outputting LLVM .ll/.bc code, I can compile AND RUN the application on Windows/Mac/Android.

No. Not only due to runtime differences. Read http://llvm.org/docs/FAQ.html#platformindependent . Though it's C/C++ oriented, but still many things apply to D as well.


What about GDC? I'd like to try GDC but I can't find it on the Fedora Software Center, and I'm a bit new to Linux so I'm having difficulties building it from source.

Compiling GDC is straightforward. Just read the instructions thoroughly.

The rest has already been said. Platform-independence is achieved via conditional compilation at the D level so the bitcode is also platform-dependent.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜