D looses in speed to Common Lisp

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Tue May 12 03:03:30 PDT 2015


Am Tue, 12 May 2015 01:48:57 +0000
schrieb "bachmeier" <no at spam.net>:

> On Monday, 11 May 2015 at 21:15:33 UTC, Dzhon Smit wrote:
> 
> Seems this:
> 
> --dynamic-space-size 4GB
> 
> is pretty important. I don't have that much RAM on my Chromebook 
> so I removed it. It dies quickly with the error
> 
> Heap exhausted during garbage collection: 1408 bytes available, 
> 2240 requested.
> 
> I'm guessing that your code is not doing the same thing as the D 
> code if you have to use tricks like that just to get it to run. 
> Having used Common Lisp, I know your program requires extensive 
> knowledge of the language, and was the result of a careful 
> optimization exercise - unlike the D code. It's definitely not 
> the kind of code you'd write after reading Practical Common Lisp.

I don't know LISP, but I find no trace of appending numbers to
a temporary dynamic array in the LISP code. If so, from an
algorithmic point of view Daniel Kozak's version is the most
spot-on translation of the original.

The idea behind porting code between languages as different as
D and LISP should not be to replicate the computational work
while staying true to the target language. Similar looks wont
get you there.

-- 
Marco



More information about the Digitalmars-d mailing list