diff --git a/jekyll/_posts/2025-11-01-nimony-v0-2.md b/jekyll/_posts/2025-11-01-nimony-v0-2.md new file mode 100644 index 00000000..00740eef --- /dev/null +++ b/jekyll/_posts/2025-11-01-nimony-v0-2.md @@ -0,0 +1,58 @@ +--- +title: "Nimony v0.2 — early preview of Nim 3.0's compiler" +author: "planetis" +--- + +Greetings, Nim community! + +What it is: Nimony is a new compiler for a Nim variant aimed at becoming Nim 3.0 over time. The current focus is the Aufbruch mode: destructor-based memory management (ARC), value-centric semantics, predictable code generation, and a plugin-based metaprogramming model. + +This is our first release, version 0.2, which provides a working core for basic programs. It’s an early preview, not a complete language, and targets developers interested in testing the fundamentals. + +This time, I (planetis) was tasked with providing a review of the current state of Nimony as of 30 October 2025. We thought an honest opinion is better than a generic enthusiastic release announcement. + +For this purpose, I wrote a simple UI program: in about 250 lines of code, we have a Tic‑Tac‑Toe game with an AI running in a worker thread—showing what’s already possible. You can get it [here](https://gist.github.com/planetis-m/ac2274cc63f6526784bb36c4952a76cd). It uses the raylib library for graphics. + +

+ Nimony v0.2 TicTacToe demo +

+ +And indeed, quite a few modules from the standard library have already been ported, though some not in their entirety: tables, hashes, intsets, parseopt, paths, dirs, unicode, encodings, monotimes, locks, rawthreads, syncio, setutils, strutils, parseutils, envvars, cmdline, memfiles, math. Together they give you a well‑rounded set of functionality to start writing programs in Nimony. + +Surprisingly, a lot of language features already work. For example, besides the usual imperative style most Nim programs follow, methods and dynamic polymorphism worked. I encountered a single compiler crash related to inheritance; ringabout fixed it the same day. This shows how eager the Nim compiler developers are to ship the next generation of Nim ASAP—so help them out by reporting bugs. + +Nimony does seem to struggle with type resolution. “Error: type mismatch: got: X but wanted: Y” is the most common issue I encountered—sometimes X and Y are just auto or seq. By itself, this message doesn’t provide enough information beyond the line number. Nevertheless, it hasn’t blocked me from writing working Nimony programs. + +Notably, case-insensitive identifiers are [missing](https://github.com/nim-lang/nimony/issues/1478), which I noticed due to the odd capitalization of the AST node kinds (e.g., CallstrlitS, StaticstmtS). At this point, the debate doesn’t matter much to me—as long as I get my copy of “Learn Nim the HARD WAY” from [Zed Shaw](https://github.com/nim-lang/RFCs/issues/456#issuecomment-1115452565). + +It’s also worth talking about my experience using AI chatbots while writing code. For my experiments, I needed to know what’s currently possible with Nimony, so I pasted Araq’s progress reports into GPT5‑high and got a table of [what works](https://gist.github.com/planetis-m/7a8e4dc26dca95ec9309515c7a0e0786#file-what_works-md). I used that as context to decide what to test next. + +From all the experiments I made, certain templates and complex constants stood out as not working. For the latter, though, Nimony plugins seem to be a [solid alternative](https://gist.github.com/planetis-m/ef5baf6ae8fabcfc503d8e5fae271c1e#file-poplut-nim), with a pleasant and minimalistic tree‑construction API. + +When my code had errors, I took the opportunity to evaluate how different LLMs understand Nim, and they did well. Having the hyped “AI agents” understand Nim is important for adoption. + +At that point, I concluded my testing. If I had more time, I’d try to create a minimal example for the ESP32—let’s keep that promise for the next release. + +Overall, I think Nimony v0.2 is a bold step forward—building on solid ideas from Nim’s development and a new, interesting compiler architecture—and I hope it gains more traction. It certainly deserves it. + +If you have time, try things out, report bugs, ask questions, and send PRs—every bit of feedback helps shape the direction. + +Prebuilt packages (x86, arm64): +- Fedora: https://copr.fedorainfracloud.org/coprs/planetis/nim/builds/ +- Ubuntu: https://launchpad.net/~planetis/+archive/ubuntu/nim/+packages + +On other platforms, build and install Nimony from source: + +Clone the repository: +``` +git clone https://github.com/nim-lang/nimony.git +cd nimony +git checkout v0.2.0 +``` + +Build using the `hastur` tool (requires an existing Nim installation): +``` +nim c -r src/hastur build all +``` + +If your time is scarce but you want this direction to continue, contributions are welcome via our Open Collective: https://opencollective.com/nim. diff --git a/jekyll/assets/news/images/nimony-v0.2/nimony-v0.2-screencast.gif b/jekyll/assets/news/images/nimony-v0.2/nimony-v0.2-screencast.gif new file mode 100644 index 00000000..46c63d1d Binary files /dev/null and b/jekyll/assets/news/images/nimony-v0.2/nimony-v0.2-screencast.gif differ