4 ms·
Nim performance compares favorably to C++. It features a Pythonic syntax, optional soft real-time GC, optional manual memory management. Porting an elliptic cur
by Cyther606 12y ago
Nim performance compares favorably to C++. It features a Pythonic syntax, optional soft real-time GC, optional manual memory management. Porting an elliptic curve implementation over to Nim from Python was a cinch:
elliptic.nim: https://github.com/def-/bigints/blob/master/examples/elliptic.nim https://github.com/def-/bigints/blob/master/examples/ellipti...
elliptic.py: https://github.com/wobine/blackboard101/blob/master/EllipticCurvesPart4-PrivateKeyToPublicKey.py https://github.com/wobine/blackboard101/blob/master/Elliptic...
Others have reported success converting Python codebases directly to Nim. To put it in perspective [1]:
> The problem asked students to do a hundred runs and to try sample sizes of 10 and 100. For kicks, I did 1000 runs with a sample size of 1000. This took nearly 4 minutes in Python (macbook pro retina with i7 or i5? I forget...) and under 5 secs in Nim.
[1]: http://forum.nimrod-lang.org/t/589 http://forum.nimrod-lang.org/t/589
Rust and Go vs Nim: http://goran.krampe.se/2014/10/20/i-missed-nim/ http://goran.krampe.se/2014/10/20/i-missed-nim/
- dbaupp 12y agoThe Rust vs Nim comparison is tainted by very out of date documentation hosted on some MIT servers (the condition system is entirely gone). It's unfortunate and we have contacted the web master but there's not much they can do to remove or change how it appears in search engine rankings. For reference, doc.rust-lang.org is the only place to look for documentation for the standard libraries; any other hosting of those docs is likely to be out-of-date.
- bjz_ 12y agoHmm, was the parent comment edited? I can't see a reference to documentation...
- dbaupp 12y agoThe "I missed Nim" article to which it links to includes > Nim has Exceptions with tracking (!) and Rust has… something incomprehensible or perhaps its this, I am actually not sure ;). Again, for me, a clear win for Nim. where "something incomprehensible" links to very old documentation of the conditions system, which was removed quite a while ago.
- Dewie 12y agoIf we swapped the language, he might as well also have said: > The other language is named Nimrod... or perhaps it is Nim... I'm actually not sure ;).
- gokr 12y agoRegarding the parts where I link to out of date docs: 1. I will fix it later today/tomorrow, busy right now 2. I did actually search quite a bit, but that was what I as an outsider found. Consider this an "issue" to fix :) I think the issue was that the words I was searching for are not the words used to describe these mechanisms. Anyway, if you can give me a proper link to the canonical place where error/exception handling in Rust is documented - I will link it. Going to http://doc.rust-lang.org/0.12.0/reference.html http://doc.rust-lang.org/0.12.0/reference.html I still can't seem to find it.
- dbaupp 12y agoRe 2. as my comment states, we have tried to fix it, but we cannot: the administrator of that server is powerless. Error handling is mainly via types, mainly `Result`: http://doc.rust-lang.org/nightly/std/result/ http://doc.rust-lang.org/nightly/std/result/ . That part of your article will need changing because it is completely different to the condition system (that is, just swapping the link would be useless). Also, it's a little unfortunate that you entirely ignore the major difference between Rust and Nim in your little list of differences: Rust does not require a garbage collector (there is no GC used or implemented in the standard library). Lastly, unless you've participated in Rust development (I encourage everyone to do so, it's fun) it may be difficult to judge what the influence of the 'corporate' backing is... you're actually talking to a volunteer (no association with Mozilla) member of the Rust core team right now.
- gokr 12y agoWhat I meant with "issue to fix" - add a section in the documentation that has some kind of words that outsiders connect with "error handling": Error, Exception etc Perhaps I didn't search hard enough - but the next person will probably not search harder either. "Result" is not typically a word one would search for.
- Dewie 12y ago> "Result" is not typically a word one would search for. It was renamed from the more generic (type-wise) "Either", because the two tags (Left and Right) didn't feel very descriptive when it was used as a error-or-value type. But "Either" at least hints at the concept of "either this or that": "Result" is even more of a generic name. I don't know why they settled on a name like that. (The two tags, Ok and Err are more descriptive for errors, though.)