3 ms·
Well, it'd be OCaml without a garbage collector. And to be honest, that would be a very useful and handy language for systems development.
by cmrdporcupine 7y ago
Well, it'd be OCaml without a garbage collector. And to be honest, that would be a very useful and handy language for systems development.
- masklinn 7y agoOCaml has for and while loops. Its for loop is even more imperative than Rust's (which simply drives an iterator, whereas OCaml's has "for a to b" and "for b downto a"). OCaml doesn't have break or continue though.
- lmm 7y agoOCaml is already a good language for systems development - people are far too scared of garbage collectors. And if you make the changes in the article then I think you give up most of the concrete benefits of non-GC - you won't have easy C interop without control of stack/heap/allocation, and since trait objects could end up nested arbitrarily far, I think you might still get GC-like pauses where a simple-looking code line ended up doing an arbitrary amount of unwrapping and freeing work.
- cmrdporcupine 7y agoI guess it depends on your definition of systems development. If you mean "writing systemsy applications" like IoT things or whatever, sure, fine, a GC isn't going to be an issue and probably will help. If you're talking about a language to write drivers or an operating system, etc in then a GC is just a big No. In that domain we don't even have Malloc/Free, let alone GC services. Having the overhead and normative lifestyle assumptions of _any_ kind of runtime is a big Nope.
- wiml 7y agoMirage exists and works reasonably well.
- atombender 7y agoCounterpoint: The Oberon System successfully implemented a garbage-collected OS kernel: https://en.wikipedia.org/wiki/Oberon_(operating_system) https://en.wikipedia.org/wiki/Oberon_(operating_system).