Why Nim?
180 points
1 day ago
| 22 comments
| undefined.pyfy.ch
| HN
treeform
1 day ago
[-]
I feel like Nim made me fall in love with programming again.

Nim fixes many of the issues I had with Python. First, I can now make games with Nim because it’s super fast and easily interfaces with all of the high performance OS and graphics APIs. Second, typos no longer crash in production because the compiler checks everything. If it complies it runs. Finally, refactors are easy, because the compiler practically guides you through them. The cross compiling story is great you can compile to JS on the front end. You can use pytorch and numpy from Nim. You can write CUDA kernels in Nim. It can do everything.

See: https://www.reddit.com/r/RedditEng/comments/yvbt4h/why_i_enj...

reply
miki123211
16 hours ago
[-]
I feel like Nim, along with C#, is one of the few languages that just cannot be used without a great IDE.

It heavily encourages namespace pollution and `import *`, making it very hard to figure out what where a given function is coming from and hence what it does.

reply
felipeccastro
11 hours ago
[-]
I agree with all your points but last I tried, the VS Code LSP was terrible. It’s hard to justify a new language when even the basics of autocomplete, inline errors and go to definition don’t work well. Part of the reason was that any function can be called on anything, which pollutes the autocomplete list.

Has the LSP situation improved yet? Similar issue with Crystal lang, which I enjoy even more than Nim.

reply
elcritch
10 hours ago
[-]
Unfortunately the LSP hasn’t improved that much. There’s been some work on to kill errant processes and such. So it’s a bit more stable. It does work pretty well when it works though. But I just kill it now.

Unfortunately it may not be until Nim 3 based on the Nimony rewrite comes out. It supports incremental compiling and caching which will make the underlying LSP tooling much better.

However I find with Cursor that I don’t mind so much the missing autocomplete. I’ve actually thought about writing an alternative LSP just for quick find and error inlining…

reply
dvfjsdhgfv
10 hours ago
[-]
Frankly, I'm surprised this is the only issue you bring up (I had many, when I first tried Nim several years ago - I think they were related to cross-platform GUI libraries for Nim, or the lack of them, or their awful state back then).

But LSP as a major concern? For me these little helpers are useful to catch small typos but I could happily do without them.

reply
felipeccastro
7 hours ago
[-]
It's not just small typos, it's the ability to explore apis, the standard library, go to definition, quickly catch any error at the location it happens, not having to memorize large models and their field names, the list goes on.

I can work without an LSP, but when I'm searching for a new language that would be used by a team (including Junior devs) it's hard to justify something missing the basics of good DX. I haven't tried it with Cursor though, it might be less of a dealbreaker at this point.

reply
konart
7 hours ago
[-]
How do you navigate through a project with things like `go to definition` or `incoming calls`? (given that we are talking about a relatively large code base maintained by more that one or two individuals)

You can do it with just rg or something similar but it will give you many false positives and are going to waste quite some time.

reply
setopt
1 day ago
[-]
That’s very interesting actually. Can you call only specially wrapped libraries from Nim, or is any Python library importable? When you cross-compile to JS can you only use pure-Nim libraries or how does that work?
reply
Tiberium
1 day ago
[-]
It's not a built-in Nim feature, and it'll only work with native backends (C/C++/ObjC). The project that makes it possible is https://github.com/yglukhov/nimpy
reply
linsomniac
21 hours ago
[-]
>typos no longer crash in production because the compiler checks everything.

Gentle correction: Python is typed now too and you can get the benefits of typing both in your IDE (via LSP) and before deploying to production (via mypy and the like). This happens both by type inference as well as explicit type annotations.

reply
nazgul17
20 hours ago
[-]
That's the dream. Reality is very different. Mypy presents numerous false negatives and false positives. Useful to screen for some bugs, but definitely far from giving guarantees.

Not to mention, if a library does not or does sloppily use type annotations, you would not get reliability even with a perfect type checker.

reply
linsomniac
20 hours ago
[-]
I'm sure you're right that there are situations where mypy or ty or LSP give false positives/negatives, but in my use of them over the last ~6 months I really haven't run into many of those situations, or at least none come to mind. Libraries without type annotations do reduce the effectiveness to just what can be inferred by the type checker.
reply
wiz21c
15 hours ago
[-]
you need to work on big project for these flaws to become a problem. Say, you have a huge code base, 100000's of lines that you didn't write. Then you want to refactor a method's name. Python can't give you any guarantee the refactoring is fully complete. Only a real typed language can do that.

I write 95% of my code in python, I love it, it's my go to language for many things. But for huge code base which I don't master, the lack of type system makes me more than nervous.

reply
globular-toast
14 hours ago
[-]
Sure but you can also write bugs in a perfectly typed compiled language. Short of formal verification the best we can do is try to minimise the possible surface for errors to occur. I'm of the opinion that language and tooling plays only a small part in writing robust software. What's more important is designing software using simple components that are small enough to be obviously correct.
reply
boxed
17 hours ago
[-]
"Is typed now" is false.

"Can be typed now" is somewhat correct.

"Can be partially typed now" is actually correct.

reply
linsomniac
1 hour ago
[-]
What percentage of typing features does a language need to have to be "good enough"? Because I'm gaining benefits of typed languages in Python, but responses to this thread are, literally: You aren't a programmer.
reply
gpderetta
14 hours ago
[-]
The fact that you have to run a separate tool just to check typing is a joke.
reply
chamomeal
20 hours ago
[-]
True but IME languages that are historically dynamically typed have a rough time truly converting to static types.

Php even seems to have decent static types these days, but do my coworkers use them? Hell no

reply
rjh29
18 hours ago
[-]
Somehow "gentle correction" sounds more aggressive (passive aggressive) than just saying correction.
reply
freilanzer
14 hours ago
[-]
It's patronizing.
reply
almostgotcaught
19 hours ago
[-]
> Gentle correction: Python is typed now too

No it's not and you should lose your union card for lying like this.

reply
7bit
16 hours ago
[-]
Take a deep breath
reply
rich_sasha
1 day ago
[-]
I often wonder why some languages succeed while others falter. Why did Rust break through, for example, while so many other excellent languages didn't.

I guess a lot of languages are kind of fungible. If you want a fast, cross platform, GC-based OOP language, the truth is, there are many choices. I'm not saying they are the same, but for 80% of the use cases they kind of are, and there are always good reasons to use established languages rather than new ones.

The ones that make it offer something very unique, not merely better than peers. So Rust, as a memory-safer non-GC language has a clear use case with little or no competition.

Nim doesn't have this luxury. I wish it well, I like the language and often contemplated learning it properly. But I fear the odds are against it.

reply
elcritch
1 day ago
[-]
The notion that we need to all program in the top 10 popular programming languages seems dead with the advent of LLMs.

I program a lot in Nim including professionally and strongly prefer it over Rust or even Zig.

Primarily because I just really enjoy programming in Nim and getting things done I wouldn’t have otherwise or be capable of doing.

For example recently I needed to automate a GUI app. I tried the Python libraries but found they kinda sucked. Despite pulling in opencv they were slow at finding buttons in a screenshot. Then the one I tried also broke on hidpi displays.

Instead I got Claude to write me up a Nim library to find images in a screenshot. Then had Claude add SIMD to it.

It’s far faster than the python libraries, supports hidpi, and is far easier to install and use. I still use a small Python app as a server to take the screenshots but it’s a nice balance.

> I guess a lot of languages are kind of fungible. If you want a fast, cross platform, GC-based OOP language, the truth is, there are many choices.

It’s true, in many cases they are fungible. Though much less so for languages which compile to native code. LLMs do lower the barrier to switching.

Nim isn’t really a GC’ed OOP language though it supports some bits of that.

It’s really a systems language that can also run anywhere from an embedded device to a web server and as a JavaScript app.

The new default memory management is based on reference counting with or without a cycle collector. So it’s great for latency sensitive settings.

reply
nine_k
1 day ago
[-]
> The notion that we need to all program in the top 10 popular programming languages seems dead with the advent of LLMs.

