Besides that benchmarks rarely benchmark realistic code and the Nim blog doesn't mention being the fastest out there, but it mentions "native performance" which I feel like is a fair claim.
261 karma · joined October 25, 2016
Besides that benchmarks rarely benchmark realistic code and the Nim blog doesn't mention being the fastest out there, but it mentions "native performance" which I feel like is a fair claim.
> Fast compile times: a full compiler rebuild takes ~12s (Rust: 15min, gcc: 30min+, clang: 1hr+, Go: 90s) [2].
The compiler is really big and self-hosted too.
For large nim projects check out: https://github.com/mratsim/Arraymancer or https://github.com/treeform/pixie (personal faves).
* Shell scripting, I still assume most people will just use Bash tho: https://github.com/Vindaar/shell
* Frontend: https://github.com/karaxnim/karax or you could bind to an existing JS library.
* Backend: For something Flask-like: https://github.com/dom96/jester or something with more defaults https://github.com/planety/prologue
* Scientific computing: the wonderful SciNim https://github.com/SciNim
* Blockchain: Status has some of the biggest Nim codebases currently in production https://github.com/status-im?q=&type=&language=nim&sort=
* Gamedev: Also used in production: https://github.com/pragmagic/godot-nim and due to easy C and C++ interop, you get access to a lot of gamedev libraries!
* Embedded: this is a domain I know very little about but for example https://github.com/elcritch/nesper or https://github.com/PMunch/badger for fun Nim+embedded stuff!
Most of the disadvantages come from tooling and lack of $$$ support.
* I feel like Go has less 'edge cases', but the Nim compiler is steadily getting more stable, especially consider it's not backed up by a major company!
* Metaprogramming is really powerful, but not beginner friendly. The documentation says use macros when necessary, but personally I don't think that really happens in practice.
The advantages by far outweigh the disadvantages, especially if you are looking for a clean Go alternative(except maaaaaaybeee web application).
EDIT: my own wishlist, but they aren't relevant compared to Go:
* Better sum types * Builtin pattern matching
And Nim does not have a mandatory GC, you can go as low-level as you want, but in case you don't want that you can choose from several great GC's(a capable soft real-time GC and Boehm for example). Or you could combine the best of both worlds and take a look at the shiny fancy ARC/ORC deterministic memory management: https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...
I also saw TypedClojure but not sure what to choose.
But I do like my types, so basically I'm conflicted.
Except for implicits ha.
Besides that Nim uses UFCS, you can mimic 90% of your OOP needs without using pragmas or methods or anything like that.
If my codebase enforces camelCase and a library uses snake_case, then I can still use that library using camelCase, and Nim has nimgrep to make this easier all the way.
As far as graphics go, I'd say Pony is quite early stage for such elaborate API's like Skia.
Also worth mention would be F#: https://github.com/SciSharp
Is the only difference the ecosystem around the toolchains?
https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc...
https://www.youtube.com/watch?v=aUJcYTnPWCg
https://github.com/stisa/nwasm
You can also go an Emscripten route: https://hookrace.net/blog/porting-nes-go-nim/
Recent versions also use this fancy thing: http://www.gii.upv.es/tlsf/
For example see: https://github.com/mratsim/Arraymancer in the README it mentions:
> Note: While Nim is compiled and does not offer an interactive REPL yet (like Jupyter), it allows much faster prototyping than C++ due to extremely fast compilation times. Arraymancer compiles in about 5 seconds on my dual-core MacBook.
Does he only know python? If so I'd say yes, Nim looks like Python but it's semantics are quite different and it performance a lot better. Also Nim <-> Python interop is nice too. Besides what eindiran said, your friend could also take a quick peek at: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programm... and for numerical stuff Nim's ecosystem is quite young for it but people are working hard on it: https://github.com/HugoGranstrom/numericalnim
I'd say go for it!