Anyone have experience using Nim? The TLDR that I am seeing is compiled portable python/js replacement in a way.
I was thinking about trying to write a webserver with it and was wondering if anyone had any previous experience with it.
I’ve never been a big fan of transpiled languages. I’ve looked at Nim a few times over the years and while it looks nice, I’ve never found it more compelling than other languages. Chances are there is at least one more not quite mainstream language that does something cool that will fit your usecase more and not be transpiled.
Nim is not transpiled. Transpilation means translation between equal levels of abstraction. The C code generated by Nim is not something most people would do anything with.
IMO going from one programming language to another is the same level of abstraction regardless whether the target language is closer to the metal or not. If Nim compiled to assembly or some byte code, that is a lower level. I can’t say that I’ve ever wanted to do anything with the output of a transpiler aside from just send it on to the next stage. I’ve never seen any machine generated source code fit for human consumption. Even typescript produces a lot of boiler plate that would not be pleasant to try and maintain.
Cool logo
No experience yet, but It’s the next language I want to try.
Nim is cool. Easy to read python-like syntax, strongly typed, compiles (not transpiles) to C, so you can use common C tools like valgrind, gdb, musl, etc.
Small footprint, devel version supports deterministic gc (arc/orc).
One of the greatest interops with C, C++ or JS (C and JS are not mixable, obviously)
I’ve only used Nim in hobby/toy projects, but it was very pleasant experience.
@janAkali I wonder how it compares to compiling Python code with https://github.com/Nuitka/Nuitka , which is a real compiler using C and not just a bundler. To me, from programming language perspective Nim looks like an improvement for the developer. Here is a nice overview: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers , but this does not take Nuitka into account.
First time hearing about Nuitka and it sounds promising for Python devs. But from a quick glance it is merely an AOT compiled Python.
For me, Nim has big advantage over Python: types that are statically checked at compile time.
Types make you reason about your code more. Good LSP uses types to suggest you code without any AI and shows you errors before you have to run your script/programm.
I’ve been using it for 2 years or so, mostly for hobby programming, and I really love it, it’s been great for the kinds of things that I do at least :) Feels great and logical to write, and it’more or less works the same way my mind does, the type system is really good think something like Ada, and it can be both a pretty low level, and high level langauge. YMMV, but I really like it personally.