To my mind, to the contrary :( LLMs get trained on corpora of existing texts, including source code. They become much better at massively used languages because of the plethora of training data, and struggle with more niche languages because of the dearth of good examples. It's a positive feedback loop for mainstream languages, because more stuff gets vibe-coded, or code-assisted when the AI does a better job at it. It's a negative feedback loop for niche languages because the opportunity cost of choosing them grows :(

reply
elcritch
1 day ago
[-]
That hasn’t been my experience with Nim so far. Both Claude 4 and GPT5 both one shot Nim code almost perfectly now. They even made a Nim JavaScript app for me.

On top of that I’ve been able to “vibe” code a couple of different libraries for Nim. The bigger limits with LLMs is still “deeper” and loosing track of what it’s doing.

It helps that Nim doesn’t have much unique syntax requirements or paradigms like say Rust lifetime annotations. Some of the rarer Nim idioms like `set[Enum]` being castable to a cint aren’t used.

But generally what you’d do in most C++ code works well in Nim, but with simpler syntax.

reply
apwell23
23 hours ago
[-]
i had the same thought as you as i was reading GP comment but lately i've come across some videos on 'Interpretability' of llm output where they said llm store 'core ideas' in a abstract way and produce concrete output on the fly based on that core representation. This is very different from viewing llms are next token predictors which would imply what you said in your comment.

https://www.youtube.com/watch?v=fGKNUvivvnc&t=2748s

reply
DennisP
1 day ago
[-]
Using LLMs to build the libraries you need seems like a fantastic way to work with them, since they've probably been trained on code that does similar things.
reply
SkiFire13
1 day ago
[-]
> Nim isn’t really a GC’ed OOP language though it supports some bits of that.

I'm not sure about the OOP part, but last time I checked the standard library assumed the GC was enabled, so on that side I believe it's much closer to those languages than to C/C++/Rust/Zig

reply
elcritch
1 day ago
[-]
It’s more that Nim2 moved from a GC to ARC/ORC, scope based automatic reference counting (ARC) with an optional cycle collector (ORC).

C++, Swift, and even Rust rely on reference counting quite a bit.

reply
SkiFire13
1 day ago
[-]
As long as it's effectively required by default I would place it in a category more similar to GCed languages than system languages like C++ and Rust.
reply
shiomiru
1 day ago
[-]
ARC's ref is similar to C++'s shared_ptr, or Rust's Rc - with that alone it might still count as "GC'ed". But ARC also has ownership semantics, and hooks for custom containers: https://nim-lang.org/docs/destructors.html so I think it's fair to put it in the "system language" category.
reply
timeon
1 day ago
[-]
In Rust/C++ it is just one of the tools. Not required thing.
reply
shiomiru
1 day ago
[-]
Neither is it required in Nim.

A Nim object is a stack-allocated value type, without refcounting. You can put that in a heap-allocated seq (pass-by-value with move semantics), ref (refcounting), a custom container (you decide), or ptr (unsafe, like C).

reply
elcritch
11 hours ago
[-]
I’d say the majority of Nim’s stdlib can be used without ref (arc) types. The compiler only generates ARC code if you use ref types not when you import a module.

Yeah much of the basic stdlib only uses vector, string, and map types which are similar to C++ & Rust ones with single ownership and move semantics. Static arrays can be used with many basic functions like sort.

The JSON module in Nim’s stdlib does use ref ARC types. However neither C++ nor Rust provide a JSON module by default.

Actually, a fair bit of Nim’s stdlib can even be used without allocators! Unlike Rust’s #[no_std] for embedded which is just a pain.

reply
binary132
1 day ago
[-]
Arc’s are extremely common in Rust and C++ codebases.
reply
afdbcreid
1 day ago
[-]
Common, yes, although extremely common, that depends on the codebase and its goal. But they are not the default, and that what makes them system languages.
reply
pjmlp
10 hours ago
[-]
Not really, because they are not Automated Reference Counting, rather manual with explicit clone operations, in some scenarios.

Also contrary to systems where reference counting is part of the type system, and not library types, they aren't able to optimize counts away.

When this happens is as side effect of the compiler optimizing away inlined code, but not by pairing inc() with dec() operations that never leave scope.

reply
ninetyninenine
1 day ago
[-]
>The notion that we need to all program in the top 10 popular programming languages seems dead with the advent of LLMs.

It was dead prior to this. A subset of programmers think it's hard to program in any other language other than the one or two they studied.

They are wrong. Most programming languages are very very similar. And learning one means you learned almost all. i learned new languages on the regular pre - llms and it required barely any effort.

Most company interviews are also language agnostic for this reason. Because languages are so trivial to learn once you "get" how to program.

reply
Sohcahtoa82
5 hours ago
[-]
> Most programming languages are very very similar.

For the most part, yes. I'd add the caveat of needing to differentiate significantly between imperative and functional programming, though. I've used Python, Java, C, C++, C#, PHP, and a TINY bit of Perl (Enough to know it's a terrible language -- seriously, why would anybody want to use a language that people refer to as "write-only" because it's so hard to read?), and Haskell just makes no damn sense to me. It seems its only use is to show off how Quicksort can be written in two lines with it, or to start fights over whatever the hell a Monad is.

Also, if you've only ever written in memory-safe languages like Python, Java, and C#, then switching to an unsafe language like C or C++ will probably result in writing a ton of memory leaks, buffer overflows, and segfaults.

reply
GoblinSlayer
13 hours ago
[-]
If those 10 languages were good, why there are 10 of them? Shouldn't they kill each other? In the end there will be only one.
reply
WJW
12 hours ago
[-]
Why are there hundreds of food recipes in the world? Shouldn't the most delicious dish just kill all the others? In the end there will be only one dish and we will all eat only that.
reply
ninetyninenine
10 hours ago
[-]
This is what human languages tried to do but then they discovered nukes and now they’re all at a stalemate.
reply
brookst
20 hours ago
[-]
It’s like human language: your second one is hard, your fifth one is easy.
reply
hardwaresofton
1 day ago
[-]
I really feel for new languages that have to compete with Rust.

It’s probably easier than it’s ever been to create a high quality new language but to get as good as Rust has become just takes so much time and collective effort that it can be out of reach for most ecosystems/groups of builders. Getting the language features just right (and including novel stuff) is just the beginning.

Remember when Rust and Go were comparable? Feels like forever ago when they both just looked like “new systems programming languages” a we know how that turned out.

For example Zig is probably the most impressive new language, and it’s got a ton of awesome stuff but the chance that I’m going to adopt it over a language with often comparable performance that is ALSO much safer? Rounds to zero.

Maybe some day I’ll have the brain cells and skill to write code in zig and be confident I’m Not introducing a whole class of gnarly bugs, but it seems like I should just focus my limited brain power on writing high quality Rust code.

reply
baq
1 day ago
[-]
> Remember when Rust and Go were comparable?

They were never intended for the same niches. Go is a Java/Python replacement. Rust is more of a C/subset of C++ replacement. They were compared mostly because they had usable versions released at approximately the same time, but you (correctly) don’t see those comparisons anymore.

reply
steveklabnik
1 day ago
[-]
Way back when Rust was first made known outside of Mozilla; it was pretty close to Go. While the intent was to be super low level, it didn’t really achieve those goals until years later, and kind of at the expense of parts of the original vision.
reply
hardwaresofton
18 hours ago
[-]
Other WAY more qualified people already responded and elucidated on the initial origins of Rust (it used to have a garbage collector!), but I can at least add this:

The definition of "same niche" is doing a lot of heavy lifting.

There's a marked difference between what these tools became and the impression of them along the way and the axes along which they were compared in actuality. In the simple "I need to build a backend" conversation, Rust and Go were comparable long after Rust changed to a "real" systems language -- I'd go as far as to say people still compare them to this day (and Go probably wins that larger niche for many contextual reasons).

I think the point is partially reflected in your own statement -- there are many axes along which Go is not a Java replacement, and is not a Python replacement either. The definition of the "niche" vastly changes the answer.

For example, if you pick the right niche (e.g. HFT) Java meaningfully outperforms Go because high performance Java is... actually high performance -- those millions of man years into the compiler, runtime, etc produced progress. That said both of those languages get trounced by the FPGAs and custom hardware in the end.

I'm not convinced it was always wrong to compare Rust and Go, but the modern understanding of how different they are today is definitely better/I am glad they're more separated/more people know not to directly compare them.

reply
pjmlp
1 day ago
[-]
Go is hardly a replacement with its weaker type system.
reply
kitd
14 hours ago
[-]
A weaker type system than Python?
reply
pjmlp
14 hours ago
[-]
Yes, as you can see for what is possible to express with Pyright.

Just because Python is dynamic, doesn't mean it lacks the notion of a type system, or the whole set of concepts that Go has no way to express, like meta-classes, multiple inheritance, comprehensions (eager or lazy),....

Many folks going from Python to Go, would never done it if Python had a modern JIT on CPython, or the package management wasn't the way it is, hardly anything to do with the language itself.

reply
GoblinSlayer
13 hours ago
[-]
I don't quite understand what's the point of a type system when it's going to be defenestrated by dynamic typing. In javascript the typeof operator can be used to check the type.
reply
pjmlp
11 hours ago
[-]
Because the runtime still takes advantage of those concepts, an array doesn't stop being an array, and magically turns into a list, with different hardware requirements only because a language is dynamic.

Same applies to all other remaining types.

That is how even though people see Lisp as a dynamic language using only lists, in reality most Lisps (and Schemes) since the 1980's have all necessary types to write machine friendly code (aka mechanical sympathy), including having existed graphical workstations that only failed the market because UNIX and C were as cheap as free beer for all pratical purposes.

reply
brokencode
11 hours ago
[-]
The type system still allows organizing and abstracting code in standardized ways.

Static type checking is nice and is certainly my preference, but dynamic type checking doesn’t mean no types. It means the types are checked at runtime.

reply
pjmlp
10 hours ago
[-]
Only thing impressive about Zig is the comptime abilities, all the rest is basically Modula-2 (1978) safety in C syntax.

Pity that it has taken all these years for folks to finally embrace Modula-2/Object Pascal safety as the bare minimum in systems languages.

reply
ngrilly
6 hours ago
[-]
I so much agree with this. When I started using Zig, memories from writing Pascal started coming back, and I realized I was fine writing Pascal with manual memory management, unlike C and C++ where segfaults were a more frequent problem.
reply
pjmlp
5 hours ago
[-]
I was lucky to have gone through a few BASICs (including compiled ones), Z80 and 68000 Assembly, and Turbo Pascal (3.0 - 6.0), before getting to learn C with Turbo C 2.0, although I had already a few books on C, which made be aware that C wasn't the be all end all, that a few decades later many that learned C after C89 kind of propagated as urban myth.

Not only I was aware that there were other ways to do systems programming, I was educated that there were safer ways to achieve the same goals.

My trasition to C++ came thanks to Borland having the TP/C++ symbiosis, which later became Delphi/C++.

reply
ngrilly
3 hours ago
[-]
If I remember well, the biggest difference between Pascal and C was that Pascal, unlike C, offered spatial memory safety (thanks to strings and arrays being represented as "fat" pointers including the length), but none of them offered temporal memory safety (heap-use-after-free and stack-use-after-return)?
reply
pjmlp
2 hours ago
[-]
Much more than that, first lets take into account no one really used plain ISO Pascal on PC, it was always dialects from UCSD Pascal, or eventually Object Pascal, created by Apple and adopted by Borland, TMT and others.

Strings were indeed fat pointers, and for the usual critic of being limited to 255 characters, you could eventually use fat pointers to unbounded arrays, with functions to get the lower and upper bounds.

Since Pascal supports pass by reference (var parameters), there was no need to mess up with pointers for in/out, or out parameters, thus one less scenario where pointers could go wrong.

Memory allocation has special functions New() and Dispose() that are type aware, thus no need to do sizeof() that might go wrong. And there was Mark()/Release() for arena style programming as well.

Numeric ranges, with bounds checking, was another one.

Enumerations without implicit conversations.

Bounds checking, checked arithemetic (this one depended on the build mode), IO checking, and a few other checked modes, naturally they could be disabled if needed.

Mapped arrays, so you could get the memory address directly, while having bounds checking.

Unbounded arrays provided a way to do slices, even if a bit verbose.

Pointers were typed, no decays from arrays, although you could do exactly the same clever tricks as C, by callign specific functions like Adr, Succ, Pred,...

Record variants required a specific tag, so while they weren't tracked, it was easier to spot if "unions" were being used properly.

Units provided a much better encapsulation as header files + implementation, with selected type visibility.

Yes, use after free, doing the wrong thing in mapped memory, or inline Assembly were the main ways how something could go wrong, but much less than with plain C.

Which is why I tend to do my remarks with Zig, you will notice quite a few similarities with 1980's safety from the likes of Pascal and Modula-2, the later even better than those Pascal dialects, although Turbo Pascal eventually grew most of the Modula-2 features, plus plenty of C++ inspired ones as well.

Hence why with the prices Ada compilers were being sold, and the "cheaper" Pascal dialects and Modula-2, it was yet another reason why it did not took off back then.

Ironically GNU Pascal is no longer relevant, while GCC now supports Ada and Modula-2 as official frontends.

reply
GoblinSlayer
13 hours ago
[-]
>but it seems like I should just focus my limited brain power on writing high quality Rust code.

You're running out of brain for rust?

reply
bsder
1 day ago
[-]
>For example Zig is probably the most impressive new language, and it’s got a ton of awesome stuff but the chance that I’m going to adopt it over a language with often comparable performance that is ALSO much safer? Rounds to zero.

1) Rust, in practice, is "safer" than Zig but doesn't seem to be "much safer".

See: https://mitchellh.com/writing/ghostty-gtk-rewrite

> Our Zig codebase had one leak and one undefined memory access. That was really surprising to me (in a good way). Our Zig codebase is large, complex, and uses tons of memory tricks for performance that could easily lead to unsafe behaviors. I thought we'd have a lot more issues, honestly. Also, the one leak found was during calling a 3rd party C API (so Zig couldn't detect it). So this is a huge success.

