Hacker News new | ask | show | jobs
by arc776 2077 days ago
I would say one of Nim's biggest strengths is the productivity of Python with the performance of C; it feels like scripting, but you have production ready performance.

Another productivity benefit is compiling to C, C++, and Javascript means you can natively use libraries from those languages.

If you want to go deeper, check out the extremely powerful metaprogramming capabilities that rival Lisp and I would argue are much more advanced than Rust. The end result of this is very nice syntax constructions which means easy to read code, and again translates to high productivity with no performance loss.

1 comments

To me this is more of an argument against. Although Python was my first language, I've had my share of burnouts because of its lack of types and difficulties in refactoring big code-bases.
> I've had my share of burnouts because of its lack of types and difficulties in refactoring big code-bases.

Nim is strongly, statically typed. Also, I agree and aside from performance it's why I started using Nim instead of Python for my gamedev hobby. Dynamic typing isn't good for large projects. Nim has great type inference though, so you get the readability of Python but with strong compile time type guarantees.

Eg;

    type SpecialId = distinct int # This int is now type incompatible with other ints
    proc handleId(id: SpecialId) =
      # ... do something with id.
Nim has productivity, expressiveness and readability that matches Python. Not the dynamic typing.
Don't be misleaded - the only thing Nim really has from Python is the off-side rule (indentation). Nim is statically typed and compiled to native binaries
Yeah I should have stressed that it's just the productivity that matches Python, not the operation. As you say it's similarity is only skin deep with significant whitespace.

In terms of use I find it feels a lot like a better Pascal but with powerful metaprogramming.