What's your experience with Nim?
What's your experience with Nim?
I've been researching programming languages to find a good, high level language that compiles to a single binary that is preferably pretty small. After tons of research, I landed on Nim and used it to make a quick txt parser for a project I'm doing.
Nim seems absolutely fantastic. Despite being sold as a systems programming language, it feels like Python without any of its drawbacks (it's fast, statically typed, etc.) - and the text parser I made is only a 50kb binary!
Has anyone here tried Nim? What's your experience with it? Are there any hidden downsides aside from being kinda unpopular?
Bonus: I want to give a shoutout to how easy it is to open a text file and parse it line-by-line in this language. Look at how simple and elegant this syntax is:
nim
import os if paramCount() == 0: quit("No file given as argument", 1) let filepath = paramStr(1) if not fileExists(filepath): quit("File not found: " & filepath, 1) for line in lines(filepath): echo line
Uses whitespace for code blocks though. I figured we've moved past that.
I don't get the hate for whitespace personally. It was maybe an issue 15 years ago, but modern code editors easily solve its issues. You can collapse whitespace blocks, the editor can automatically replace spaces with tabs, etc.
It solved a problem that didn't exist and created problems that hadn't previously existed.
There's a reason every python "intro" begins with "spend 20 minutes setting up an editor to deal with whitespace" properly.
It makes moving code harder. It makes jumping around code blocks harder. Often the ide can help but sometimes it can't.
In any curly-brace language these are things I simply don't need to even think about. But in Python it's a pain.
Yes it's not the end of the world. Yes I can spend hours fine-tuning my editor. But.... Why should I even have to? Why create these hurdles for no gain?
I thought we moved past that complaint 20 years ago. It’s not as if you won’t indent your code anyway.
We moved past it because everone realized it was a stupid idea. Rust, go, etc abandoned it and rightly so. It causes more problems than it's worth.
Seems like they allow
()
code blocks too, so it's kind of the worst of both worlds...