Take that as you will. And what Ghostty does probably requires a decent chunk of "unsafe" that would likely hide a bug anyway.

To me, the tradeoff of a demonstrably small number of bugs in a system software language in return for the demonstrably faster developer velocity (Zig compiles WAY faster than Rust, Zig wraps C/C++ libraries way easier than Rust, Zig cross compiles way more easily, etc.) is a decent tradeoff for my use cases.

For me, programming is about corralling motivation more than anything else. Rust saps my motivation is ways that Zig does not.

I love what the Oxide folks are doing. Having someone pwn your big server because of a memory bug? Yeah, I'd reach for Rust in their use cases. Or, if I'm handling credit cards, I'll have a very different set of tradeoffs that swing against Zig. (Although, in that case, I'll probably reach for a GC language in that case so that I don't have to think about memory management at all.)

2) Rust is to C++ like Zig is to C.

Zig is simply a much smaller language than Rust. I use Zig because my brain isn't big enough for either C++ or Rust.

I'm not a 10x programmer, but I still want to get stuff done. Zig and C enable me to do that without bending my brain.

reply
bilkow
19 hours ago
[-]
(not your parent commenter)

> For me, programming is about corralling motivation more than anything else. Rust saps my motivation is ways that Zig does not.

Yes, agree with you a lot! Maybe our brains are just wired differently, for me, no other language (until now) gives me as much motivation as Rust, as it's type system and docs make me feel really good.

> Zig is simply a much smaller language than Rust. I use Zig because my brain isn't big enough for either C++ or Rust.

Disclaimer: haven't really tried Zig yet. IMO you don't need to keep the whole of Rust in your brain to use it, I usually can just focus on the business logic as if I make a stupid mistake, the compiler will catch it. That (and the type system) is what makes me more efficient with it than other langs. I also stay clear of lifetimes unless I really need them (which is almost never for application code). An extreme example of the opposite is C, where I need to take care about anything I do as it will just accept anything (e.g. auto casting types) so I need to be vigilant about everything.

All of that said, there are patterns that will just be harder to reason about in Rust, mostly with self-referential things, and if you area already used to using them a lot, this can be a hassle. If you're used to smaller data structures and data-oriented programming, it will be a lot easier.

This is not trying to convince you or anyone else, just showing a different perspective. If you feel better with Zig, use it! Everyone has their own experience.

reply
hardwaresofton
18 hours ago
[-]
> All of that said, there are patterns that will just be harder to reason about in Rust, mostly with self-referential things, and if you area already used to using them a lot, this can be a hassle. If you're used to smaller data structures and data-oriented programming, it will be a lot easier.

Also an underrated chance to be forced to learn about Arenas, most of the time.

reply
GoblinSlayer
13 hours ago
[-]
Simple data structures are easy to handle though, KISS rulez. You need rust when you write something comically complex like servo, that's when you need all the checks.
reply
hardwaresofton
18 hours ago
[-]
1)

Yeah, not everyone is mitchellh -- I'd argue that his intuition was right (expecting to find more issues), there's a reason we don't all write C.

That said, it's great to hear that others are having success with Zig and aren't writing very many bugs.

> To me, the tradeoff of a demonstrably small number of bugs in a system software language in return for the demonstrably faster developer velocity (Zig compiles WAY faster than Rust, Zig wraps C/C++ libraries way easier than Rust, Zig cross compiles way more easily, etc.) is a decent tradeoff for my use cases.

Reasonable points! This is one of the reasons I have on my list to consider Zig at all (that and wanting to write more C), it seems people that like it are wonderfully productive in it.

I really like a lot of the design decisions and watch the streams than Andrew and Loris, Tigerbeetle folks and others do to see the decisions they make. Their managed IO approach is certainly interesting and quite powerful.

Dislike some small petty syntax things (whyCamelCaseFunctions()!?), but that's a me thing.

> For me, programming is about corralling motivation more than anything else. Rust saps my motivation is ways that Zig does not.

Agree with this, anecdotally.

> I love what the Oxide folks are doing. Having someone pwn your big server because of a memory bug? Yeah, I'd reach for Rust in their use cases. Or, if I'm handling credit cards, I'll have a very different set of tradeoffs that swing against Zig. (Although, in that case, I'll probably reach for a GC language in that case so that I don't have to think about memory management at all.)

Yup, Typescript works for me here, and usually the hard parts are offloaded to an external service anyway (e.g. Stripe)

> Zig is simply a much smaller language than Rust. I use Zig because my brain isn't big enough for either C++ or Rust. > > I'm not a 10x programmer, but I still want to get stuff done. Zig and C enable me to do that without bending my brain.

I wouldn't put Rust and C++ in the same league there as far as brain size requirements, but point taken!

