Hacker News new | past | comments | ask | show | jobs | submit login

The GC needs to mess with and start and stop and throttle threads. The threads resize their stacks and that needs to talk to the GC. System calls park and restart threads. And so forth.

If you use any of it you'd need all of it.




Yes, the idea is if you want to use X (e.g. the GC), it comes with the binary. Otherwise exclude it.

I'm proposing splitting the functional blocks into distinct pieces and including only what is actually needed in the final binary.

For the case of the GC, if your go program somehow avoids all allocations (wtf??? Empty main perhaps - a seemingly stupid case), perhaps it could be excluded.


Yes, I understand the idea, the point I'm making is that the runtime is a monolith, it can't be split because each piece has necessary and irreducible connections to the other pieces.


Ah, gotcha. Thanks for patiently clarifying :)


Here’s the classic story of when code can live without GC: https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98...

A very basic “Hello world” could also be GC-less and just let the OS reclaim all memory when it terminates.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: