News for hackers. Stuff that matters.
Re:NimConf 2022 – Nim Online Conference by Symmetry on Friday October 21, 2022 @10:47AM (#33288543)
I've only used Nim but generally if you can use a garbage collected language you should in most cases but there are many cases where you can't, reasonably, and so we have languages like Zig, Rust, C, etc. Unless you're going to be doing something very sensitive to performance to the extent that you were going to be thinking carefully about memory lifetimes anyways.
Re:NimConf 2022 – Nim Online Conference by http-418 on Friday October 21, 2022 @11:58AM (#33289448)
TIL about Zig. It looks like it's been released a while ago (2016) but when I searched for how they handle concurrency all I could find was it's still in the research phase :(. I thought I was going to be able to find at least a design document like with Swift:

https://gist.github.com/lattner/31ed37682ef1576b16bca1432ea9...

Re:NimConf 2022 – Nim Online Conference by goodpoint on Friday October 21, 2022 @12:10PM (#33289608)
> if you can use a garbage collected language

With ARC there's no GC runtime anymore, making Nim a competitor with Rust.

Re:NimConf 2022 – Nim Online Conference by timeon on Friday October 21, 2022 @05:29PM (#33293245)
Do you mean with Rust's Rc or Arc?
Re:NimConf 2022 – Nim Online Conference by generichuman on Friday October 21, 2022 @08:54PM (#33294581)
Re:NimConf 2022 – Nim Online Conference by k__ on Friday October 21, 2022 @11:18AM (#33288903)
Isn't the GC of Nim optional?
Re:NimConf 2022 – Nim Online Conference by spijdar on Friday October 21, 2022 @11:35AM (#33289117)
Optional, though the language and standard library are kind of designed around it. So I'd say Nim can be used without the GC, but is optimized with the idea that you'll use the GC by default, with escape hatches for manual allocation when you need the power for performance or efficiency, e.g. manually managing big blocks of memory for tight loops.

Contrast to a language like Zig, which has a standard library and syntax built around the idea of manual allocators and what not, but is missing the "ease of use" of GC. Personally, I agree with GP, and like Nim's compromise of GC with a "I know better, let me do it manually" syntax, but there are domains where you want a language like Zig.

Re:NimConf 2022 – Nim Online Conference by auxym on Friday October 21, 2022 @11:48AM (#33289305)
Correct. I'd add that with ARC (or ORC even), there's little reason to do manual memory management (alloc/free), even for embedded systems. ARC is an automatic memory management system based on reference counting, but there's no "runtime". It actually injects alloc and free calls at compile-time based on static analysis.

ORC adds runtime GC only for cycles, and will be the default in Nim 2.0.

Re:NimConf 2022 – Nim Online Conference by ilaksh on Sunday October 23, 2022 @06:22AM (#33305881)
You're information seems to be dated by the presentation.