Earlier quoted context omitted.
I've had some user interface ideas I've wanted to explore floating around in my head for more than a decade. I' m now in a position to start exploring these ideas and after an extensive survey I decided to use Squeak. The deeper I get into this system the more appreciation I gain for the entire model.
Be sure to check out Cuis and Pharo as well.
Lisp Operating System (2015)
51–60 of 63 posts
Re: Lisp Operating System (2015)
#52Earlier quoted context omitted.
Only if you're given raw memory access, which you are not in Lisp.
Without raw memory access, good luck supporting anything than basic hardware. Even some USB features requires it.
Really, address spaces are just a hardware implementation of a more general concept: Namespace-based security. Application code wouldn't even be able to know the names of privileged objects, and if someone told that code the right names, it wouldn't be able to use them, because resolution of names to things is, itself, privileged.
In a simple example, assuming a Common Lisp-like system: Everything which handles raw pointers is in the SYSTEM package. Application code can't inspect the SYSTEM package, and, even if you told an application that the function SYSTEM:WRITE-DATA-TO-DISK was a thing, it couldn't call that function because the real evaluation code, which can see into the SYSTEM namespace, knows not to let application code call anything in SYSTEM; only the functions in SYSTEM and SYSCALL can do that.
Re: Lisp Operating System (2015)
#53For the incremental development the author describes, you can do that atop any GNU/Linux host platform on which your CL implementation runs. To play with a bootable user experience, before you've replaced the host kernel and device support, you can strip down something like Debian Live. I previously did this for a Racket-based living room appliance project. A simpler example, without Racketisms, that uses only 2 shel…
> I'm also a fan of a variation on the author's approach: have your better/different language get a foothold on a working GNU/Linux system, alongside traditional apps, in a system the user could use as their daily driver, and incrementally replace all of userland. That's incidentally what Emacs is to many of its users (myself included).
For a (mostly) single host process, without preemptive multitasking/threading, Emacs as an operating system works surprisingly well.
Re: Lisp Operating System (2015)
#54I literally stalled on the first sentence where he asserts without any rationale that an OS written in Lisp "would be a good thing in itself". WHY WHY WOULD ANYONE THINK THIS MATTERS
Conversely, why would anyone think that because a thing doesn't matter to them, it shouldn't matter to anyone else either?
It may matter to the author of the article. That's fine. To the users? I'm pretty sure that hardtoreason correctly reflects their attitude.
And if you're writing an OS, but don't care about the users? Well, write it however matters to you, because you aren't likely to have users who care, because you aren't likely to have users at all.
Re: Lisp Operating System (2015)
#55Earlier quoted context omitted.
If you have a single address space you don't need Spectre to be able to discover any aspect of the running system.
Only if you're given raw memory access, which you are not in Lisp.
TXR Lisp: let's gain access to malloc, allocate 42 bytes and then pretend that this block contains 100 "uint32" words (400 bytes):
This is the TXR Lisp interactive listener of TXR 215.
Quit with :quit or Ctrl-D on empty line. Ctrl-X ? for cheatsheet.
1> (with-dyn-lib nil (deffi malloc "malloc" cptr (size-t)))
#:lib-0010
2> (malloc 42)
#
3> (carray-cptr *2 (ffi uint32) 100)
#>
4> (vec-carray *3)
#(8381552 8381552 0 0 152124648 152288384 152288632 152288800 152288952
152289168 152289336 121 0 60 10 0 16 0 0 0 128 16 0 0 0 152292000
0 0 0 152126920 151513152 152292584 152127032 152292680 152292896
152293096 152293240 152293368 0 0 152293752 73 35 60 99 112 116
114 58 32 57 49 53 56 97 49 56 62 0 73 40 118 101 99 45 99 97
114 114 97 121 32 42 51 41 0 72 57 40 109 97 108 108 111 99 32
52 50 41 0 152304256 121 0 60 10 0 3 0 0 0)
TXR Lisp has good sandboxing for applications. The data structure which maps symbol package names to packages is itself a variable that can be overridden. So we can create a sandbox in which the sys package doesn't exist, and the usr package prefix refers to an altered one that has been scrubbed to a safe subset of symbols.http://nongnu.org/txr/txr-manpage.html#N-00E20381
The sys:bits function is available now:
1> (sys:bits (cons 1 2))
3076696060
2> *package-alist*
(("pub" . #) ("usr" . #) ("keyword" . #)
("sys" . #))
Remove the "sys" package: 3> [remqual "sys" *package-alist* car]
(("pub" . #) ("usr" . #) ("keyword" . #))
4> (set *package-alist* *3)
(("pub" . #) ("usr" . #) ("keyword" . #))
The symbol sys:bits is not recognized any more: 5> (sys:bits (cons 1 2))
expr-5:1: sys:bits: package sys not found
** syntax error
Because package-alist is a special variable, it's possible to dynamically override with let rather than globally clobber it in the above manner. The dynamic environment can then be a sandbox.Re: Lisp Operating System (2015)
#56Earlier quoted context omitted.
Conversely, why would anyone think that because a thing doesn't matter to them, it shouldn't matter to anyone else either?
I think that if you were to poll the users of an OS about what matters to them, the language it was implemented in would be at the absolute bottom of the list. It may matter to the author of the article. That's fine. To the users? I'm pretty sure that hardtoreason correctly reflects their attitude. And if you're writing an OS, but don't care about the users? Well, write it however matters to you, because you aren't l…
Counterpoint: Windows 10.
Re: Lisp Operating System (2015)
#57Earlier quoted context omitted.
I think that if you were to poll the users of an OS about what matters to them, the language it was implemented in would be at the absolute bottom of the list. It may matter to the author of the article. That's fine. To the users? I'm pretty sure that hardtoreason correctly reflects their attitude. And if you're writing an OS, but don't care about the users? Well, write it however matters to you, because you aren't l…
> And if you're writing an OS, but don't care about the users? Well, write it however matters to you, because you aren't likely to have users who care, because you aren't likely to have users at all. Counterpoint: Windows 10.
Re: Lisp Operating System (2015)
#58Earlier quoted context omitted.
That makes me reconsider the Plan9 OS, where everything is a file system. Then, nothing fits in the language (C)?
Making everything a file is one way to give all components a universal interface . It's not the only possible or even the best way. The problem is that today there are no universal interfaces at all, so even a file-based one seems immensely powerful by comparison.
http://doc.cat-v.org/plan_9/4th_edition/papers/names
note that the filesystem interface isn't totally durable across all operations: a syscall is still necessary to create processes, for instance. cp /proc/... doesn't do what one might think it does.
http://doc.cat-v.org/plan_9/4th_edition/papers/9
i appreciate that the original article similarly acknowledges that lisp is an "all the things (except for some things)" solution in the Single address space section. synchronization libraries (and perhaps other libs as well?) in C-based OSs need to drop into assembly to get at test-and-set kinds of operations. addressing these special cases one-by-one is something that'll need to be ramified in source in order to get any real insight, although (perhaps just from the inertia of familiarizing with the original bell labs warp) it's difficult to imagine the kernel as a "all the things, seriously everything" abstraction away from the machine.
----
overall, the original article and discussion here was a bright spot in my day. it gives me hope that there's some actual thought and discussion about how to evolve operating systems intended for commodity hardware, not just generalized, "yea, that's something we could do," one-offs. i'm not as familiar with the xerox heritage mentioned elsewhere in the comments, and the view that, in some sense, linguistic abstraction might cover OSs is something to think about.
i've heard the smalltalkers catch some flak about not actually writing an os because there was (apparently) the equivalent of exec(), no fork()
http://bitsavers.org/pdf/xerox/alto/memos_1975/Alto_Operatin...
this criticism of the alto OS could be due to cognitive bias as much as anything else. the concept of processes is by now deeply ingrained in the way we conceptualize operating systems. so i have to ask: is leading with eschewing processes a clean-sheet rethink, informed by history's mistakes as well as its successes, or is limiting the number of OS primitives at the expense of less-rich interfaces actually a desirable tradeoff?
like, although everything i've heard about multics in particular seems well thought-out, thomson and ritchie were doing something substantially different by opting for bytestreams as much of the interface rather than making strict decisions about arities and so on. every rule system makes is bound to be a rule a user will eventually want to break. i suppose the operating system's main job is to safely lift off of the hardware, not to impose further unnecessary artifice (of which hierarchical file systems AKA namespaces could be viewed as one) on the user. adding further icing onto this core objective is so much the better, so long as it's possible to scrape away and redecorate.
Re: Lisp Operating System (2015)
#59Earlier quoted context omitted.
If you squint a bit, the web is a bit like a giant multi-user operating system. We certainly save a lot of data in it, and expect it to persist. But we don't generally do that using a file metaphor, and i don't hear people crying out for one. My comments on HN don't look like files to me. Nor do my tasting notes on Untappd, my shitposts on various Slacks, my projects on GitHub (which contain files, but aren't files t…
Except, everything you mentioned are still one or multiple files sitting on a remote server. That it isn't necessarily presented as such through a particular web app's interface isn't relevant... under the hood, it's still just files on an operating system designed around that concept. Even data in a database is also data in a database file . I mean, there's a reason URLs look like directory paths... that's what they…
Yes, in the same way that this LISP OS's storage is still extents of bytes on a disk indexed by a lookup structure, ie files.
> That it isn't necessarily presented as such through a particular web app's interface isn't relevant.
Not only is it relevant, it is the entire point of the comment.
Re: Lisp Operating System (2015)
#60Earlier quoted context omitted.
> Not having a file system raises the question of what data should be persistent and what shouldn't. But on a modern computer, it is feasible to just treat all data as persistent (maybe excluding the youngest GC generation). I'd be concerned about the UX issue of ephemeral vs. permanent changes here. I doubt that files and save/revert operations are the best we can do, but I think there's a lot of value in the fact t…
If you squint a bit, the web is a bit like a giant multi-user operating system. We certainly save a lot of data in it, and expect it to persist. But we don't generally do that using a file metaphor, and i don't hear people crying out for one. My comments on HN don't look like files to me. Nor do my tasting notes on Untappd, my shitposts on various Slacks, my projects on GitHub (which contain files, but aren't files t…