www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Take Python, add ";" and "auto", get 140x speed up ;)

reply "thedeemon" <dlang thedeemon.com> writes:
Just a bit of evangelism.

Original post of drawing Ulam's spiral of primes:

the Python code:

Direct translation to D:

Result is somewhat shorter and two orders of magnitude faster 
even with the same very very slow and unoptimal algorithm. And, 
it seems, 2x faster than PyPy and Shedskin that do pretty much 
the same thing.

Jan 06 2014
parent "Brian Schott" <briancschott gmail.com> writes:
But if it's in D how will your type mismatches leap out of the 
shadows at you at runtime?
Jan 06 2014