Nim First Impressions

sophiabrandt profile image Sophia Brandt Originally published at rockyourcode.com on ・3 min read

I've started dabbling in Nim some days ago.

My experience level: I'm a self-taught hobby developer. No professional experience, but a lot of enthusiasm.

I've created some toy applications, but nothing production-grade.

I'm most familiar with JavaScript and React.js, but also know a bit of Clojure, Elixir, Python, and Reason.

What is Nim?

From the Nim website:

Efficient, expressive, elegant

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.

Learning Curve

The syntax reminds of Python, with similarities to a natural language and the use of indentation and whitespace.


proc getAlphabet(): string =
  var accm = ""
  for letter in 'a'..'z':
  return accm

  child: tuple[name: string, age: int]
  today: tuple[sun: string, temp: float]

child = (name: "Rudiger", age: 2)
today.sun = "Overcast"
today.temp = 70.1

(see Learn X in Y Minutes and Nim by Example)

Some pitfalls:

Reference and pointer types:
Objects are value types in Nim. References are like JavaScript objects, which are β€œpass-by-value.” The object variable points to a reference of the object in memory.

  Node = ref object
    le, ri: Node
    data: int
  n: Node
n.data = 9

For me, the syntax is a plus, as it's easy to learn.

The mental models prove to be a bit trickier. Nim is an imperative language, with the declared goal of compiling to C or C++ (which I don't know).

I haven't looked at the advanced features like meta-programming and macros yet.

For the beginner, there are tutorials and learning resources available. See Learn Nim. Even the official docs are approachable.

Aesthetics & Fun

Programming in Nim feels fun. The type system seems well-built (not as powerful as OCaml's though?). Programming in Nim doesn't feel like such a hassle (TypeScript anyone?).

It has iterators; it has variant types/enums; it has templates.

You can extend the language via macros. For example, I'm missing pattern-matching. But you could add a library like Patty.


The ecosystem is small.

I would welcome a web-framework that holds your hand. Jester seems to be the sole framework for back-end development (it's like Sinatra).

You can get a working "hello-world"-server in a short time. But when it comes to features like authentication and authorization, I'm stumped - and I'm not the only one.

I get the sense that Nim targets advanced developers. At the moment, Nim might fit people that are not afraid to write libraries for their needs or who can build wrapper scripts around existing C or C++ solutions.

First Thoughts

I want to like Nim. I appreciate the syntax, and I love that the language compiles to native C, C++, or JavaScript.

Nim looks like a serious contender to lower-level languages while still being reasonably high-level. It feels "fun and easy" like a scripting language (Python), but it's strongly statically typed. Thus Nim offers the best of both worlds.

The small ecosystem is a hurdle for junior programmers.

I'm not sure if I can make Nim my home - for now.

Posted on Jan 21 by:

sophiabrandt profile

Sophia Brandt


tax officer who codes in her spare time https://www.rockyourcode.com 🎸🎢


markdown guide

I think Nim has growing potential but might be easier with a good grasp of lower-level languages, and like you said, some more libraries would be useful. I've been meaning to try it, and I wonder where it'll end up in a few years.


Yes, I agree.
I think that if you've experience with C or C++, Nim will be a breath of fresh air.
If you're only accustomed to higher-level languages, it's harder to understand.


You can read the Nim for Python programmers.

If you need a web framework with more features then try NimWC,
just to name some features it has:

  • 2 Factor Authentication by default (TOTP) built-in.
  • App Store to publish your project and get others.
  • Admin Control Panel.
  • Admin Status Page.
  • Self-Firejailing security (it can Firejail itself).
  • Optional ReCaptcha built-in.
  • Optional WebP support built-in.
  • Bulma CSS (No JS) or Bootstrap CSS or WaterCSS (classless).
  • JavaScript framework agnostic.
  • Libravatar/Gravatar support built-in.
  • Upload/Download files and images (private or public).
  • Postgres or SQLite databases.
  • Auto-Rotating file Logger, with web Log Viewer.
  • Optional Email notifications.
  • Plugin skeleton creator to create your own new plugin projects.
  • Features are compile-time optional. And more, I dont want this to be too long ;P

When we started wasnt even documentation nor auth for Jester.
We keep making it better, we would love more users to try it!.

Live Demo at nimwc.org/login
All the code at github.com/ThomasTJdev/nim_website...


Thanks. That's nice.

Still, my argument stands.
For web, you have Jester, but no help with OAuth, etc. There are just no many usable libraries at the nimble package library.

nimwc looks interesting though. I hope to see more solutions like this.