4 ms·
Nim vs Crystal is an interesting read if not to just compare syntax (three articles span 3 years so I wonder how much has changed since): https://framework.emb
by antattack 6y ago
Nim vs Crystal is an interesting read if not to just compare syntax (three articles span 3 years so I wonder how much has changed since):
https://framework.embarklabs.io/news/2019/11/18/nim-vs-crystal-part-1-performance-interoperability/index.html https://framework.embarklabs.io/news/2019/11/18/nim-vs-cryst...
- gpanders 6y agoI hadn't heard of Crystal before reading the OP, but I agree that Nim seems like the most apt comparison as far as new-ish languages go.
- noisy_boy 6y agoI tried to re-run the json parsing test mentioned in the article using latest stable version for both (not super scientific but just compiling the same code using same command and running the binary against the same json ). Crystal completed the task in 2.1s~ vs 3.71s~ for Nim (the timings were quite stable across multiple executions). So seems like atleast for this test, Crystal continues to be quicker.
- cb321 6y agoThat json test gets a lot of attention but A) large scale floating point IO is a terrible application of json (if for no other reason than that float parsing is slow) and B) this mostly measures construction of a big object graph, not json parsing, and so is a poorly isolated test. A better Nim impl would use `parsejson` directly at which point its speed can approach the fastest of any impl. [1] Also, it is implementions (like stdlib) that are assessed not the speed of the language. There are like 10 json parsers beyond the stdlib. No idea about Crystal ecosystem diversity... EDIT: Also, I just ran the base64 encode/decode and with `crystal build --release b64.cr` vs. `nim c --gc:markAndSweep -d:danger --cc:gcc --passC:-flto b64`, the Nim ran twice as fast not half as fast. Anyway, people should not draw conclusions like "Crystal is faster than Nim" from things like this. [1] https://forum.nim-lang.org/t/6920 https://forum.nim-lang.org/t/6920