198 points · by Fervicus · 2w ago · 118 comments
Thanks, Andreas Rumpf, for sticking with it for all these years: This seems like a great opportunity for me to get back into nim.
I've never been too annoyed by Nim's approach but I think this removes a complaint many people have.
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.
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.
The modern embedded devices that still only get Assembly and C toolchains are like PIC class devices.
https://medium.com/@s.quddin/nim-3-0-a-deep-dive-into-the-ne...
Nimony plans multiple backend targets, reflecting Nim’s philosophy of not being tied to a single code generation strategy:
NIFC to C Translator: This is close to being production-ready. It even generates makefiles. For a language that has historically compiled to C, this ensures backward compatibility and continued access to GCC/Clang’s optimization pipelines.
NIFC to LLVM Translator: Planned for future releases. This would enable Nim to benefit from LLVM’s extensive optimization infrastructure and target WebAssembly.
NIFC to Native Code Translator: [...]
Sum-types, borrow-checking... Nim 3 is beautiful.
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)
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).
Planetis also provides commercial skills experimentally verified to work with Claude/Codex/etc models for a small monthly fee!
So it's not really Nim's characteristic to make working with arbitrary JSON (heterogeneous collections more generally) "unpalatable" - it's common to (almost) all statically typed languages. While Nim looks a lot like a scripting language, it really isn't. It can be used as one, and it's much better for that than C, but it's better used for apps and systems programming than for scripting, like all the other languages in its class (ie. Go, Crystal, OCaml; Rust and Java are also close).
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.
So it’s really the case that JS conflates objects/dictionaries, so only people familiar with only JS would know what you mean
Edit: actually thinking about it, I’m fairly positive python also models objects as dictionaries; it just puts more effort into hiding it
Biggest pain point? Biggest win?
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.
The first thing I evaluate in a language is how it looks like in production code, and the samples in github strikes me odd -- like most of the code identation is 2-space and no line break between variable declaration and other groups of statement (everything is lumped together).
Just check https://github.com/WyattBlue/auto-editor/blob/master/src/wav... to have an idea of what I'm talking about. Is that how normal nim code supposed to look like? (following its best practices)
Here's an example in a popular Python library that feels stylistically similar to the one you gave: https://github.com/pallets/flask/blob/main/src/flask/app.py#...
> Here's an example in a popular Python library that feels stylistically similar to the one you gave: https://github.com/pallets/flask/blob/main/src/flask/app.py#...
Tbh, the example code you gave me is much more tidied up with clear separation between logical groups of statement and some comments sprawled around to guide on the control flow.
Personally I tend to abuse UFCS, but I use the same style (maybe more breaks).
The big question is naturally the adoption curve, given the breaking changes.
In Comparison, traditional GCs like JVM runs on a background thread, it's hard to determine when they run and generally blocks the whole program while collecting (stop-the-world).
So at least they are a little better in that regard?
type
RefObj = ref object
foo: string
bar: int
ValueObj = object
foo: string
bar: int
`RefObj` is ref counted equivalent to a shared_ptr in C++ land (non-atomic counter unless using --mm:atomicArc or Nim3/Nimony has this as a default I believe). `ValueObj` is equivalent to struct in C, C++, etc. <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.
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).
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..
this gives the design a cheap ai-template vibe
Just like when HTML templates started to be a business all websites looked the same.
There is either a catch here or you(r LLM) has solved multiple open research problems.
Your desing of generic instantiation is just a compile time pit. You don't constraint type so you need to check the body of every instance
You have NLL yeah, but not partial borrows nor the capacity for a proc to return one of it's parameters (the famous example
```rs
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { if x.len() > y.len() { x } else { y } }
```
since you don't have lifetimes, either you refuse this case or it's a bug if you do a copy then your language asks it's user to use value semantics
But if your language mostly push users to value semantics (a.k.a copying tons of things) then why all the borrow stuff ? If there is no lifetime how is one suposed to store references ? why is there a ref, ref_mut type ?
Those are overly convoluted choices for a value based language So it's a bit of an incoherence
Next there is the way you handle indexing your spec state that undecided index access generate stricta_bounds_fail, but this function just output an error and exit the process, it doesn't insert a runtime check
So undecided index access act as nuke in the codebase, the users is not even aware that one of it's access is undecided, and when he expect it the less he just get the process stopped, no exceptions, just a crash
Then you don't even correctly handle cyclic data type structure, you defined in the codebase an arbitrary depth of 16 instead of checking type cycle (and what you stated in your spec just worked auto referencing types like type A with a field of type A again
Finally I don't understand whant Stricta is supposed to achieve. Is it a stricter python ? If it's the case then why doesn't talk about compatibility ? why does it diverge from python on the semantic side ? If it's just python like... then why the pythonish choices ? like hardcoded python types and OOP ?
```python def head(xs: list[int]) -> ref[int]: return xs[0].ref
def main() -> None: xs = [10, 20, 30] r = head(xs) del xs print(val(r))
main() ```
Stricta accepts this program. Valgrind then reports:
```text Invalid read of size 8 Address ... is 0 bytes inside a block of size 32 free'd ```
The generated code frees xs before dereferencing r.
The root cause is missing interprocedural lifetime tracking:
- The spec says safe references cannot outlive their owner (SPEC.md lines 46–55 (https://github.com/lucianmarin/stricta/blob/499504177687ef0a...)). - Returning a reference into a parameter is explicitly supported and tested (test_pointers.str lines 58–62 (https://github.com/lucianmarin/stricta/blob/499504177687ef0a...)). - The return checker allows parameter-derived references because it only rejects references classified as borrowing local stack storage (stricta.c lines 7429–7480 (https://github.com/lucianmarin/stricta/blob/499504177687ef0a...)). - At the caller, a function call returning ref[T] is not associated with the argument owner; borrow assignments only recognize direct .ref expressions and reference-variable copies (stricta.c lines 7911–7922 (https://github.com/lucianmarin/stricta/blob/499504177687ef0a...)).
As a control, writing r = xs[0].ref directly causes the compiler to reject del xs with cannot mutate 'xs' while it is borrowed. The hole is specifically across the call boundary.
So: no open research problem was solved here. Parameter modes are insufficient; returned references need lifetime/region relationships equivalent to Rust’s:
```rust fn head<'a>(xs: &'a [i64]) -> &'a i64 ```
Until those constraints propagate through calls, the “Rust-style memory safety” claim is false.
No thanks.