this post was submitted on 31 Aug 2025
78 points (97.6% liked)

Programming

22502 readers
322 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

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
you are viewing a single comment's thread
view the rest of the comments
[–] FizzyOrange@programming.dev 9 points 4 days ago (10 children)

I just use Rust for this. You can make the binaries fairly small if you put a bit of effort in. Plus it's not a niche language, and you get the benefit of a huge community. And your code is pretty much fast by default.

The only real downside is the compilation time, which is a lot better than it used to be but still isn't great.

[–] communism@lemmy.ml 5 points 4 days ago (9 children)

Yeah tbh I'm not sure what the reason for using a systems programming language other than either Rust or C would be. Rust by default for safety (and it's as performant as any other systems language), C if you either need to work with an existing C codebase or want to be able to more easily do unsafe stuff. Or if you need to compile quickly. I'm sure the other languages have their benefits but not to the extent where I would both want to learn it and have use cases for it where I would choose that language over Rust or C for a project.

[–] msa2@mastodon.sdf.org 8 points 3 days ago (2 children)

@communism @FizzyOrange Sometimes you want modern features and safety without the headache that is writing Rust. Rust is a complicated language. I just want something simple without a million footguns.

[–] FizzyOrange@programming.dev 4 points 3 days ago (1 children)

Rust is fairly well known for not having footguns (except async Rust at least) and for not being a headache.

I guess it can be more complex than something like Python or Typescript though. I would say that extra complexity is not a big deal compared to the pain you'll have to deal with working with a language as niche as Nim though.

[–] msa2@mastodon.sdf.org 2 points 3 days ago (1 children)

@FizzyOrange Footguns as in C. Headache as in rust.

[–] FizzyOrange@programming.dev 2 points 3 days ago (1 children)

Headache isn't a word I'd associate with Rust. More with Ruby or Python (at least until uv mostly saved us).

[–] TehPers@beehaw.org 2 points 3 days ago (1 children)

uv is love. uv is life.

I'm still trying to get people at work to use it. It's one of the few tools out there that takes Python from intolerable spaghetti to readable and maintainable.

[–] bitcrafter@programming.dev 1 points 3 days ago (1 children)

I have found that conda proves to be

. . .

a fairly good

. . .

alternative to pip as well.

[–] TehPers@beehaw.org 1 points 3 days ago

conda isn't much of an alternative to pip. It's more of an alternative to venv. Unless you're referring to conda's dependency management, which I've admittedly never used.

And until pip uninstall foo uninstalls unused transitive dependencies too, you'll have to drag me back.

[–] communism@lemmy.ml 2 points 3 days ago

I'm not really sure what people mean by Rust being a headache/weird/hard/etc honestly. It was a learning curve but nothing crazy, and I've come to really like the ways Rust works—it makes my life way easier in the long run to be able to solve problems at compile time so I don't have to debug undefined behaviour at runtime. But to each their own of course—if another language works for you then it works for you.

load more comments (6 replies)
load more comments (6 replies)