D and the world

Daniel Keep daniel.keep.lists at gmail.com
Thu Apr 26 06:25:16 PDT 2007



eao197 wrote:
> On Thu, 26 Apr 2007 15:31:57 +0400, Jari-Matti Mäkelä
> <jmjmak at utu.fi.invalid> wrote:
> 
>>> Unfortunately parsing X509 certificates can be very tired task because
>>> it is necessary to handle ASN.1 data structures, byte ordering,
>>> calculating digital signatures and so on. Do you want to implement MD5,
>>> SHA1 or SHA256 via CTFE and templates? :)
>>
>> No :), I was just pointing out that you can do this with D too. I'm not
>> sure how much better Nemerle would do.
> 
> Nemerle allows to call code from any library at compile time.

IIRC, this is because Nemerle takes the macros, compiles them to a
library, loads that library and then hooks it into the compiler.
Nemerle's macros are basically full and complete libraries that get run
like normal code, so there's no reason they *shouldn't* use other libraries.

D on the other hand does CTFE via an extension to constant-folding, so
it is much more limited than Nemerle's approach.  Nemerle is doing a
full meta compile, link & execution stage, whilst D is just doing
symbolic manipulation (kinda).

On the other hand, I don't think Nemerle can run unmodified functions at
compile time, or do all the cool tricks we can with templates.  You win
some, you lose some :)

>> No, seriously, CTFE is
>> something totally different from C++ templates in terms of usability.
> 
> Fully agree with you here.
> 
> --Regards,
> Yauheni Akhotnikau

	-- Daniel

-- 
int getRandomNumber()
{
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

http://xkcd.com/

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d mailing list