5 ms·
> Lisp is a bad language to write an OS in Beg to differ. Lisp machines were huge, back in the day, and there are still hobbyist projects like https://github.
by earenndil 7y ago
> Lisp is a bad language to write an OS in
Beg to differ. Lisp machines were huge, back in the day, and there are still hobbyist projects like https://github.com/froggey/Mezzano https://github.com/froggey/Mezzano
- shadowgovt 7y ago> and there are still hobbyist projects Given that it's been decades, I think it may be safe to say "If Lisp were a good language to write an OS in, we'd see more than hobbyist projects and the Lisp machine companies would still be offering them." (The need for garbage collection caused a bit of a stumble for the Lisp machines on the market, if I recall correctly).
- AnimalMuppet 7y ago"It was done at least once" != "it was a good choice", though. There's a reason why most OSes are not written in Lisp, and it's not because the OS writers aren't smart enough to learn Lisp. It's not because they don't know it exists. It's because there are better languages to write an OS in.
- deleted 7y ago[deleted]
- kazinator 7y agoWriting an OS in Lisp basically means adapting or developing, and then growing, a Lisp implementation on the bare hardware. Someone would only do this if they are simultaneously interested in OS research R&D and Lisp implementation R&D. This is different from someone working on an OS in, say, C. They just pick some C compiler and use it, without becoming a C researcher and implementor. (They might bemoan some things happening in the development of the compiler they are using that affect their work, but not actually take that on.)
- AnimalMuppet 7y agoI'm not sure I agree with this. How much assembly would you actually have to write to bootstrap a Lisp? If I understand correctly, not much. And you could cross-compile from some other platform for as long as needed as you use the Lisp to write the OS.
- kazinator 7y agoCross-compiling from another platform (say, SBCL) only brings to your target whatever you have written yourself, not any attributes of that platform (say, SBCL). You don't magically get SBCL's reader, garbage collector, hash table implementation, object system ... or anything else you might want in the OS. (You could fork that system though to borrow those things instead of doing it from scratch.)
- AnimalMuppet 7y agoWhy not, if I can get the basics of Lisp running, and those other things are written in Lisp? Isn't the hash table implementation written in Lisp? Or are you saying that I wouldn't automatically have the source for those things? If so, then... yeah, I was kind of assuming that I would have it. If the licenses don't work that way, or if the source simply wasn't available, then my devious plan would not work.
- earenndil 7y agoI think it's pretty obviously wrong to say that a language is unpopular (for a task) because it isn't good (at that task). Otherwise no one would be using java, javascript, or c++; and lisp and haskell would be a lot better used. OSes aren't written in lisp because lisp isn't terribly popular, and subset of lisp programmers who are interested in OSes is pretty small--this is a much more interesting factor to look at than subset of OS programmers who are interested in lisp.
- AnimalMuppet 7y ago> I think it's pretty obviously wrong to say that a language is unpopular (for a task) because it isn't good (at that task). Otherwise no one would be using java, javascript, or c++; and lisp and haskell would be a lot better used. I think you are confusing "languages that are good" with "languages that you think should be good". I will admit that there are a fair number of programmers that are fashion-following zombies, but there are a large number who are not easily led by the crowd. If Lisp and Haskell were better suited for the bulk of real-world programming, they would be better used. (The alternative - that you're one of the enlightened few, and almost everyone else is a mindless sheep - may feel satisfying, but the very degree to which it is satisfying should make you more wary of accepting it as truth.) > OSes aren't written in lisp because lisp isn't terribly popular, and subset of lisp programmers who are interested in OSes is pretty small--this is a much more interesting factor to look at than subset of OS programmers who are interested in lisp. OS programmers in particular are not among those easily led by fashion. If Lisp gave them a real advantage, some of them would use it. ("Some" meaning "more than just Lisp Machines way back in the day".)
- earenndil 7y ago> I will admit that there are a fair number of programmers that are fashion-following zombies, but there are a large number who are not easily led by the crowd Perhaps not, but they are led by money. No one is hiring lisp programmers. > The alternative - that you're one of the enlightened few, and almost everyone else is a mindless sheep - may feel satisfying, but the very degree to which it is satisfying should make you more wary of accepting it as truth. I should hope that's not how I come off. My meaning was more that which languages are popular is more a result of inertia than anything. My impression from reading internet forums is that most people who use java and javascript are unhappy with those languages. > OS programmers in particular are not among those easily led by fashion. If Lisp gave them a real advantage, some of them would use it. And they do. OS programming is notoriously hard to get into, but even more so if you leave the beaten path. It's inertia again: everyone else is using c, and there's a lot of existing literature about how to write OSes in c, so that's what people do. Rust--which has recently been popular for hobbyist OSes like redox--and c++ were explicitly designed to support the same kinds of programming paradigms as c, so OSes written in them aren't indicative of a deviation from c. But those people who have enough expertise to move past toy OSes and stolen architecture can and do write OSes in other languages, like the lisp os I linked above.