When i first moved to Nim it offered automatic memory management at near C speed, or something like that, IIRC. Now, it seems Nim moved from ORC to ARC, {.gcsafe.} was added, and now we're talking about a (cleaner) version of Rust's borrow checking and lifetimes, which might be good, but is not "hands/brain-free AutoMem mode". I also see the home page for nim-lang says "deterministic and customizable with destructors and move semantics, inspired by C++ and Rust", instead of "Auto memory management with almost no performance penalty.", or similar.
Is this not a goal anymore? If not, what are the tradeoffs being made here? Better compile speed and easier/more productive Nim lang dev, with safety-ensured manual memory management-enjoying Nim users still happy, and users who want AutoMem For Dummies can go elsewhere, and likely pay the performance/predictability penalty?
Thanks
but is not "hands/brain-free AutoMem mode".
There is no such mode. Not even in Python:
d = {"a": 1, "b": 2, "c": 3}
for key in d:
print("Visiting:", key)
if key == "b":
# This will cause: RuntimeError: dictionary changed size during iteration
del d["a"]
and users who want AutoMem For Dummies can go elsewhere, and likely pay the performance/predictability penalty?
Again, there is no such mode.
We want to detect "resize during iteration" and fix a couple of loopholes in our "safe" systems programming language. It's a clean evolution of the language and the mechanism does not work like in Rust, but of course, no matter how often I will say this, somebody will be afraid anyway. C# has a borrow-checking mechanism and most C# programmers do not even know. That's what I'm after, so relax.
From what I understood from Araq's reply on the topic, and the idea being taken forward in Nimony, this will be an opt-in add-on to ARC/ORC for explicit comptime safety. Basically ORC is already neat and highly efficient. The new proposal is much better than how Rust has gone about it, and is meant to prove memory safety for deterministic bare metal code, and tell the compiler that a block of code will not result in memory errors or races, which is guaranteed at compile time - useful for auditability and enforcing safety guarantees in hard real-time systems. It will not replace ARC/ORC. One can incrementally add "provable" comptime safety. That's my read on it.
Reg what's said on the website, it is basically saying Nim has better RAII and move semantics than what C++ and Rust can offer, with very high performance reference counting.