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
    • popcar2@programming.devOP
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      4 days ago

      The small binary part is just for fun - but generally my use case is to have an easy to use language that can cross compile easily so I can just pass binaries to the person I’m working with.

      • vermaterc@lemmy.ml
        link
        fedilink
        arrow-up
        0
        ·
        3 days ago

        I believe single binary compilation is not that uncommon these days. You can do that with Go or C#. Apart from obvious ones like c++.

        I mean, I don’t want to discourage you, but from my experience choosing not popular language is not a good Idea if you want to actually accomplish something