News for hackers. Stuff that matters.
Re:Friendship ended with the garbage collector by winrid on Friday August 27, 2021 @03:01AM (#28325096)
I've been impressed by nim's GC. My understanding is it's not super complicated. Not having a big header on each object and having each thread have its own GC goes a long way.
Re:Friendship ended with the garbage collector by mojuba on Friday August 27, 2021 @03:25AM (#28325216)
What happens to objects shared between threads then?
Re:Friendship ended with the garbage collector by elcritch on Friday August 27, 2021 @03:54AM (#28325351)
It depends on the GC you're using with Nim. Guessing the OP means the newer ARC GC, then you can use `move` semantics to move some data to another thread, or you can do a deepCopy. You can do shared data structures but that requires a bit more work.
Re:Friendship ended with the garbage collector by winrid on Friday August 27, 2021 @06:32PM (#28333661)
It becomes more difficult. There are a few supported memory managers by Nim (including Go's GC!), but with ARC you explicitly move or deep copy the structure.

Obviously this is a bit more difficult than say Java, but then you never have to stop the world.