D vs C++

Mariusz Gliwiński alienballance at gmail.com
Mon Dec 27 08:53:07 PST 2010


Monday 27 December 2010 @ 17:18:17 Daniel Gibson:
> Am 27.12.2010 17:01, schrieb Caligo:
> > On Mon, Dec 27, 2010 at 7:20 AM, Jonathan M Davis <jmdavisProg at gmx.com
> >     <mailto:newshound2 at digitalmars.com>> wrote:
> >      > > 11. generative programming
> >      > 
> >      > Does someone have a pointer to any kind of doc about this? (in D)
> >     
> >     Anything on templates, template mixins, and string mixins. All of
> >     them generate
> >     code. And some people have done some pretty crazy stuff with them
> >     (especially
> >     string mixins).
> >     
> >     - Jonathan M Davis
> > 
> > So is it like template metaprogramming in C++?  a small D example would
> > be helpful.  There doesn't seem to be anything about it in TDPL.
> 
> http://www.digitalmars.com/d/2.0/templates-revisited.html

Firstly,
I admit I'm still new in programming so treat me like that but...
On my peasant-like brain, if You can't store compilation-time variable, to 
read it later... from other template, even module with normal language rules 
but in compile time, it's not *fully* generative programming, is it? You can't 
make many things without that.

As I said, I'm new in programming so maybe that's why, but D was my ideal 
language (so i could express everything i imagined). But this little thing 
makes templates only small spice to what I've seen before, instead of big step 
forward. I understand it might be hard to implement with clear rules of usage, 
but I abstracted it out.

Ps. I want compile-time raytracer downloadable again, please :)

Sincerely,
Mariusz Gliwiński
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101227/e1e89298/attachment.pgp>


More information about the Digitalmars-d mailing list