reply
bsder
14 hours ago
[-]
> Yeah, not everyone is mitchellh -- I'd argue that his intuition was right (expecting to find more issues), there's a reason we don't all write C.

I'd argue this is also down to the debug memory allocators in Zig which run a bunch of checks for things like use-after-free. Again, one of the nice things about Zig is that debug mode isn't dramatically slower than release so you're not inclined to turn it off too soon.

However, one thing that does shock me is that no "reference to stack allocated thing escapes" errors existed. Zig does not help you very much on this front, and I'm stunned that none existed.

reply
hardwaresofton
14 hours ago
[-]
> I'd argue this is also down to the debug memory allocators in Zig which run a bunch of checks for things like use-after-free. Again, one of the nice things about Zig is that debug mode isn't dramatically slower than release so you're not inclined to turn it off too soon.

Ah another good point -- also excited for what opens up with regards to this approach with managed/explicit I/O. Pretty obvious that permutation testing of async behavior gets unlocked which is nice. The equivalent in Rust would be loom.

> However, one thing that does shock me is that no "reference to stack allocated thing escapes" errors existed. Zig does not help you very much on this front, and I'm stunned that none existed.

TIL -- is everyone just bolting on asan here and sticking to the clang backend for now?

Hopefully the zig strike force will drop by.

reply
logicchains
1 day ago
[-]
>a language with often comparable performance that is ALSO much safer

There are domains where performance is critical and safety isn't so important (e.g. video games). Zig has an advantage in such domains because of the pervasive support for passing around allocators in the standard library (avoiding hidden allocations, and allowing efficient memory reuse via block allocators), while in the Rust stdlib custom allocators are relatively cumbersome to use (and not easy to prove safe to the compiler).

reply
hardwaresofton
18 hours ago
[-]
Agreed, I really like Zig's explicit allocation (and to be fair, lots of people from Rust like it too[0], it's just such an insane lift that who knows when it will stabilize)

The new "managed" async strategy (I was previously mistaken thinking it was the same as sans-io) is also really intriguing IMO, and feels like a fantastic balance (people in Rust are doing this too, but for the unrelated reason of trying to support various async runtimes).

[0]: https://github.com/rust-lang/rust/issues/32838

reply
akkad33
1 day ago
[-]
> Maybe some day I’ll have the brain cells and skill to write code in zig and be confident I’m Not introducing a whole class of gnarly bugs, but it seems like I should just focus my limited brain power on writing high

Llms solve this problem

reply
MeetingsBrowser
1 day ago
[-]
> be confident I’m Not introducing a whole class of gnarly bugs

I think LLMs are doing the exact opposite

reply
sroerick
1 day ago
[-]
Have you tried using an LLM with Zig? When the training sets are on different language versions and there are breaking changes you may find it challenging.

I actually enjoyed zig because it prevented me from using LLMs to code in this way

reply
Tiberium
1 day ago
[-]
I use LLMs almost daily, and they certainly don't "solve" the problem of finding bugs, not even in popular languages like TypeScript. They do help a lot, yes, but they haven't solved it completely.
reply
akkad33
1 day ago
[-]
They can help automate the process. Eg from flask creator: https://youtu.be/tg61cevJthc?si=Kd8azCPwXYeb-gac
reply
hk__2
1 day ago
[-]
Using LLMs on a language you don’t already master is a sure way to introduce a lot of bugs.
reply
akkad33
1 day ago
[-]
My personal experience has been different. We recently onboarded a whole team of Devs on a language none of us mastered and it's been running in prod with only a couple bugs so far in 6 months, much lower than our average with our normal stack that everyone masters
reply
lionkor
1 day ago
[-]
If you think LLMs solve this problem, you should reevaluate your experience level and seniority.
reply
akkad33
1 day ago
[-]
I've said nothing about my experience or seniority in this discussion, so I don't know how they are relevant
reply
127
16 hours ago
[-]
Rust tooling, ecosystem and crates are much, much more mature. Many Nim libraries are unfinished, unsupported or abandoned. The language itself is pretty great, but you have to write most of the stuff from scratch.

In Nim it's very fast and ergonomic to write a MVP, but in Rust you have to think of the problem first.

I guess it's a double-sided edge: Rust is much worse for explorative programming compared to Nim, but that also forces people to build proper abstractions from the start. Which seems to directly feed into the quality of produced libraries.

Just a hunch, not something I've thought through.

