3 ms·
From Chapter 1.4: "The most important aspect of a Lisp operating system is not that all the code be written in Lisp, but rather to present a Lisp-like interfac
by kyberias 8y ago
From Chapter 1.4:
"The most important aspect of a Lisp operating system is not that all the code be written in Lisp, but rather to present a Lisp-like interface between users and the system and between applications and the system."
- ssivark 8y agoIf this is too be run on regular CPUs, since assembly programming is imperative, won't there necessarily be non-Lisp-like code underneath, with (hopefully) Lisp-like interfaces?
- monocasa 8y agoLisp has almost never been a "no imperative code" language.
- mruts 8y agoClassical Lisp was never really big on FP. Scheme is the variant in which FP is more emphasized. If you look at the code of OpenGenera, it’s mostly OO/imperative. Though modern FP has significantly diverged from Lisp and it’s roots. Things like static-typing, higher kinded types, etc etc
- ssivark 8y agoTo cut to the chase, is the takeaway claim that it's easy+performant to write low level code in lisp? Out of curiosity, what would be good examples along these lines? Thanks!
- jonjacky 8y agoSeveral examples inline, and links to more, here: https://news.ycombinator.com/item?id=16471019 https://news.ycombinator.com/item?id=16471019
- mruts 8y agoCheck out https://github.com/mietek/mit-cadr-system-software https://github.com/mietek/mit-cadr-system-software Itss a tape dump of the CADR system. Also you could check out OpenGenera, but it's not (legally) available. If you want modern examples, check out SBCL, the Common Lisp compiler https://github.com/sbcl/sbcl https://github.com/sbcl/sbcl While a Scheme and not a Lisp, you can check out Gambit Scheme. https://github.com/gambit/gambit https://github.com/gambit/gambit It's written in a functional style and compiles Scheme to C. The generated code is really fast. As an aside, there really should be no difference in performance between a loop and a tail recursive call, assuming the compiler does TCO. So if that's your definition of "functional", then it should have the same performance as any "imperative" language.
- lispm 8y agoI always felt that on the Lisp Machine one of the great things are the Lisp-like interfaces into the system. For a lot of stuff there is for example very little manual memory management necessary and the whole thing is very introspective at runtime - due to a very object-oriented architecture. The operating system runs most of the time in a way, that would be beyond a typical debug mode on conventional machines: all data is tagged, almost all data is an instance of some class, all basic functions are type checked and bounds checked at runtime, all function calls are on the stack and many functions have (optional) named arguments. A developer would also run the whole OS with full cross references, documentation references and source references. Then there are selective ways to run some code with higher debug features, like source locators for local variables/functions or using the Lisp interpreter for some code - usually code would run compiled, but the interpreter would support things like source stepping and seeing macro expansions.