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:
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
I haven’t done enough to consider myself a programmer, but I could’ve written your post. It hits a niche that I have long wanted from programming.
You should check out the Godot 4 bindings if you haven’t already (gdext-nim, see my post on [email protected]). There’s also one for Raylib (specifically, Naylib).
My biggest functional gripe (that I can say for certain is not just me) was that support for (Bellard’s) TCC was dropped. It was nice for quick prototyping, though Clang is a pretty efficient middleground/default.
I have looked into the nim GDExtension and it looks nifty. I haven’t tried it yet though because it might not be totally ready, some github issues make it sound like it could be a pain to work with.
I dunno, do you think it’s too rough for prototypes or jam-like games?
Seems to me like many of the issues are likely specific, workaround-able stuff. It’s mainly developed by 1 person, so pretty much any type of involvement (even posting issues or showing off projects) could help improve the future of the project.
In some cases you can keep your logic in its own file and not dependent on any engine. For instance I made a (non-game) software demo (number converter) for the 3.X bindings and then easily redid the GUI and rewired it for the 4.X bindings. (similarly I made a polygon-from-text-format parser for Naylib, I could transfer it but Godot has polygon editing so less need there)