HACKER Q&A
📣 agomez314

Operating Systems built with functional languages?


It seems that many OS are built with c, c++, etc. but are there any built using functional, interactive languages like Lisp or Haskell? Wouldn't there be many advantages of having an OS built on a functional language that you can interact with and introspect (perhaps reflect) at runtime?


  👤 jonjacky Accepted Answer ✓
Haskell: https://en.wikipedia.org/wiki/House_(operating_system)

Haskell: https://github.com/GaloisInc/HaLVM

OCaml: https://mirage.io/

ML: http://dspace.mit.edu/handle/1721.1/47545

Lisp: In the 1970s and 1980s there were Lisp Machines with the OS written in Lisp. Too many sources to link here, they are often discussed on HN. They were marketed in the 1980s by Symbolics, LMI, and Xerox.

Also in the 1970s and 1980s there were computers running Smalltalk standalone - in effect, an OS in Smalltalk. They provided introspection.


👤 weatherlight
If I'm not mistaken, the Erlang Run Time System (BEAMVM) is basically an operating system, in itself, written mostly in a subset of Erlang and C/C++.

👤 nequo
Check out this interview with Anil Madhavapeddy about MirageOS among other things:

https://signalsandthreads.com/what-is-an-operating-system/

As sibling mentioned, MirageOS is written in OCaml. It aims to provide a robust system by being type and memory safe and by limiting the OS to the minimum that can still host the program that you want to run with it.



👤 pamoroso
Pretty much all the operating systems of Lisp Machines such as Genera, which shipped with Symbolics' Lisp Machines.