I have found many sites discussing various projects to build a full operating system in haskell. All of them seem to be a good decade old. This indicates that there was definite interest in this at one time, but that it either didn’t catch on, or the projects went either classified, or people just stopped sharing them.
I am currently trying to figure out what “the best” operating system would be, how it would be built. I am currently learning plan9, and oberon is interesting for minimalism. Rust is making plenty of noise. All these things being the case, the lack of a haskell os is intreaguing. So.. is it a fundamentally bad idea for some reason, of is the haskell learning curve sufficiently steep as to prevent such a thing? Or something else? Ocaml has mirage.. I’m sure I’m missing things I’ve found..
..ok.. another internet search just turned up what -looks- like pure gold: Writing an OS in Haskell - agniv sarkar don’t ask me how .. this is my search, in duck-duck-go: “operating system written in haskell raspberri pi” don’t know if it’ll give others the same results.. and yes, if you ask if I’m qualified to judge the value of such a thing, I’ll either laugh in your face, or run for the hills.
I feel like adding that Haskell has been on my radar for at most like two days. Not strictly true, I at least knew it existed, enough to search for it, but it was at most a distant curiosity. Not sure why I’m making such a big deal of that, but I really feel like I’ve para-trooped onto an alien planet. I said the exact same thing when I started exploring OpenBSD. -_-
From my somewhat uninformed perspective, building an OS requires caring about low-level details a lot. The beauty of Haskell (for me) is that the compiler does its magic and translates my elegant code to the ugly details of registers and memory addresses. You can of course do low-level memory operations with Haskell, but I’d imagine it would end up being C code with Haskell syntax.
I’d also imagine OSes would want to be precise about its memory usage and Haskell (GHC) is less precise.
Instead of porting the whole runtime system to bare metal, an interesting (and perhaps more promising) approach would be to use staged programming, i.e. Haskell for codegen.
Indeed. I am writing memalloc because I want to be let go of C and write the same low-level code in Haskell. I hate having to choose between the two; Haskell’s prowess should be applied to its own runtime. C can be a monad, its just three assembly opcodes in a trenchcoat anyway.
oh, wow! thank you! (and everybody else as well!) your confidence and sense of personal clarity are much appreciated! they make me realize the full extent to which I really wasn’t actually sure if this was a good idea.
could you, pretty-please, explain this in more detail?
“just three assembly opcodes in a trenchcoat anyway.”
..maybe when I learn what a monad is, when I’ve put some serious time into studying haskell, it will all make sense.. ..better yet, when I’ve learned enough about the c-compiler to.. it sounds like you’re saying that c basically compresses assembly by about a factor of 3..
Oh that just meant that C is so barebones it barely counts as a proper language these days. Like 3 kids stacked in a trenchcoat pretending to be an adult, C is just a thin fig leaf for hiding assembly It doesn’t even have proper strings. But if you want to talk about raw memory, C is great. So I’m working to make Haskell great in that way too.