reply
wiz21c
15 hours ago
[-]
I happen to prototype in python then move on to rust when things solidify... For those who don't know rust, its compiler is pretty slow. I mean, when you want to add a feature to an existing code base, each "run" you do to test the new feature imply relinking the whole project: that's very slow (or you have to split the project in sub project, but I'm lazy). In that situation, prototyping in python makes sense (at least to me :-)
reply
bobajeff
1 day ago
[-]
I vaguely remember a talk given by the creator of ELM called "The Economics of Programming Languages". It's actually really expensive to make a good programming language that's widely used.

Forget about syntax or semantics or unique features or whatever. Having money and resources are the most important factor for a successful language.

reply
Imustaskforhelp
1 day ago
[-]
Oh boy, I always had this knack for seeing/testing multiple langauges and when I had first discovered nim, I used to watch some nim youtube related content and I remember someone in nim community pointed out about this same video from the creator of elm that you also mention.

So, I think that I had watched the video and honestly, I will watch it now once again since I don't remember it clearly but If I remember, I really liked it.

A quick search points me to the video, though I am not sure https://www.youtube.com/watch?v=XZ3w_jec1v8

reply
zahlman
1 day ago
[-]
Where does the money get spent? Just developer salaries and marketing?
reply
3eb7988a1663
21 hours ago
[-]
The volume of work required to get a language going practically requires full-time headcount. Language design/compiler, community website, documentation, CI, libraries (json, datetime, regex, database connectors, web server, etc), treesitter IDE plugins. A lot of different required hats.

Sure, you can scrape by with a rag tag group of volunteers, but to ever get to mass adoption requires a lot of work and dedicated resourcing. Zig has been in development for how long now, and that is with the designer now working on it full time.

reply
colejohnson66
1 day ago
[-]
Yes. Writing a language in your free time means juggling work on the side. Or you can be at Google and get paid to write Go for your job, and get free marketing from it. Even Rust had the backing of Mozilla. Until your "pet" language reaches critical mass that you can sustain yourself and quit your day job, you're fighting the giants.
reply
steveklabnik
1 day ago
[-]
Salaries, hosting bills, CI bills… most languages do not have a significant marketing budget.
reply
xigoi
1 day ago
[-]
> I often wonder why some languages succeed while others falter.

$$$money$$$

reply
miggy
1 day ago
[-]
A strong tooling ecosystem needs money, which usually means corporate sponsorship.
reply
hk__2
1 day ago
[-]
> $$$money$$$

Rust (backed by a foundation) won over Go (backed by Google). Oh, and remember Dart (backed by Google)?

reply
nine_k
1 day ago
[-]
Say that Rust "won over" Go is like saying that Python "won over" Java. They are both alive and kicking, and live happily in rather different niches.
reply
steve_adams_86
22 hours ago
[-]
I almost always choose Go over Rust when they are similarly suited to something. I only use Rust when Go's safety isn't sufficient. Go is a joy to use, Rust rarely is (in my experience).

I wouldn't say either of them have won. I'd say both are amazing tools, too. We're spoiled for choices these days.

reply
zeroc8
1 day ago
[-]
They are used for different things. There are a zillion successful projects in Go. Don't see how Rust won anything.
reply
dismalaf
21 hours ago
[-]
Rust was backed by Mozilla at first and now it's backed by Amazon, Google, Microsoft and others...

Go and Rust don't compete, Go has a GC, they're in fundamentally different domains. Google also uses Rust, among other languages (C++, Java, Python, Go, JS, etc...).

reply
xigoi
1 day ago
[-]
In what sense did Rust “win over” Go? And since Google loves to kill its side projects fast, no wonder Dart failed.
reply
hk__2
14 hours ago
[-]
Sorry, I guess I’m biaised but I see a lot of Rust-based projects on HN and not many in Go, and in the latest StackOverflow survey Rust is way ahead of Go as "admired language" and a language that people want to work with.
reply
brabel
16 hours ago
[-]
Dart is really successful. Just look at the latest release that just came out. It’s a really great language and now runs about as fast as Go while looking as good as Kotlin.
reply
rjh29
18 hours ago
[-]
Dart is doing just fine in the Flutter space.
reply
OoooooooO
1 day ago
[-]
Rust can do everything Go does but Go can't do the same as Rust can.
reply
nine_k
1 day ago
[-]
How about fast compilation? :-\
reply
dismalaf
21 hours ago
[-]
Developer productivity matters...
reply
rishav_sharan
12 hours ago
[-]
> Why did Rust break through, for example, while so many other excellent languages didn't.

Unfortunately, a lot of this is just enterprise sponsorship. Rust had Mozilla's backing. React had FB's backing, while Vue doesn't. And so on.

There are of course, many other reasons as well, but to me this seems to be a critical one.

reply
kitd
14 hours ago
[-]
> I often wonder why some languages succeed while others falter.

IME language success has very little to do with syntax, and much more to do with stdlib, tooling, library availability, coverage on StackOverflow and all the other things that make solving problems simple.

reply
the__alchemist
20 hours ago
[-]
Concur on the [special case] of rust: It's in a domain that only has a handful of competitors (For its core competencies of system performing, high-performance programming, and embedded). It has learned from , and made improvements on them.
reply
rubymamis
1 day ago
[-]
Mojo is similar to Rust in that case, isn't it?
reply
SkiFire13
1 day ago
[-]
My understanding is that Mojo has yet to prove itself in this space. They made a lot of claims but at the time few of them were implemented.
reply
3eb7988a1663
21 hours ago
[-]
They also backed down from the initial claim of full Python compatibility. Which was the entire appeal of the venture. If you cannot seamlessly drop into the Python ecosystem, it is just another scripting language with better architecture to enable faster code.
reply
ivell
17 hours ago
[-]
Mojo is not a scripting language in the usual sense. It is a system programming language more akin to Rust. Their aim is to have better ergonomics than Rust.
reply
nylonstrung
16 hours ago
[-]
Nobody wants a closed source systems language

In practice, Mojo feels like it pivoted to being a pythonic scripting language for CUDA

reply
wolvesechoes
15 hours ago
[-]
It makes me sad that neither Nim nor D didn't take off. Expressive language with native compilation and automatic memory handling is the way to go for me. C# and Java native AOT options are still somewhat limited, and the last thing one can say about Go is that it is expressive.
reply
brabel
13 hours ago
[-]
You may want to look into OCaml and Dart. Both are highly expressive, have automatic memory handling, native compilation and excellent performance.

I like D, but it's a bit of a mess at the moment with the DIP-1000 (Rust-inspired stuff for memory management) half-baked changes, the new experimental allocators (probably coming from Zig), it keeps breaking (on MacOS at least). With the very advanced metaprogramming, it also suffers from lack of good tooling, just like Nim... Nim was going to "solve" that a few years ago, but as far as I can see from the outside, nothing really "shipped" recently to improve the situation. Without good tooling, I am quite sure I am more productive even in Rust (and I am no expert on it), let alone OCaml (tooling is decent, and the language is just really powerful) and Dart (which has absolutely awesome tooling), for example.

reply
wolvesechoes
11 hours ago
[-]
> excellent performance.

I wanted to check those languages at some point, didn't have time, but I doubt they offer a performance for the stuff I am doing. It is also another reason I discard Java and Go (C# seems slightly better than those).

I deal primarily with scientific/engineering calculations, mostly ODE simulations, so I have some demands regarding performance. Python is of course important, but not for the core production code. Fortran is nice for math stuff, but not much else. C/C++ are as performant as awful. Rust is viable, has nice tooling and ecosystem, but introduces too much hassle that is not that important in my domain. Julia has nice ideas, but poor execution, low quality tooling, AOT delegated to some package that may or may not work with your code etc.

I played with D and it strikes a nice balance. With LDC and careful allocation strategies it can be as performant as Rust, with DMD it compiles much faster, and outside performance-critical code parts it is more ergonomic because of GC. Tooling is decent. Because contrary to sentiment popular on this website I actually think Visual Studio is still the best IDE out there, I am glad that Visual-D exists.

My main issue with D is exactly that - it didn't take off. As a consequence the knowledge-base is small, a lot of things are poorly documented etc. With Nim it is similar, but worse.

reply
brabel
9 hours ago
[-]
Do you have any open source code you can share that demonstrates the kind of application you wouldn't be able to get the desired performance in Go/OCaml/Dart?

I ask because I've seen Dart beat Java/Go/D (very high memory throughput, no idea what Dart is doing differently but it's amazingly good at it)... but I can imagine that if you only perform numerical computation, Dart may miss optimisations that will make it slower (normally, it will be optimised to approximately the same as you'd written in C, but in some cases it can hit the "slow path" - those are getting less and less every release, and if you provide an example the Dart team would likely be happy to fix that).

reply
patates
12 hours ago
[-]
Does anyone use Dart in a productive setting outside Flutter? AFAICT (from outside), they even let go of AngularDart and focus solely on Flutter - something which I avoid because of the a11y problems it brings.
reply
brabel
11 hours ago
[-]
Yes, it's not very popular but there's lots of good alternatives now for, for example, CLI and Server backends.

Some very good frameworks/service to look at for backend development:

* Serverpod - https://serverpod.dev/

* DartFrog - https://dart-frog.dev/

* DartStream - https://dartstream-prod.frb.io/

* Appwrite - https://appwrite.io/docs/quick-starts/dart

It's just a really good language to work on, try the tooling and you'll see it for yourself (either with Flutter or just Dart):

https://dart.dev/tools

reply
pjmlp
10 hours ago
[-]
What is so expressive about doing,

    type StatusCodes int

    const (
    Success StatusCodes = iota
    Ongoing
    Done
    )
instead of (in Java and C#),

    enum StatusCodes {Success, Ongoing, Done}
or if you prefer something from 1976's Pascal,

    type
    
    StatusCodes = (Success, Ongoing, Done)
reply
wolvesechoes
10 hours ago
[-]
I have written:

the last thing one can say about Go is that it is expressive

reply
pjmlp
9 hours ago
[-]
I misread your sentence, sorry about that.
reply
runeblaze
10 hours ago
[-]
Technically Koka checks your box. You also get algebraic effects in the same bundle
reply
liampulles
13 hours ago
[-]
I think languages that favor an "expressive" syntax, which favor using and building syntactic sugar and macros, suffer from a nicheness problem.

That is they are going to have to appeal to people who want that style of programming, and they have the additional hurdles of A) having more stuff one has to learn to use the language, B) dealing with a community of people who all want the magic from their previous language ecosystem imported into this new one, and C) the additional burden on libraries to come about which use these features.

Note: I have not used Nim, so please take the above with a lump of salt.

reply
TylerE
13 hours ago
[-]
I've used nim a bit and am going to push back quite hard on this. The core of the language is really quite consise. No harder of a mental overload than say go, or python.

I'd also argue that high expressiveness actually allows you to avoid magic. The actual library implementations are rarely very scary. We're ahead of time compiled and type checked so it's not like some rails codebase where a clockwork goblin can just explode out of nowhere.

reply
cb321
12 hours ago
[-]
I would also push back (agreeing with @TylerE, but linking in this part of the subthread seems best). It all depends, but sometimes macros change the division of labor between library authors and library users so that they specifically have to learn less. For example, https://github.com/c-blake/cligen makes it so that you don't really have to learn an "API" to roll a nice CLI on top of a procedure. You just need to learn literally 2 or maybe 3 names: "cligen", "dispatch", and maybe "help={}". Everything else, you already know from knowing Nim basics (or even Python basics). (The dispatchGen macro itself is rather a monster of static introspection and code generation and not at all pedagogical -- mostly from filling like 100 user requests on closed issues.)

It's just important to keep in mind that library / framework authors, library / framework users, and final end users are not all the same person or even type of person. Metaprogramming enables the first group the most, but can deliver benefits to the latter two groups by easing their lives quite a bit. This is easy to lose track of in a niche language like Nim where all 3 groups might well be the same human for most of the life of some project.

This partly also relates to how much of a "full stack debugger (of either correctness or performance or both)" personality one has. Then there are even more layers -- like all the levels in the language / compiler itself down to the CPU and beyond (such as "u-code" & micro-architectural resource sharing).

What macros mostly do is enable fluid, simple syntax for things either too rare, too niche, too unanticipated or too disagreed upon to be in "the main language", whatever that is. As a shibboleth (or marker for group inclusion), the existence of this expressivity selects for programmers who want to fix rare, niche, unanticipated or disagreed upon things, and these people can be even harder "cats to herd".

Nim has other very flexible features - such as the rare "user-defined operators" that enable very nice looking custom syntax. But you can also SCOPE their use very simply. E.g., put their definitions inside a template so that you can say `ptrArithmeticNow: expression` and only have pointer arithmetic within `expression` (maybe with +! to look a little diff from ordinary arithmetic), and (ptrArithmetic itself can be scoped within a module name). It also has even more powerful (and more rare) term-rewriting macros, used most commonly in Lisp systems, perhaps doing computer algebra.

