4 ms·
It was very straightforward code looping, counting and storing strings in memory and writing to a file. Looking in perspective my guess is that the optimized C
by nudpiedo 8y ago
It was very straightforward code looping, counting and storing strings in memory and writing to a file. Looking in perspective my guess is that the optimized C runtime of python (IO and optimized string references) competed against Nim's bare strings.
If you are a pythonista I have a question for you, especially since I could still give Nim a try, how much effort would be for you to add 2 or 3 generators and asyncs in the python code and put in place a better architecture without any macros? how easy is the same thing in Nim without any library our of the standard library?
This speed of prototyping and bringing a better architecture to the solution sooner matters a lot more to me than raw speed (that comparison against python in speed was the last drop).
I believe you when you say that Nim won, after all they promose that some parsers such as csv parser could fit in the L2 cache and so on... hopefully the language and quality of libraries has improved.
P.S. how big was the whole wikipedia as XML? all languages?
- kungtotte 8y agoPython is intentionally a kitchen-sink type language that provides everything in its standard library, whereas Nim is intentionally the opposite. More and more things are moved out of its standard library to the package repository (Nimble). Thus, asking someone to write a stdlib-only solution in Nim is a bit of a trick question...