News for hackers. Stuff that matters.
Re:Nim in 2018: A short recap by sharmi on Wednesday January 09, 2019 @10:37AM (#18865469)
I have not programmed in Nim and I am a Pythonista.

Having said that, I had to parse the whole wikipedia dump xml file once and extract just the text. The python code for the same was so slow and would have taken days to go through the whole xml file.

In my quest to find something faster, I came across a nim program that would take the xml in and dump a plain text file (or markdown?) file. It did the work within 2 hours.

So I don't believe it was slower than python.

Nim certainly has it's place and it is more comparable to go in speed.

Re:Nim in 2018: A short recap by nudpiedo on Wednesday January 09, 2019 @10:45AM (#18865555)
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?

Re:Nim in 2018: A short recap by kungtotte on Wednesday January 09, 2019 @12:57PM (#18866954)
Python 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...