Nim, the hidden gem among giants

Nim is programming language that you’ve probably never heard of.

And, that’s okay.

It’s a statically typed and compiled systems/applications programming language.

I know what you’re thinking, “We already have Go and Rust in the ecosystem; do we really need another one!? They have larger corporate backings!”

Hold your horses!

Nim is the best mix of productivity and performance in a programming language that I’ve ever seen.

Here, let me show you can example!

var
sum = 0
count = 0

for line in stdin.lines:
sum += line.len
count += 1

echo("Average line length: ",
if count > 0: sum / count else: 0)

“Wait a minute..Is that Python or Nim?” (Don’t say python, dammit!)

As you can tell it has Python-like productivity but with performance somewhere between C and C++.

“But dude, can’t I just use Rust or Go?”

Relax, we’re getting there..

If you try to learn the Rust programming language, it may be daunting. It is a complicated language, especially for those who aren’t already familiar with systems programming. The ownership system of Rust takes some time to get used to.

However, you can certainly learn Go pretty fast. If you like generics, sorry! You won’t find those in Go. Its garbage collector and general performance also aren’t as sophisticated as Nim’s.

I’m not against either of those languages. Please, don’t hang me language lords!

Anyway, Nim allows meta-programming through macros. If you’ve ever played around with macros in Lisp/Clojure then you know exactly what I’m talking about.

They allow you to transform the programming language itself.

Pretty trippy, right? (You don’t need LSD when you can just use macros)

What’s also pretty cool is that Nim can also be compiled to JavaScript and easily binds to C, C++ and Objective C libraries.

Oh no, the impurities!

Alright, now it’s time to end the nirvana programming language fairy tale.

If you go to the nim-lang GitHub page, you’ll see that there’s a big elephant in the room.

A lot of compiler bugs/issues.

Yes, okay; It is behind Rust and Go in terms of compiler development and funding, but don’t let that stop you.

No, really. Give it a shot.

You won’t be disappointed.