reply
liampulles
13 hours ago
[-]
Thats good feedback, thank you.
reply
TylerE
13 hours ago
[-]
Macros in general are actually hugely anti-magical things because they let you push what normally be runtime checks into the compiler which not only means you get to fail fast but (if your language tooling is decent) means you actually get sane error messages instead of a traceback nested 1000 function calls deep or something.
reply
gyulai
1 day ago
[-]
So, there I was in 2016. It had been 13 years since I had last entertained the desire to learn a new programming language (I had landed on Python, back then). The serious contenders were Go, Nim, and Rust. I landed on Nim back then, thinking to myself: Man, this language really has a future. I did my next side project in Nim, and loved it like I've loved no other language over the course of my (as of now, in 2025) 28 years of programming. But no actual job ever materialized to make me into a professional Nim programmer that would actually pay the bills. I stuck it out with Python, with growing discontentment. I took a Perl job in 2018, which lasted until 2022, which I never should have taken in the first place. I was relatively free in my choice of language from that point forward, and decided to switch from Python to Lua after a short period of disorientation where I kind of liked Haxe. Right now, I'm learning Rust, crying tears over that future for Nim that never materialized.
reply
ZoomZoomZoom
1 day ago
[-]
Had almost the same situation to a tee around the same time (~2014). Decided between Rust, Nim, D and Go. Went with Rust then and quickly felt it had been the right choice since it really helped me improving my skills and got me interested in programming again after a few years away from it. Rust community was way smaller and more approachable, the language felt exciting and really delivered on its promises.

Then around 2019 Nim started to gain momentum (preparing for 1.0 release) and when I looked into it a bit deeper it became evident that for most of the code I usually write for myself Nim is just a more pragmatic choice than Rust. It gets me there faster.

Zero job perspectives both times, scratched my own itch twice though.

Glad I haven't gone with Go. Nim is not a perfect overlap with Rust, but it definitely covers everything Go can do and more and is a better design in my opinion.

reply
yawaramin
22 hours ago
[-]
Haha. I'm still in the 'this language has a future' phase with OCaml.
reply
scuff3d
21 hours ago
[-]
You could always go work for Jane Street or... nope thats all I got lol
reply
Imustaskforhelp
1 day ago
[-]
Honestly, we can all still correct it if we really want to. Nothing is too late in my opinion, but the question that I wish to ask is, is it worth it?

I mean, compared to zig which is starting to have a lot of hype and libraries / help, lets say that we now wish for nim to have this, then are the feature differences b/w zig and nim worth the revival of nim in that sense? (Pardon me if this doesn't make sense)

reply
paradox460
1 day ago
[-]
I really wanted to love nim. I wrote a bunch of tools in it, had fun, and then ultimately rewrote them all in rust. The library situation in nim is just unfortunate, and I say that as someone who uses elixir. That, and the cross compiling took far more effort than getting the same code finished on rust, which was little more than "use cross"

I keep hoping nim will get better, because it's a beautiful language that produces absolutely tiny, efficient binaries

reply
mathverse
1 day ago
[-]
Nim is a programming language for an expert programmer. The ecosystem is very small and for everything a little bit more specialized you need to make a library yourself.
reply
andsoitis
1 day ago
[-]
When there's a vacuum like that, that is also an opportunity for folks to make a significant impact.

Compare to other communities where you need to stand out from the noise.

reply
lifthrasiir
20 hours ago
[-]
That's plus for individuals but minus for languages.

Personal anecdote: I was exactly there a decade ago when I was working on Chrono, now one of best-known date and time libraries in Rust. Since I was simply my own, my design was not as good as it could have been. Of course it is still much better to have a suboptimal Chrono, but I can't deny that it remains and probably will remain suboptimal due to my design a decade ago.

reply
hk__2
1 day ago
[-]
This usually ends up in a situation where most of the significant libraries for the language are abandoned GitHub repos with 13 stars and no documentation ("You just have to read the code!!1!").
reply
ivanjermakov
23 hours ago
[-]
Abandoned (finished) with no docs (read/copy/hack the source). I'm surprised how devs are afraid to look behind the curtain of a library/os/compiler.
reply
scuff3d
21 hours ago
[-]
Perfect examples of glass-half empty vs glass-half full kinds of people.
reply
summarity
1 day ago
[-]
Whenever I’m missing a library I’m usually just 5 mins away from successfully using a C library (or any library with a C API). In my years doing data analysis, signal processing, and just writing plain servers I’ve never once gotten stuck because of a missing library.
reply
raffraffraff
1 day ago
[-]
This. I really wanted to like Nim. I tried to learn it, but having never been a programmer before (but years of Linux admin, puppet, terraform and scripting) I found it extremely tough, and a lot of documentation is out of date and the there aren't many good examples to follow. Switched to Go and have built lots and lots of stuff in go.
reply
ZoomZoomZoom
1 day ago
[-]
> a lot of documentation is out of date

Please, file bugs or complain on the official matrix room. The community tries its best to keep up the official documentation in sync with the changes.

https://matrix.to/#/#nim-lang:matrix.org

reply
amai
2 hours ago
[-]
Nowadays you could let an AI vibe code all libraries you need.
reply
Imustaskforhelp
1 day ago
[-]
Exactly, I had tried nim but I felt the same issue.

I mean, personally I really like golang. Its actually gotten an ecosystem that functions while being able to cross compile and actually being easy enough to learn unlike rust.

I also sometimes exclusively just use typescript/python just for their ecosystem as a junior programmer. For me ecosystem matters a lot and this was a reason why I wish that more languages can create more libraries which can work.

Like the article pointed, nim is really solid language. But I'd like to see more libraries being made for it.

reply
DarkNova6
1 day ago
[-]
Sounds more like "Expert Hobbyist" than "Expert Programmer".
reply
jarredkenny
1 day ago
[-]
I fell in love with Nim a couple of years ago, but feel like Zig gaining popularity has really pushed Nim out of the limelight in terms of developer adoption.
reply
Zambyte
1 day ago
[-]
Nim has been on my radar for a while, but I've never really dug into it. I have actually written some small projects in Zig though. Are there things you think Nim does better than Zig?
reply
Tiberium
1 day ago
[-]
I think Nim and Zig target very different audiences and have very different goals. Nim is about being a big, powerful language with lots of features, so that you have the freedom to use it the way you want, e.g. there is OOP with methods, but it's completely optional. Zig is explicitly against that, even on the homepage you can see: "No hidden control flow. No hidden memory allocations. No preprocessor, no macros.". While memory management in Nim by default is completely automatic, and templates/macros are quite common.

It makes much more sense to compare Nim to, say, Swift, D, or other modern compiled languages with lots of syntax sugar.

reply
anta40
1 day ago
[-]
You may consider Nim as a sort of "compiled Python" with some Pascal influences.

https://nimble.directory/ I'd pick Nim if my concern is general app development, not specifically system programming.

reply
ziofill
1 day ago
[-]
> In fact, Nim first compiles to C which in turn is compiled to machine code by the C compiler of your choice (gcc/clang).

Can one use the zig compiler after nim has compiled to C?

reply
ethan_smith
15 hours ago
[-]
Yes, you can use the Zig compiler as a C backend for Nim by setting `--cc:zig` in your Nim compiler flags, which provides better cross-compilation capabilities than traditional C compilers.
reply
blashyrk
1 day ago
[-]
Yes, I tried it recently for easy cross-compilation. You can use basically any C/C++ compiler, even TinyCC works (in most scenarios) if you want an extremely fast edit/compile/test cycle.
reply
Tiberium
1 day ago
[-]
You can, but zigcc is essentially Clang bundled with extra stuff to make cross compilation easy.
reply
zero0529
1 day ago
[-]
What a low effort article. I have done some programming in Nim. It’s a nice language but I felt frustrated whenever I wanted to do something I knew I could do in python but that didn’t work in Nim. I just missed some of the syntactic sugar of python, that being said I would love to get back into Nim again.
reply
polotics
1 day ago
[-]
You know what, I mostly do python, but then had to get quite high performance on some lib. Converting to Nim and importing with nimpy has been a blast. The result is just one more python module, colleagues don't get frightened when they see the code, it's just seamless and nifty. I much prefer it to Cython.
reply
Tiberium
1 day ago
[-]
Can you provide some examples if you still remember?
reply
zero0529
1 day ago
[-]
If I remember correctly it was when working with collections but I can’t remember a concrete example though. Their std library is by no means bad it is just different enough from python to hurt my productivity. My initial motivation for chosing Nim was because I was doing an algorithm course at the time and I wanted to archive fastest runtimes in shortest amount of code
reply
fao_
22 hours ago
[-]
At this point I would feel more enthused to read a "Why not Nim?" page. Advertise where the language is bad at so I can get a better sense of it.
reply
esafak
20 hours ago
[-]
* It hasn't taken off.

* It doesn't have many libraries.

reply
mid-kid
1 day ago
[-]
So why does nobody ever talk about Haxe in the context of an "everything" language?
reply
xigoi
1 day ago
[-]
Is there anything about Haxe that makes it better than Nim?
reply
winrid
14 hours ago
[-]
Compiles to more languages.
reply
summarity
1 day ago
[-]
I’m also an avid Nim developer (findsight.ai is almost pure Nim).

I recently compiled some stats on Nims popularity on GitHub: https://code.tc/nim-stats-august-2025/

It’s growing steadily but I do qualitatively feel like the ecosystem has lost a bit of steam over the past year. Excited for the ongoing Nim tool chain work though.

reply
mrbluecoat
1 day ago
[-]
From a promotional marketing perspective, that webpage misses quite a few basics, like linking to the Nim site [0] and explaining what it actually does:

Nim is a statically typed programming language that compiles to native dependency-free executables in C, C++ or JavaScript.

[0] https://nim-lang.org/

reply
Gud
1 day ago
[-]
What I’m curious for is something akin to a language abstraction layer.

So you can easily combine codebases written in different languages. I guess something like wasm and llvm.

reply
efilife
1 day ago
[-]
Significant whitespace is a dealbreaker for me. I never tried Nim for this reason
reply
HiPhish
1 day ago
[-]
I could never understand why people care this much about significant whitespace of all things. This seems like such a non-issue, it should be a minor annoyance at worst. Then again my favorite language is Lisp, so maybe I'm just too much beyond caring about syntax. The only annoying thing about significant whitespace is having to escape a new line sometimes.

But significant whitespace has always made sense to me. You are going to indent your code anyway, so you might as well give the indentation some meaning. I write Python, JavaScript and Lua most of the time, and I never waste any thought on whitespace VS braces VS keyword delimiters.

reply
teo_zero
15 hours ago
[-]
I can count multiple reasons why someone might dislike significant whitespace. The most evident is that whitespace is... not evident at all! By definition, it's a transparent character: it's extremely difficult to directly count spaces; they can be indirectly counted by comparison with text in the surrounding area. The same principle why we add commas or apostrophes or spaces every 3 digits in big numbers.

As of the "you're going to indent your code anyway" claim, this seems to completely ignore one-liners, either embedded in other documents (onClick=...) or fed to the shell as a quick way to get some work done without spawning new tools.

reply
mixmastamyk
4 hours ago
[-]
I turned on indentation guides on my basic editor twenty years ago and never looked back. Show whitespace in a pinch once a year? Or shift arrow select. Not a significant problem.

They can also be shown always in a very muted color if having frequent problems, for some reason.

reply
MrJohz
11 hours ago
[-]
The biggest advantage if you can avoid significant whitespace is that it's usually a lot easier to manipulate text if you don't have to worry about the whitespace being correct. For example, when I'm copying and pasting Javascript code from somewhere else into a file, I don't need to worry about getting the indentation right, I just paste it into the right location, press format, and it does what I want. This is often nontrivial in Python, where both the source and the destination may have existing (invisible) whitespace. Worse, leading whitespace characters are often trimmed on copy or select, which often makes the resulting paste even more chaotic.

This is a minor inconvenience, and I still use Python regularly when it makes sense, but from a language design perspective, I think it's one of those decisions that makes your users' lives that slight bit harder with no real upside.

reply
mixmastamyk
3 hours ago
[-]
Select-lines-(shift)-tab when needed is quite easy. Often that’s not needed either because moving from one function to another is the same level.

The benefit is not having to constantly read/write delimiters. Imagine a shell where all arguments had to be delimited by , or | chars instead of whitespace.

reply
MrJohz
3 hours ago
[-]
It's harder when the source or the destination isn't all indented in quite the same way, which happens often if you start a block, press enter and end up on an indented line, and then paste the code.

I don't really get the readability argument - like the lisper I was replying to said, it's all much of a muchness. A shell where arguments are delimited by commas is a function call in most programming languages, and people don't struggle with readability there. If anything, I find having an explicit "close block" symbol a useful visual marker on the page, but I write Python fairly regularly and don't really notice much readability differences compared to any of the brace-using languages I work with.

reply
darthrupert
15 hours ago
[-]
> You are going to indent your code anyway, so you might as well give the indentation some meaning.

Autoformatters came and fixed that problem. Nobody (except python, haskell and nim coders probably) wastes time indenting code anymore, you save and your code is indented. Nowadays, code that relies on whitespace and has no ending delimiters (like nim and python) gets awkward because the formatters have less information to go on. If your rust or typescript code formats to bad indent or none at all, you have an error.

reply
mixmastamyk
3 hours ago
[-]
Editors already auto indent. I find reading/writing Python easier than rust/javascript.
reply
efilife
23 hours ago
[-]
It's harder to tell where code blocks end just by looking

2, I sometimes want to fuck up the indentation on purpose, if I'm just quickly pasting some code to test if it even works or to mark it as "look at it in 5 minutes from now". Also I can mix spaces and tabs

quick edits it notepad/vim/whatever become painful

also converting tabs to spaces or vice-versa is tiring. A language shouldn't force me to a particular code style

reply
Sohcahtoa82
5 hours ago
[-]
> It's harder to tell where code blocks end just by looking

This is always puzzling to me.

I've always felt that the indentation is what told me a code block ended, not a closing brace. It's graphical rather than textual.

Maybe that's why Python feels more natural to me. The indentation tells me a code block ended, and the closing brace used by other languages is just a redundancy. Languages that use things like "endif/endfor/etc" end up looking downright cluttered.

> also converting tabs to spaces or vice-versa is tiring.

Get a better IDE. I've never had this be an issue in PyCharm.

reply
froobius
1 day ago
[-]
On the other hand, I hate languages that are polluted with ugly bracket noise, so Nim is appealing to me for this reason
reply
vips7L
1 day ago
[-]
It’s subjective, but this is also why I haven’t tried Nim or Crystal. If you like brackets, I’d say try Swift if you want to stay in the natively compiled + GC space.
reply
Philpax
1 day ago
[-]
I don't believe Crystal is whitespace significant?
reply
vips7L
1 day ago
[-]
It uses do/end but parts of it are white space from what I can tell.

    loop do
        case message = gets
    when Nil
        break
    when ""
        puts "Please enter a message"
    else
        puts message.upcase
    end
  end
reply
etra0
1 day ago
[-]
It is not whitespace sensitive afaik. This same version works as well

    loop do
            case message = gets
                            when Nil
            break
        when ""
    puts "Please enter a message"
        else
            puts message.upcase
        end
      end
(Scrambled on purpose).
reply
sigmonsays
1 day ago
[-]
Spaces don't copy n paste well and are hard to read/navigate
reply
archargelod
1 day ago
[-]
I hated significant whitespace when I tried Python first time. Years later I found Nim and indentation didn't bother me as much.

Maybe we both just got bad first expression with most popular, but unfortunately not a good language? =)

