I needed some language which is:
- compiled to binaries
- and really fast
- has needed libraries (HTTP server, protocol buffers, sqlite and image generation)
- it's easy to set up
It was nice experience and Nim simply worked for my needs. People on Nim forum were nice and helped me when I ran into problems. It has nice and usable built-in library and I was really impressed by graphic library pixie - https://github.com/treeform/pixie
I would use Nim again when I when I will see this application is suited for it (e.g. some command line apps).
> 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).
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...
Personally, I was impressed by an approach taken by the authors of Pixie (a fast 2d library like Cairo) [2]. They created a "library wrapper" generator for Nim code that supports creating libraries Python, Node, C, and Nim itself that they call Genny [3]. Haven't tried it but being able to use Nim and it's ref based gc but still export to nice API's in other languages is fantastic. Pixie's aim is to be a Cairo alternative so it makes sense they'd need this. I hope the approach takes off. Usually writing any cross language API's is a lossy operation.
Here's a sample of the API definition:
exportObject Matrix3:
constructor:
matrix3
procs:
mul(Matrix3, Matrix3)
1: https://dlang.org/spec/betterc.html
2: https://github.com/treeform/pixie
3: https://github.com/treeform/genny(edited formatting)