Why Nim?

Basil AjithBasil Ajith
3 min read

You might have heard of the line, "one ring to rule them all" from the book the Lord of the Rings. Though, this ring is an evil object created by the evil Sauron, the idea of just one thing existing to manage or control a lot of things at the same time, is something we all long for.

We all need that one app which can manage all our tasks. We need that one card that can hold or manage all our credit and debit card information. How we long for a single language for the whole world (this also had a disastrous effect in ancient times as recorded in the Bible)?

This is no way an advocacy for "one thing for controlling all things" in the context of all human endeavours. For example, I am always for decentralised governments or governance when it comes to governing an institution or a nation.

At the same time, a programming language for doing all things is not new to the discipline of programming or computer science. Look at the "JavaScript everywhere" and "CSS-in-JS" movements. Also, look at work on "Python in the front-end".

Nim is a great attempt at being the language to do it all, or at the least, an attempt at being a language "good for everything". Nim's elegant and simple syntax is good enough for writing automation scripts to operating system kernels to game engines!

Added to this are the low-level capabilities of Nim with dynamic memory management (garbage collection is the default) and inline-assembly. It's a scenario where you have the best of Ada, Python, and C!

And Nim can compile to JavaScript! So, you can do front-end development with Nim. The Nim forum and a handful of websites are made using Nim.

If you want a language for sane systems development, Nim is it. In my opinion it's also the best language to teach computer science as well. I'm sure that universities will adopt Nim into their curriculum.

Nim is also interoperable with languages such as C, and C++. In fact, Nim first compiles to C which in turn is compiled to machine code by the C compiler of your choice (gcc/clang).

And for all those safety-enthusiasts, Nim has taken lessons from multiple places and have safety features in place.

Nim is used in organisations like Status, Reddit, and Exercism.

Moreover, Nim's macro system is the best. Did you know that the class-based OOP is not a feature of Nim, but is possible because of macros?

Go check it out. It's the best programming language out there in my opinion!

  1. Good for everything

  2. Fusion; a hobby OS kernel written using Nim.

  3. Karax; a Nim web front-end library.

  4. Owned refs in Nim

  5. Constantine; a cryptographic stack for blockchain and proof systems.

  6. OOP library for Nim.

  7. Awesome Nim projects

0
Subscribe to my newsletter

Read articles from Basil Ajith directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Basil Ajith
Basil Ajith

In Christ Jesus - Husband of Alfia Abubaker - Father of Ezra Don Basil - Making Computers Do Things