4 ms·
Considering that you can't even write an OS kernel in pure C (Linux has a lot of inline asm IIRC), writing one in Lisp seems like a fairly unrealistic, slightly
by fhd2 13y ago
Considering that you can't even write an OS kernel in pure C (Linux has a lot of inline asm IIRC), writing one in Lisp seems like a fairly unrealistic, slightly weird dream.
But "Operating System" is being used ambiguously. Can Emacs be an OS kernel? Um, no. Can Emacs be a shell/UI replacement? Yes, I think so. The discussion appears to be partly about that.
- klibertp 13y ago> writing one OS in Lisp seems like a fairly unrealistic, slightly weird dream. It's not - it actually was done[1]. There were OSes written in other high-level languages, like Smalltalk and Forth (which may not be "high-level", but at least it's higher level than C). [1] http://en.wikipedia.org/wiki/Lisp_machine http://en.wikipedia.org/wiki/Lisp_machine
- jfb 13y agoI'm not sure I'd classify Forth as higher level than C; in many ways, it operates on abstractions more akin to assembler. In every way, it's really, really strange.
- JulianMorrison 13y agoAgreed. Typeless, completely unsafe, treats RAM as a contiguous byte array with a dictionary growing one way and data stack growing the other, allows using the return stack as scratch space... it's very asm-ish.
- evincarofautumn 13y agoIt is a very good way of managing complexity, though, at the level you would write a program in assembly. And higher-level stack languages (such as Factor) bring that same degree of complexity management to application-land.
- DrewAllyn 13y agoIt might not be the best or most efficient way, and you might not be able to access all the features of your hardware but its certainly possible to write an OS kernal in pure C. We even did in our Operating Systems class. We did use exactly one GCC extension to C that made things a lot easier for us, but we could have used setjmp/longjmp instead if that extension hadn't been available. Since the machines that real Lisp OSes were made for were often designed as a Lisp target, I don't see any reason they couldn't be pure Lisp.
- kjs3 13y agoTo your first point, that depends on your target architecture. On a Symbolics (and TI Explorer, LMI, Xerox D-machine, etc), there is no Unix-ish "asm layer" communicating that last inch to the bare metal. The "assembly language" of these was Lisp primitives and once the microcode loaded, it was all lisp from there. In fact, on the Xerox D-machines you loaded one microcode and got a Lisp machine, a different microcode and got a Smalltalk machine, or a Mesa/Cedar machine. Nifty stuff, from The Before Time, when we were still fundamentally innovating hardware architectures and not figuring out how to make x86 go faster. Definitely with you on the second point.