Lately, I’ve been losing enjoyment in programming at all; this can be caused by the current global events like AI coding agents, etc. It makes me a little bit lazy to write code. I am always trying to find some niche languages to learn because when you use unpopular languages, AI can’t really help you—maybe only for scaffolding and prototyping, but when it comes to using the language’s external libraries, the help from AI is gone because there are not so many datasets to train LLMs. I’ve been trying to learn Rust again; it turns out I can’t handle its verbosity and complexity (skill issue), so I’m looking for another language.
Recently, I was checking out Nim because I watched a video on YouTube that Nim is popular among hackers—they use it for creating payloads. Since I’m also interested in low-level exploitation and reverse engineering, I’m giving it a shot.
At first impression, Nim really looks like Python because it heavily depends on indentations for control blocks. I don’t really like using Python because it depends on indentations. Even though the ecosystem is huge, Python libraries are hard to use for me because different libraries it means different ways to use. Some libraries are using functional paradigm; some use OOPs—thus it’s so inconsistent. I hate the way I have to look at each library’s documentation and learn how to use it, and I have to re-read the docs over and over because of those different paradigm approaches. Ruby, on the other hand, is consistent; everything is an object, thus I only have to read the classes and the methods; I don’t have to remember how to use each method, unlike Python.
Even though Nim is similar to Python, it’s really consistent in terms of flexibility. The first time I used it and read some of its documentation, especially on the method call syntax, I was doing research about it, and I found out about UFCS then I instantly fell in love with this language!
I was just playing around with it, writing silly code. I still can’t believe my eyes this is a valid code:
import options
import times
type URL = object
url: string
name: Option[string]
tags: Option[seq[string]]
notes: Option[string]
proc addUrl(data: URL): void =
data.url.echo
if data.tags.isSome():
echo data.tags.get()
else:
echo "no tags"
when isMainModule:
addUrl(URL(url: "url"))
var tags = some(@["foo", "bar"])
addurl URL(url: "test", tags: tags)
if issome tags:
echo tags.get()[0]
This language basically doesn’t have a strict rule on how to write code. Other people can write libraries in functional paradigm, and I can use them in OOP paradigm; there would be no problems! Since I found Nim, I’m having enjoyment in programming again. But there are still some things that I wish improved in Nim.
I really enjoy using Ruby’s REPL. In my opinion, it’s the best REPL other than any languages. Nim still doesn’t have a mature REPL. Its capabilities due to UFCS are kind of wasted if it doesn’t have a nice REPL like Ruby does.
The other thing is the LSP. I don’t know whether it’s my own fault, but nimlangserver is kind of suck on my Neovim setup. Every time I open .nim files, my Neovim always shows notifications like LSP[nim_langserver][Info] Nimsuggest initialized for <myfile>.nim and sometimes the LSP is stuck after I copy-paste something to the file.
This puts Nim as my most loved language after Ruby. Even without improvised toolings, I STILL FUCKING LOVE NIM!