On 16/05/10 15:27, Dan W wrote:
Hi all, I'm toying around with the idea of porting my raytracer codebase to D.
But before committing, I have a few rookie questions:
1: What kind of license is the D compiler under? I'm thinking of shipping a
commercial, close sourced (for now) program with the D compiler (so that users
can compile within the GUI). Is this possible to do, or can I least pay for the
priviledge?
dmd is under 2 (3) licenses, one for the front end and one for the
backend. I won't go into details, you can find the details in the
archives though. Long story short if you want to redistribute dmd you
have to ask Walter for the priviledge. LDC and GDC have no such
restrictions, you can include them as long as you don't modify the
source, and if you do then you distribute the source as well as the
binaries.
2: Is it possible to use D with the Visual C++ IDE? Preferably, I would like
the apprepriate compiler and D options listed in the options (in place of the
usual c/c++ options).
Try VisualD, which was released about a month ago. I haven't tried it
yet, I believe it still has some way to go... This said its current
feature list looks impressive.
http://dsource.org/projects/visuald/
3: I need my program to be as fast as possible. The Visual C++ compiler has
features such as "link-time code generation" and "Profile guided optimization".
Does D have equivalents?
If you want LTO you'll need to use LDC with some fancy compilation steps
(I believe bearophile, our resident benchmarker should be able to
provide you with these). The downside to LDC is that it does not support
exceptions on windows (it will support them as soon as llvm does).
4: Does D play nicely with QT, SDL, Lua?
See:
http://dsource.org/projects/qtd/ - Qt bindings
http://dsource.org/projects/luad/ - Lua bindings
http://dsource.org/projects/derelict/ - Various bindings for
multimedia/game apps including SDL, OpenGL, OpenAL etc
5: How about compatibility with GPGPU stuff like CUDA and OpenCL? Can I just as
easily write GPGPU programs which run as fast as I can with C/C++?
I don't know what the status of this is, I think a couple of people have
written some initial bindings for either CUDA or OpenCL, perhaps someone
else can enlighten you as to their status. As for their speed it will be
just as fast as the equivilant code in C/C++.
I hope things go well for you, there's a lot of initial hurdles for
getting into D, but once you find your way around them you'll learn to
love this great language! There are lots of people that have written ray
tracers in D, so should you need assistance there's people who can help.