reply
zahlman
1 day ago
[-]
I've really never understood where this aesthetic preference comes from.

Back when most of my code was in C or C++ (or Java), I was told all the time, sure you can omit these braces for a single-statement block, but you shouldn't, you'll regret it later. You can leave all the code unindented or irregularly indented, it won't matter to the compiler, but you'll appreciate lining it up in the long run. And all that advice was correct; I was better off in the long run, and I saw others come to regret it all the time. But then, over time, I started to wonder why I had to scan past all these diagonal lines of close braces as I read the code. And I cursed that these languages made it too difficult to pull out the inner parts into separate functions, disentangle setup and teardown from the main loop etc. But I also cursed that after putting in the effort (even if was just "using a proper text editor") to make things line up beautifully and in agreement with the logical structure, I still had to take up vertical space with these redundant markers of the logical structure.

Python was my first language using significant whitespace, and it was a breath of fresh air. That was a bit over 20 years ago, I think. I've learned several other programming languages since then, but I never "looked back" in any meaningful way.

reply
lostdog
1 day ago
[-]
Every time I copy paste something in python I have to check the whitespace. Often there's a problem that needs fixing, like the first line indented differently, or everything is off. Sometimes I'm not paying perfect attention and get hard to catch bugs.

I'm now certain that significant whitespace is simply wrong.

reply
Philpax
1 day ago
[-]
Significant whitespace pushes a tooling problem (correct indentation) into the human domain. It might have made sense before autoformatters that run on save, but I agree with you that in today's languages, it's a net negative.

As far as I'm aware, none of the new languages that have seen success in the last ten years (Go, Rust, Swift, Dart, Kotlin) rely on the author to format code correctly - instead, they do it for you. And that's good! That's one less thing the programmer has to worry about!

reply
zahlman
1 day ago
[-]
> Significant whitespace pushes a tooling problem (correct indentation) into the human domain. It might have made sense before autoformatters that run on save, but I agree with you that in today's languages, it's a net negative.

Sorry, I don't follow. There's nothing preventing a tool from re-indenting code when it's pasted (i.e.: considering indentation within the pasted text relative to its first line, and then applying an indentation offset according to where it's pasted), and many already do. It's the same kind of logic that's used to auto-format code in braced languages; arguably simpler unless it's also validating the existing indentation of the pasted text.

And actually, who even is relying on "autoformatters that run on save"? I want the code to look right as I'm writing it, not after. The tools you describe are, to me, about maintaining project standards when multiple people are involved, but fundamentally each person is still making the code look locally, personally right before saving (or committing, since these things are also often done with pre-commit hooks). I can't imagine just typing out whatever slop is syntactically correct and waiting to save the file to fix it. Not when I have a proper text editor that facilitates typing it out the way I want it, taking advantage of awareness of the language syntax.

> none of the new languages that have seen success in the last ten years (Go, Rust, Swift, Dart, Kotlin) rely on the author to format code correctly - instead, they do it for you.

Languages do not and cannot format code. Text editors (including the ones built into IDEs) do. If I type a } and the text changes position, it's not the programming language that did this.

And this is also not better in braced languages. Just as I can input a } on a new line in Vim in a braced language and have it dedent, if I want to write more code in Python that's outside the block, I just press the backspace key and it removes an entire level of indentation. And then I start typing that code, and I don't have to input a newline because I'm already on the line where I want the code to be, because I'm not expected to have a } on a separate line from everything else.

reply
Philpax
1 day ago
[-]
> Sorry, I don't follow. There's nothing preventing a tool from re-indenting code when it's pasted (i.e.: considering indentation within the pasted text relative to its first line, and then applying an indentation offset according to where it's pasted), and many already do. It's the same kind of logic that's used to auto-format code in braced languages; arguably simpler unless it's also validating the existing indentation of the pasted text.

I have not had this work reliably for me - my relatively stock VSCode does not indent the pasted code correctly - but I will freely admit that it could, and that this is a point in favour of good tooling.

> And actually, who even is relying on "autoformatters that run on save"? I want the code to look right as I'm writing it, not after. The tools you describe are, to me, about maintaining project standards when multiple people are involved, but fundamentally each person is still making the code look locally, personally right before saving (or committing, since these things are also often done with pre-commit hooks). I can't imagine just typing out whatever slop is syntactically correct and waiting to save the file to fix it. Not when I have a proper text editor that facilitates typing it out the way I want it, taking advantage of awareness of the language syntax.

Most people who write code in these languages rely on them! Format-on-save is one of the first things one sets up in an ecosystem with high-quality formatters. You can write code that is sloppily formatted but conveys your intent, then save and have it auto-format. It completely reformats formatting as a concern. As they say in Go land: "Gofmt's style is no one's favorite, yet gofmt is everyone's favorite."

> Languages do not and cannot format code. Text editors (including the ones built into IDEs) do. If I type a } and the text changes position, it's not the programming language that did this.

These languages ship with first-class robust and performant formatters that encode the language's preferred style; much effort has gone into developing these formatters [0]. For all intents and purposes, they are part of the language, and users of these languages will be expected to use them.

> And this is also not better in braced languages. Just as I can input a } on a new line in Vim in a braced language and have it dedent, if I want to write more code in Python that's outside the block, I just press the backspace key and it removes an entire level of indentation. And then I start typing that code, and I don't have to input a newline because I'm already on the line where I want the code to be, because I'm not expected to have a } on a separate line from everything else.

I just don't think about it. I write my code in whatever way is easiest to type - including letting the editor auto-insert closing braces - and then hit save to format.

In general, you are freed from formatting as a matter of concern. It's just not something you have to think about, and that's liberating in its own way; it makes bashing some code out, or pasting some code in, trivial.

[0]: https://journal.stuffwithstuff.com/2015/09/08/the-hardest-pr...

reply
zahlman
11 hours ago
[-]
> Most people who write code in these languages rely on them!

I find that a little hard to believe. There is a universe of programmers out there who are basically invisible to you.

> I just don't think about it. I write my code in whatever way is easiest to type - including letting the editor auto-insert closing braces - and then hit save to format.

Don't you want to see neatly formatted code while you're writing it?

reply
MrJohz
10 hours ago
[-]
For Go, they have a statistic from a few years back that suggests about 98% of a cross section of real-world Go projects are formatted according to gofmt. (https://jmoiron.net/blog/fmty-dmpty) I can believe Rustfmt and other tools not having quite the same reach, but I would guess that the proportion is still pretty high.

These tools are very standard and very widely used.

> Don't you want to see neatly formatted code while you're writing it?

Every time I pause, I press ctrl-S or an equivalent. So I really am seeing neatly formatted code while I'm writing it. I would guess that 90% of the time, if my code is syntactically valid, it's also neatly formatted. And even if it's not valid code, it's probably very close to being neatly formatted.

reply
zahlman
8 hours ago
[-]
> Every time I pause, I press ctrl-S or an equivalent.

I use Vim, so that would be really unnatural and disruptive.

reply
MrJohz
5 hours ago
[-]
I actually use Helix so I don't use that either, but I figured ctrl-S would be the more well-known shortcut for communicative purposes.
reply
polotics
16 hours ago
[-]
I've been certain that copy & pasting code is simply wrong for a long time, but if the ease of doing this is your yardstick for language design quality, then you are simply right.
reply
mixmastamyk
1 day ago
[-]
Yes, optimize for the thing you do once in a great while over having to read/type redundant braces constantly. Wouldn’t want to have to pay attention and use the tab key! ;-)
reply
xigoi
1 day ago
[-]
I have just the thing for you ;)

https://github.com/xigoi/nimdenter

reply
Rochus
1 day ago
[-]
Wouldn't just adding an "end" to the compounds suffice? An alternative syntax might be a good idea, but #{ and #} looks pretty noisy.
reply
xigoi
12 hours ago
[-]
Well, the point is to appease people who like noisy syntax, otherwise they could just use Nim normally.
reply
krupan
1 day ago
[-]
Hello, Python Critic from the 1990's. Welcome to the future
reply
codr7
1 day ago
[-]
Hello fellow programmer from the middle ages; we discovered long ago that significant whitespace is a dead end, the fact that it's popular with the wannabes changes nothing.
reply
quotemstr
1 day ago
[-]
You mean the language also known as NIM, n_iM, and NI_m?
reply
otherme123
17 hours ago
[-]
IMHO it is a good choice. You shouldn't have variables around that are different only on one cased character, or because one is snake_case and the other is camelCase. It also avoids the contamination of your code when using for example a C library in snake_case while your library uses camelCase. And finally, you can refactor a library in snake_case to camelCase without breaking dependent code.
reply
Tiberium
1 day ago
[-]
The first character is actually not considered for case insensitivity, although it was in the past. :) And case insensitivity itself comes to Nim from Pascal.
reply
quotemstr
23 hours ago
[-]
The underscore thing gets me more than the case insensitivity, FWIW. We have tools for case insensitive greps, but underscore normalizing ones are rare.
reply
winrid
14 hours ago
[-]
nimgrep
reply
xigoi
1 day ago
[-]
By this logic, C++ is the same as C, C# is a syntax error and PHP should be named $PHP :D
reply
jopython
1 day ago
[-]
I would have used Nim if Go didn't happen.
reply
OutOfHere
1 day ago
[-]
Go is good, but sometimes you need higher performance, which is when one of Rust/Zig/Nim must enter the picture.
reply
simonask
1 day ago
[-]
“Has safety features in place”? I’m sorry, not gonna cut it.

I mean, Nim looks cool, but I’m not sure what it does that is substantially new. Niceties are generally not enough to foster adoption - something real has to be on the table that meaningfully opens up new avenues, unlocks new paths, enables new use cases.

I have the same criticism of Zig.

reply
archargelod
1 day ago
[-]
Nim has one of the most powerful metaprogramming systems out there. Hygienic templates, easy macros, but my favorite is the compile-time functions.

Nim compiler has an embedded VM, so any Nim code (that doesn't rely on FFI) can run at compile time.

reply
simonask
13 hours ago
[-]
I'm sure that's nice, but it's not a game changer. You can do metaprogramming in other languages as well, and maybe those languages get it not quire as right as Nim, but it's not enough to tip the scales.
reply
lionkor
1 day ago
[-]
More powerful than zig's comptime?
reply
Tiberium
1 day ago
[-]
Yes, compile-time execution in Nim is very natural, if you mark a variable "const" or use some other ways, you can run almost all pure-Nim code at compile-time without having to modify it.
reply
xigoi
1 day ago
[-]
For me, the killer feature of Nim is that I can just write code without having to constantly fight the language.
reply
metaltyphoon
21 hours ago
[-]
You just get to fight now at runtime!
reply
tucnak
17 hours ago
[-]
> opens up new avenues, unlocks new paths, enables new use cases.

These are all the same thing.

reply
binary132
1 day ago
[-]
The main reason I never got into Nim is that I seem to recall it depending on mingw and that frankly always sets a language into a second-class category for me. Maybe now it’s different, I don’t know.
reply
dismalaf
21 hours ago
[-]
Nim is nice but I can't really find a use for it. Maybe it's because I started out on dynamic languages (Ruby and R) where I got used to writing in a dynamic language and then rewriting bottlenecks in C++.

Nim is in the awkward middle area where it's got a GC so it'll never replace C/C++ but it also isn't as productive as something like Ruby.

reply
miguel_martin
19 hours ago
[-]
Nim 2 does not have a mandatory gc.

It is recommended to use ARC, which has similar semantics to C++, ie moves, copies, etc.

Unlike D, the GC is not mandatory for the standard library.

reply
yapyap
14 hours ago
[-]
oh nim nim nim nim nim fucking nim
reply