just a few small questions

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Apr 15 09:08:00 PDT 2006


"MM" <MM_member at pathlink.com> wrote in message 
news:e1qt2l$26iq$1 at digitaldaemon.com...
> Thx... but ehm, I can use D commercially but the backend? is a commercial
> product?
> Do I need to buy this? (I can't even find a page where I see any 
> purchasing :D
> (backend = the actual compiler?)

Oh no no, here's how it works:

Walter (the guy who is Digital Mars) wrote DMC, the C compiler.  It is made 
technically of two parts: the frontend, which turns the source code files 
into a sort of meta-format, and the backend, which turns the meta-format 
into a program.  The reason this is built like this is that Walter can take 
the backend off the C compiler, write the D frontend (which is open-source), 
and make the D frontend produce a meta-format that the backend can 
understand.  That way, half of his work is done for him - he doesn't have to 
write an entire second backend for the D compiler.  The backend is part and 
parcel of the D compiler, but you don't have to pay anything for it, as D is 
not (yet) a commercial product.  This is why there's a GDC compiler - the 
gnu compiler project has a backend specification, and people can write 
frontends for it.  In the case of D, it's just a matter of making the D 
frontend (open-source) output a meta-format the the gnu backend can 
understand.

The backend is not open-source, only because Walter is currently making 
money off of it by selling DMC.  If he were to release the source of the 
backend, people would be able to make a compiler just like DMC for free, if 
they just wrote a C frontend.

So in short, no, you don't have to pay a thing or worry about licensing or 
anything if you use D.  And if you're still not sure about it, there's 
always GDC :)

> Is a binding just as fast as a 'normal' implementation?

A binding is just the interface to a library of some sort for a specific 
language.  Most libraries come with C header files, and thus come with a C 
binding.  Making a D binding of something usually just involves translating 
the header file(s) to D (since D is link-compatible with C).  D interfaces 
with C code very well; there is no performance penalty. 





More information about the Digitalmars-d-learn mailing list