Nimony: A New Compiler for Nim (nimony.org)
157 points by Fervicus 2 days ago
stakhanov 8 hours ago
When I was doing the rounds roughly 10 years ago, trying to find a new programming language to learn, my money for "next big thing" landed on nim. I did some personal projects and absolutely loved it but, unfortunately, opportunities to work "on the clock" in nim never materialised and then rust started eating the world.
Thanks, Andreas Rumpf, for sticking with it for all these years: This seems like a great opportunity for me to get back into nim.
Symmetry 4 hours ago
> Nimony is case sensitive like most other modern programming languages. The reason for this is implementation simplicity. This might also be changed in the future.
I've never been too annoyed by Nim's approach but I think this removes a complaint many people have.
aslilac an hour ago
it also removes one of nim’s most unique differentiators which seems like a loss to me
maplant an hour ago
If your unique differentiator for your programming language is that identifiers are case insensitive you need to find a new schtick
shevy-java 2 hours ago
I am not sure. I think Nim is a fine language, but it is a little bit cumbersome as well, due to the typing. People complain just about everything, so this is not a good metric to use as the only metric. Nim has a similar problem as crystal has: too few users. With the rise of AI, this problem has amplified. You can see it if you look at Ruby, how it declined in the last two years. I wonder what young people do these days. Has learning programming languages become worse here?
afavour 5 hours ago
I’m curious if this closes the door on Nim’s capability to output C code which you then compile yourself. I first discovered Nim when I was looking for something that could work with Apple’s requirements to embed bitcode in iOS apps, it meant you had to use their specific version of LLVM and that ruled out a lot of languages. It always seemed like a really unique feature (though IIRC Haxe has something similar).
Apple has long since removed that requirement so it doesn’t really matter anyway and I wouldn’t blame the Nim folks if it’s gone, these seem like a great set of improvements.
15155 2 hours ago
The real win with the compile-to-C strategy is embedded - a million embedded devices only publish vendor-provided (typically GCC) C toolchains.
elcritch an hour ago
This is a great part of Nim. I started using it with ESP32's for 5+ years or so now. Nimony is even more ideal for embedded.
Great part is that Nim's stdlib networking was easy to port to esp-idf's lwIP based network stack. So you get access to production Nim libraries for lots of networking stuff, or async, etc.
txdv 4 hours ago
A lot of compilers nowadays compile to wasm, when you have wasm, you can compile to C.
15155 2 hours ago
Wasm is great, but it's a terrible IR for C back-compilation if you have alternatives available IMO.
tokai 3 hours ago
Nimony still puts the C code in the .cache/ folder as nim does.
girvo 8 hours ago
It’s super exciting. It’s basically adding all the features I wished Nim had, and I’ve been using Nim in anger since the v0.10 days!
deepsquirrelnet 4 hours ago
I did my first "real" nim project this year. I'd been tinkering with it here and there, but found a chance to use it. I'm coming from mostly python experience and found it to be a really nice experience.
eterps 6 hours ago
Nice, it looks like it supports option and result types as well:
polotics 11 hours ago
This is great! Congrats to the Nim team for keeping the pedal to the metal!
Sum-types, borrow-checking... Nim 3 is beautiful.
ZoomZoomZoom 9 hours ago
BTW, Sum types (along with incremental compilation, SSO strings and other thing) have been recently added to Nim 2 with the 2.4.0 release: https://nim-lang.org/blog/2026/10/28/nim-240.html
torginus 6 hours ago
Is this a Python 2/3 situation?
christophilus 6 hours ago
brabel 7 hours ago
How does this differ from this new compiler?
michaelsbradley 4 hours ago
pietroppeter 7 hours ago
I think Nim is a great fit for the AI era. let me explain
Always appreciated how Nim gives you a low cognitive load: it is easy to reason about, does not get in the way of doing stuff, you focus on what you need to do it and rarely on how you do it (specifics of the language).
I think this is a great advantage in this era of automatic/AI assisted programming. The fact that the language is very readable also helps for the moments when you need/want to read the code.
Nimony btw is a very cool way to evolve the mainline compiler and looking forward to use this in main Nim (but it is also something nice to experiment with)
raffraffraff 4 hours ago
I thought it would be the opposite, because you can't say: "The AI was trained on a bazillion lines of idiomatic Nim 3 solving a wide range of common problems"
pietroppeter an hour ago
Yep that is the expectation one could have but it is not the experience I (and many others) had.
The explanation I have is that it is so close to pseudocode that it only needs to know just a tiny bit about Nim peculiarities (not too many) to do a good job (plus static types and compiler help a lot).
elcritch an hour ago
tokai 4 hours ago
Ai writes nim pretty well. Its close enough to other languages that llms can manage to write performant code with few issues. There are some gotchas, but the fast compile times and good error messages makes it easy to iterate fast for the bots.
brainwipe 8 hours ago
Hopeful for the new compiler but wished they'd called it Nimoy!
angel- 4 hours ago
Wouldn't stick with the biblical themes
kitd an hour ago
Any recommendations on the best IDE for Nim 3?
jphoward 9 hours ago
I love Nim but my only problem with it previously was support for dictionaries/objects felt really weird? There was some sort of JSON structure as I recall, but it didn't seem anywhere near as easy to use as the analogous structures in Python/JS. Am I misremembering? Has this been improved?
PMunch 7 hours ago
Nim is very strict about types, which is probably what you remember. Things that are typically expressed as a dictionary/object in JavaScript and Python are better represented as a fully typed tree of objects in Nim. The language of course supports the data-structure dictionary/hashmap/table (called Table in Nim) which is "anything hashable" -> "any type" lookup. This is what's used for things like `myTable["hello"] = 5` for storing the number 5 for the key "hello". However because of the strict types you can't mix which types they map to without creating some sort of wrapper type that gives you the alternatives you're allowed to use. Many people reach for Nims JsonNode type to fill this gap for small collections of string/number/array/dictionary since it already is such a wrapper type.
jeremyjh 5 hours ago
I wonder if this is more palatable with first-class sumtypes/ADTs in Nim 3? Or is that already what JsonNode essentially was?
ZoomZoomZoom 9 hours ago
I suspect you're talking about heterogenous containers which are antithetical to a strongly typed language but nevertheless are supported via std/json's JsonNode dynamic data.
In Nim regular hash maps (called tables here) have pretty regular accessors via `[]` `[]=` overloads (`foo["frob"]=42`), plus additional routines such as `.get(otherwise)`.
https://nim-lang.github.io/Nim/tables.html
Don't know why are you conflating objects in your question.
jphoward 8 hours ago
I'm 'conflating' them because they're called objects in javascript, so people unfamiliar with Python know what I mean. Ok thanks.
setr 3 hours ago
netbioserror 4 hours ago
Using Nim in production, AMA.
txdv 4 hours ago
Load, scale?
Biggest pain point? Biggest win?
netbioserror 4 hours ago
It has a scoped responsibility, does mostly compute and data processing. Invoked by a PHP backend, single-threaded, we get parallelism at invocation rather than internally. So we can saturate server threads optionally if we need to.
Biggest win: Single-owner scoped lifetimes by default with no annotations plus expression-oriented value semantics makes it eminently readable. Basically no memory semantics, all business logic. (It does processing of proprietary binary data including a lot of math.) Extraordinarily easy to maintain, refactor, add features. Valgrind confirms no orphaned blocks in some of our biggest test scenarios, it's impressive. Full compile-time evaluation is nice too, easy to slurp a whole file at compile-time and have it accessible in a normal binding, and writing generic procedures is obvious and simple.
Biggest pain point: Hard to say, the only friction I've really ever run into is its weak tooling. I just use Make for build scripting (invoking the compiler directly instead of using Nimble) and Sublime's built-in features for refactoring. It's small enough that print-debugging works, but I occasionally dip into FlameGraph. Nimsuggest has some...dealbreaking quirks, but successors are in the works.
stakhanov 4 hours ago
Are you hiring?
sergiotapia an hour ago
I've always had a soft spot for Nim, never had the chance to use it professionally. I personally can't wait to let it rip with AI. I think this is going to be the perfect language to use with AI. Fast as all holy hell, ergonomic, a language lead who cares deeply and does not quit. Major props to Araq for sticking it through all these years, I hope it's Nim's time to shine finally.
kombine 28 minutes ago
It also seems like he embraced AI, which I find healthy given he wants to compete with established languages.
sergiotapia 9 minutes ago
Araq is pragmatic and very intelligent, I'm not surprised that's his stance.
pjmlp 10 hours ago
Looking interesting, I like the improvements over what Nim used to be.
The big question is naturally the adoption curve, given the breaking changes.
DeathArrow 10 hours ago
It's not a big issue since Nim didn't have a large following. If anything, it might help Nim to take off if it's good enough and user friendly enough.
pjmlp 6 hours ago
Only that the following might become even smaller.
aktenlage 9 hours ago
Does anyone already have experience, how the developer experience is? Error messages, debugging and so on?
anthk 5 hours ago
No i386? We do exist.
drob518 4 hours ago
386 only? You’re very rare indeed these days. Didn’t the Linux kernel also recently move past 386 only systems?
ptx 3 hours ago
There are still 32-bit applications running on 64-bit operating systems which you might want to extend.
anthk 3 hours ago
i686 then.
esafak 4 hours ago
When is 1.0 slated to be released?
jimbob45 9 hours ago
Nim still has the GC, right? It always seemed like a slightly better Golang, much worse Dlang in that respect.
miguel_martin 39 minutes ago
Nim's better than dlang in this respect. Default memory management is similar to C++ and Rust. See https://nim-lang.org/docs/destructors.html
jibalt 9 hours ago
Optionally but not by default ... things have changed a lot:
vips7L 6 hours ago
Reference counting by default is GC.
miguel_martin 30 minutes ago
DeathArrow 10 hours ago
Cool, now we can fight the borrow checker in Nim, too.
suncore 6 hours ago
If I understand correctly, it still does have reference counting so you don't have to fight the borrow checker if you don't want to.
lobf 11 hours ago
Nim is cool, but holy moly this web design is disgusting. Absolute one-shot prompting.
heavensteeth 9 hours ago
<button class="nav-btn" onclick="navigateToPage('index.html')">Home</button>
...
// Navigation functionality
function navigateToPage(filename) {
window.location.href = filename;
}
What shockingly poor code. Just disgraceful.This is bad for accessibility, bad for compatibility, and serves no purpose at all.
arcanemachiner 9 hours ago
Ha, that is bad. This is what happens when you use the cheap LLMs. (At least, I hope Opus 5.5 isn't pulling stunts that are this bad... It's not that bad when I look at my code.)
badsectoracula 10 hours ago
Everyone has a different taste.
Personally i like the site's design, it looks like from late 2000s / early 2010s with its gradient rounded buttons, 1px offsets and chiseled text - i even clicked randomly on buttons because of how "buttony" they look :-P.
IME this isn't what LLMs make by default, so if nothing else, i doubt it was a single prompt and most likely it was adjusted to fit the author's taste (that it sounds like doesn't align with yours).
pietroppeter 7 hours ago
I think there was very little effort put on this specific website. The effort has gone in the compiler itself (and the mainline compiler). Not that it would not benefit for a better website
konart 10 hours ago
idk, looks like a classic design from 2010. See QIP or AIMP Classic.
ilaksh 7 hours ago
It looks good on my phone and everything loads virtually instantly.
It has a clean theme. The only knock I can see is that the buttons are a little retro. But I like them .
Because of how fast every link loads and uncluttered the design is (not a single ad of any sort), I think it's better than 90% of websites.
The fact that your fashion sense weighs other trend aesthetics so much over those things..
gsoff 7 hours ago
border-left: 3px solid color...;
this gives the design a cheap ai-template vibe
asibahi 10 hours ago
Not everything you dont like is LLM-made.
xx_ns 8 hours ago
No, but this definitely is. https://github.com/nim-lang/nimony-website/commits/master/
brianush1 10 hours ago
it's definitely LLM-made (if you look at the CSS, there's LLM-written comments) but it doesn't look like a one-shot prompt
pjmlp 10 hours ago
lcnmrn 4 hours ago
This feels archaic to me after seeing what is possible with Stricta. You get full Python syntax as low level as possible, safe, strict, no ARC/GC, memory access. https://github.com/lucianmarin/stricta
mirrir 4 hours ago
yes but that's your own project. its odd to not disclose that while calling other's work archaic.
platinumrad 4 hours ago
> Rust-Style Memory Safety (No GC / No ARC): Compile-time ownership and borrow checking with inferred BORROW / MUT_BORROW / MOVE parameter modes, non-lexical lifetimes (NLL), monomorphized deterministic @_drop_T / @_clone_T generation, compiler-lowered { i1, T } exception propagation, and runtime bounds traps—with zero garbage collection or reference counting overhead.
There is either a catch here or you(r LLM) has solved multiple open research problems.
lcnmrn 3 hours ago
Get the code and ask your LLM if it did, otherwise provide an edge case to be fixed.
fishgoesblub 3 hours ago
> All Rights Reserved
No thanks.