Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> runtime ... GC ... not viable as systems programming language

A GC can work fine. At the lower levels, people want to save every flop, but at the higher levels uncounted millions are wasted by JS, Electron apps etc. etc. We can sacrifice a little on the bottom (in the kernel) for great comfort, without a difference. But you don't even have to make sacrifices. A high performance kernel only needs to allocate at startup, without freeing memory, allowing you to e.g. skip GC completely (turn it off with a compiler flag). This does require the kernel to implement specific optimizations though, which aren't typically party to a language spec.

Anyway, some OS implemented with a GC: Oberon/Bluebottle (the Oberon language was designed specifically to implement the Oberon OS), JavaOS, JX, JNode, Smalltalk (was the OS for the first Smalltalk systems), Lisp in old Lisp machines... Interval Research even worked on a real time OS written in Smalltalk.

Indeed, GC can work in hard real time systems e.g. the Aonix PERC Ultra, embedded real time Java for missile control (but Go's current runtime' GC stops are unpredictable....)

Particularly when we consider modern hardware problems (basic OS research already basically stopped in the 90s, yay risc processor design...), with minimal hardware support for high speed context switching because of processor speed vs. memory access latency... Well, it's not like we can utilize such minuscule operations anyway. Why don't we just have sensible processors which don't encourage us to unroll loops, which have die space to store context...

There were Java processors [2] which implement the JVM in hardware, with Java bytecode as machine code. Before llvm gained dominance, there were processors optimized to many languages (even Forths!)

David Chisnell, a RTOS and FreeBSD contributor recently went into quite a bit of depth [1] ending with:

> everything that isn’t an allocator, a context-switch routine, or an ISR, can be written in a fully type-safe GC’d language

[1] https://lobste.rs/s/e6tz0r/memory_safety_is_red_herring#c_gf...

[2] https://www.electronicdesign.com/technologies/embedded/artic...



The nice thing about Java is you can choose which GC to use


Not only the GC, the JIT compiler, the AOT compiler, the full implementation even.




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

Search: