Oberon Operating System
When people ask "how would you write an operating system without C?", Oberon is what I point them to.  It's a very different style than Unix, in that the Oberon language is a relatively integrated part of the operating system, rather than communication being through a machine-level ABI.  There were some spiritual predecessors where the compiler <i>itself</i> was part of the OS, and there was no other way to communicate with it than through the language semantics.  I'm not completely sure whether Oberon works like that, but some Concurrent Pascal systems did.  It's a very different view of what an "operating system" means.<p>Anyway, Oberon is a memory-safe and garbage-collected language without the pointer trickery that makes C so dangerous.  So how does Oberon implement the necessary low-level parts?  Fortunately, some version of the source is easily browsable online: <a href="https://people.inf.ethz.ch/wirth/ProjectOberon/index.html" rel="nofollow">https://people.inf.ethz.ch/wirth/ProjectOberon/index.html</a><p>Here is for example Kernel.Mod: <a href="https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kernel.Mod.txt" rel="nofollow">https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/Kerne...</a><p>Low-level operations are done with magical functions that simply perform an operation on a memory address identified with an integer, e.g. `SYSTEM.PUT(q0+8, q1)`.  These are then presumably handled directly by the compiler (the System.Mod file does not define any PUT function).  This is syntactically more awkward than the equivalent in C (`q0[2] = q1`, assuming this is an `int` pointer), but perhaps things that are unchecked and potentially dangerous <i>should</i> be syntactically awkward.  It's not like a lot of code will be written using these facilities.