Remix.run Logo
▲ Nimony: A New Compiler for Nim(nimony.org)
111 points by Fervicus 2 days ago | 42 comments
▲afavour 7 minutes ago | parent | next [-]

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.

▲netbioserror a minute ago | parent | prev | next [-]

Using Nim in production, AMA.

▲stakhanov 4 hours ago | parent | prev | next [-]

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.

▲girvo 3 hours ago | parent | prev | next [-]

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!

▲eterps 2 hours ago | parent | prev | next [-]

Nice, it looks like it supports option and result types as well:

- https://nimony.org/stdlib/std/result.html

- https://nimony.org/stdlib/std/options.html

▲polotics 7 hours ago | parent | prev | next [-]

This is great! Congrats to the Nim team for keeping the pedal to the metal!

Sum-types, borrow-checking... Nim 3 is beautiful.

▲ZoomZoomZoom 4 hours ago | parent [-]

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 2 hours ago | parent | next [-]

Is this a Python 2/3 situation?

▲christophilus an hour ago | parent [-]

Might be, but Nim is statically typed, and we have LLMs now, so migration should be pretty trivial, is my guess.

▲torginus 3 minutes ago | parent | next [-]

I'm not a Python guy, but my understanding was that the reason why Python 2 stuck around for so long was that some people preferred it over 3

▲pjmlp 32 minutes ago | parent | prev [-]

Speaking from the stand of Java and .NET breaking changes, it is not, some folks will cling to the old world no matter what.

Check how many deployments (products even) are still being done in Java 8, or .NET Framework.

▲simlevesque 10 minutes ago | parent [-]

Nim 2 isn't as popular or ingrained as Java 8 or .NET Framework.

▲brabel 2 hours ago | parent | prev [-]

How does this differ from this new compiler?

▲jphoward 5 hours ago | parent | prev | next [-]

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 3 hours ago | parent | next [-]

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 an hour ago | parent [-]

I wonder if this is more palatable with first-class sumtypes/ADTs in Nim 3? Or is that already what JsonNode essentially was?

▲ZoomZoomZoom 4 hours ago | parent | prev [-]

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 4 hours ago | parent [-]

I'm 'conflating' them because they're called objects in javascript, so people unfamiliar with Python know what I mean. Ok thanks.

▲brainwipe 4 hours ago | parent | prev | next [-]

Hopeful for the new compiler but wished they'd called it Nimoy!

▲pietroppeter 2 hours ago | parent | prev | next [-]

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)

▲aktenlage 5 hours ago | parent | prev | next [-]

Does anyone already have experience, how the developer experience is? Error messages, debugging and so on?

▲pjmlp 6 hours ago | parent | prev | next [-]

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 5 hours ago | parent [-]

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 2 hours ago | parent [-]

Only that the following might become even smaller.

▲anthk 34 minutes ago | parent | prev | next [-]

No i386? We do exist.

▲jimbob45 5 hours ago | parent | prev | next [-]

Nim still has the GC, right? It always seemed like a slightly better Golang, much worse Dlang in that respect.

▲jibalt 5 hours ago | parent [-]

Optionally but not by default ... things have changed a lot:

https://nim-lang.org/docs/mm.html

▲vips7L an hour ago | parent [-]

Reference counting by default is GC.

▲DeathArrow 5 hours ago | parent | prev | next [-]

Cool, now we can fight the borrow checker in Nim, too.

▲suncore an hour ago | parent [-]

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 6 hours ago | parent | prev [-]

Nim is cool, but holy moly this web design is disgusting. Absolute one-shot prompting.

▲heavensteeth 5 hours ago | parent | next [-]

   <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 4 hours ago | parent [-]

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 5 hours ago | parent | prev | next [-]

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 2 hours ago | parent | prev | next [-]

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 5 hours ago | parent | prev | next [-]

idk, looks like a classic design from 2010. See QIP or AIMP Classic.

▲ilaksh 3 hours ago | parent | prev | next [-]

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 3 hours ago | parent | prev | next [-]

border-left: 3px solid color...;

this gives the design a cheap ai-template vibe

▲asibahi 6 hours ago | parent | prev [-]

Not everything you dont like is LLM-made.

▲xx_ns 4 hours ago | parent | next [-]

No, but this definitely is. https://github.com/nim-lang/nimony-website/commits/master/

▲brianush1 6 hours ago | parent | prev [-]

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 6 hours ago | parent [-]

Nowadays the brown background Claude design is everywhere, at least this one is somehow different.

Just like when HTML templates started to be a business all websites looked the same.