Hacker News new | ask | show | jobs
by deltaonefour 1457 days ago
There's 3 languages in the same class. Julia, Nim and Crystal.

I'm specifically curious about Crystal vs. Nim. Benchmarks show that crystal is pretty much faster, but I'd also like to know the advantages of why someone would choose Nim over Crystal I'm looking for reasoning that is deeper then just superficial language syntax differences.

Has anyone extensively used both? I would like an unbiased view from someone who has used both as opposed to someone who's only used one.

5 comments

Gonna copy paste an old comment of mine:

-----

Syntax wise: Nim is to python what Crystal is to Ruby

Capability wise: both are incredibly powerful general purpose languages. Crystal is fully OOP, while Nim has a more functional/procedural bent. Nim is better for DSLs and has a fascinating macro system.

For system language use, Nim is a better choice as you can use it with its Arc GC or no GC at all.

Perf wise, Crystal seems to be marginably faster in most benchmarks. Though at that level the difference isn't much.

crossplat wise, Crystal has no "official" windows support (and you cannot do webdev on it) while Nim has.

Ecosystem wide: Both are young languages and the ecosystems are tiny. Crystal has more and better options for webdev. Nim, IMO, is better for games, console apps etc.

Tooling wise; crystal IDE tools are far behind that of Nim. But both are terrible when you consider any decent language out there.

Ecosyt

Personally I like Crystal a lot due to its type system and syntax but you can't go wrong with either language.

Perfect! Thanks!
One major issue that stopped me from trying Crystal is that Windows support is being worked on since 2013 and is still WIP as of 2022 with major language features still not working...

https://github.com/crystal-lang/crystal/issues/5430

Julia isn't in the same class and workflow usually differs significantly from the others.
It is. Ruby and python are in the same class despite python being more data oriented.

Julia is the same thing. Data oriented.

Ruby and Python aren't data oriented. Python specifically was designed and used as system scripting language and Ruby was designed as an improved Python. Python only came to be used for analytics (as well as web and app development) because people made libraries for it. It could have been another language. Nim and Crystal could be utilized to write the underlying libraries (being performant static languages) but it will be hard to serve as exploratory frontend like the previous due to lacking interactivity. In contrast Julia can fulfill both the role of the underlying and the frontend language.
Python is data oriented. Nobody is talking about origins of programming languages. That is a separate topic. We are talking about the language as it stands now based on how it's used and the ecosystem.

I never said Ruby was data oriented.

Last I used it, Crystal’s compilation times are brutal. They may have fixed this (for non-production / dev iteration) with their work on an interpreter, though.

After using fast compilers, it’s really painful to go back to slow ones.

That said, Crystal is a really great language, and I plan on tinkering with it again soon.

What class of languages are those?
script style languages specifically designed with modern concepts and to be highly performant.

V8 is likely the fastest interpreter (javascript) for a script style language but these languages should be a step above and beyond v8 in terms of performance.

Nim is not a "script style language". By default it compiles to C, and the generated C sources are then compiled with gcc or clang, etc.

As it says on nim-lang.org, "Nim is a statically typed compiled systems programming language".

I know. But the syntax is still script style. The syntax is more closer to Python then it is to C++.