News for hackers. Stuff that matters.
Re:Hobby x86 kernel written with Zig by Touche on Monday January 06, 2020 @11:49AM (#21970609)
Does the standard library use malloc/free or does it depend on the GC? This is the part that's puzzling to me, if the stdlib depends on GC then it's harder to say that GC is optional. Technically optional but not super practical.
Re:Hobby x86 kernel written with Zig by nimmer on Monday January 06, 2020 @02:07PM (#21972040)
The majority of stdlib modules does not depend on GC.

Also, the new ARC memory manager replaces GC and can run in a kernel.

Re:Hobby x86 kernel written with Zig by mratsim on Monday January 06, 2020 @03:48PM (#21973129)
No that's not true.

As soon as you use sequences or strings or async you depend on the GC.

You can however compile with gc:destructors or gc:arc so that those are managed by RAII.

Re:Hobby x86 kernel written with Zig by nimmer on Monday January 06, 2020 @06:28PM (#21974729)
I used various modules with gc:none

I meant that new ARC GC, that will replace the current one, can be used for the kernel.

It's still a GC, technically, but, quoting Araq on ARC:

Nim is getting the "one GC to rule them all". However calling it a GC doesn't do it justice, it's plain old reference counting with optimizations thanks to move semantics.