Live data from Hacker News

Mezzano – An operating system written in Common Lisp

github.com

31–40 of 65 posts

Re: Mezzano – An operating system written in Common Lisp

#31

One of my favorite things to learn when I come across any experimental OS is: "why?" Redox wants to do microkernel architecture The Right Way, and wants to use a guaranteed memory-and-type safe language (Rust). ReactOS wants to create a drop-in replacement for Windows that not only supports older Windows programs, but also Windows-compatible device drivers. MenuetOS wants to build something approximating the OS exper…

Why? The question is never 'Why?', but 'How?'. The answer is the hacker "Hands on Imperative".

Re: Mezzano – An operating system written in Common Lisp

#32
post #21

Earlier quoted context omitted.

Well, if you're running on a typical processor than any process can use pointer arithmetic to access memory, so you still need some sort of low-level memory protection mechanism. On some hypothetical Lisp/high-level-language processor, that needn't be the case, of course, but I honestly don't think we'll ever see something like that again.

> than any process can use pointer arithmetic to access memory, The damage this can potentially cause can be prevented using proof-carrying code.

I'm not sure why you're being downvoted.

Store applications as byte code or source code and use a trusted JIT to generate machine code. With a system-wide garbage collector and bounds checking you would have a memory safe single address space operating system.

Re: Mezzano – An operating system written in Common Lisp

#34
Very impressive.

Since the demise Lisp machines, there have been several attempts at developing a Lisp-based operating system which didn't deliver anything: LispOS, Tunes, and Loper; and one successful attempt at getting Lisp to run on the bare metal: Movitz.

Lisp was its own operating system on the original Lisp machines developed at MIT, and this evolved into Genera at Symbolics. Is this the case here?

I notice that Mezzano has files. Files are inherited from operating systems running non image-based languages. They're alien to Smalltalk, where everything is just stored in the image (or world, in Lisp parlance). This could also be done in Lisp. Text files could be replaced by long strings contained in the world. Hypertext, provided tags are balanced, could be stored as lists. When the system is shut down, and periodically beforehand, the world is written to disk.

You can go further, by using a single address space. Particularly large blocks of text which don't fit into RAM, and so have to be stored on disk, can be addressed by treating the disk as an extension of RAM. You can even go further on 64 bit machines by treating the entire contents of the internet as an extension of RAM.

I once wrote a small bare-metal Lisp interpreter in x86 assembler, which ran off a 1.4Mb floppy on an old laptop. The hardest part was writing the floppy disk driver, which has to handle frequent hardware errors. USB drivers are many times harder and I didn't attempt that. If the Mezzano developer(s) succeeded, I'm even more impressed.

Re: Mezzano – An operating system written in Common Lisp

#35

Earlier quoted context omitted.

> Instead, if your system is written in Lisp, then you can directly pass lisp objects from one lisp application to another lisp application, and there's no need to serialize/deserialize, to parse or otherwise mangle the data: you just have lisp objects and you can use them directly. You can pass closures (which enclose the lisp object data along with the lisp functions needed to process them). So, if I understand cor…

From what I can tell looking at the code, Mezzano doesn't have processes, just threads. There's no distinction between the kernel and user-space. Whilst convenient, it isn't an unqualified good. Bugs in any part of the system have the potential to catastrophically break everything. It's also terrible for security. |Without the notion of a distinct kernel - or "unsafe" code that only privileged users can compile or lo…

> It's also terrible for security.

The security angle is interesting.

The thing about independent processes is that we're relying on the OS to provide a wall around each process to limit it's impact by default. Maybe a better approach would to be include something like chroot/containerization for execution of closures within the language? Ie, if program 'A' receives data from program 'B', it can evaluate that data in a sandbox with limited permissions (IO limitations like no networking, or CPU resource limitations and time limits) and receive exceptions if the closure tries to exceed it's permissions. That could fit in pretty cleanly with Common Lisp's condition system.

A con of this though: you could argue that it really breaks encapsulation; it's bad enough when different parts of a large program become too closely coupled - allowing different applications to depend on the internal state of each other could be a nightmare.

Re: Mezzano – An operating system written in Common Lisp

#36
post #6

One of my favorite things to learn when I come across any experimental OS is: "why?" Redox wants to do microkernel architecture The Right Way, and wants to use a guaranteed memory-and-type safe language (Rust). ReactOS wants to create a drop-in replacement for Windows that not only supports older Windows programs, but also Windows-compatible device drivers. MenuetOS wants to build something approximating the OS exper…

Mezzano would be an OS on top of a language/runtime for a programming language which allows flexible development from low-level up to high-level (CLOS/MOP). One could experiment with different OS models, which would be integrating interactive programming. I grew up with a machine which booted into a BASIC interpreter. It was relatively primitive, but fun. How would it look & feel with a more powerful programming lang…

> I grew up with a machine which booted into a BASIC interpreter

ZX Spectrum by any chance?

Re: Mezzano – An operating system written in Common Lisp

#37

Earlier quoted context omitted.

From what I can tell looking at the code, Mezzano doesn't have processes, just threads. There's no distinction between the kernel and user-space. Whilst convenient, it isn't an unqualified good. Bugs in any part of the system have the potential to catastrophically break everything. It's also terrible for security. |Without the notion of a distinct kernel - or "unsafe" code that only privileged users can compile or lo…

> It's also terrible for security. The security angle is interesting. The thing about independent processes is that we're relying on the OS to provide a wall around each process to limit it's impact by default . Maybe a better approach would to be include something like chroot/containerization for execution of closures within the language ? Ie, if program 'A' receives data from program 'B', it can evaluate that data…

No runtime analysis can simultaneously allow all intended sharing and prevent all unintended sharing. Best you can hope for is a static analysis that rejects programs that would share objects in unintended ways.

Re: Mezzano – An operating system written in Common Lisp

#38
post #36
post #6

Earlier quoted context omitted.

Mezzano would be an OS on top of a language/runtime for a programming language which allows flexible development from low-level up to high-level (CLOS/MOP). One could experiment with different OS models, which would be integrating interactive programming. I grew up with a machine which booted into a BASIC interpreter. It was relatively primitive, but fun. How would it look & feel with a more powerful programming lang…

> I grew up with a machine which booted into a BASIC interpreter ZX Spectrum by any chance?

That's one possible machine. Most Z80 and 6502 machines booted straight into BASIC in the early 1980s.

Re: Mezzano – An operating system written in Common Lisp

#39

Earlier quoted context omitted.

From what I can tell looking at the code, Mezzano doesn't have processes, just threads. There's no distinction between the kernel and user-space. Whilst convenient, it isn't an unqualified good. Bugs in any part of the system have the potential to catastrophically break everything. It's also terrible for security. |Without the notion of a distinct kernel - or "unsafe" code that only privileged users can compile or lo…

> From what I can tell looking at the code, Mezzano doesn't have processes, just threads. I'd rather there were no distinction between processes and threads. It's artificial. I want to live in a world where processes cooperate to produce useful results for the user, rather than assume other processes are out there to corrupt their data. If there's any memory protection, I'd rather it be a compile-time, rather than ru…

This seems like a well-articulated point, written with a civil tone. Rather than downvoting, perhaps people could make a counter-argument? The approach of "thinking and getting things right" before writing code might not be common with this audience, but there are fields where it's the only way to work.

I think the idea of compile-time safety proofs is interesting. The number of runtime cycles spent on policy enforcement could be greatly reduced. Would it ever be possible, though, to derive such proofs for programs written in "unsafe" languages, or for arbitrary binaries?

An OS which only supports one language would be unlikely to be generally useful, although it might provide sufficiently compelling benefits for specialized use cases. I believe MirageOS represents an OCaml implementation of this idea, although it may in fact support other languages.

Re: Mezzano – An operating system written in Common Lisp

#40
post #36
post #6

Earlier quoted context omitted.

Mezzano would be an OS on top of a language/runtime for a programming language which allows flexible development from low-level up to high-level (CLOS/MOP). One could experiment with different OS models, which would be integrating interactive programming. I grew up with a machine which booted into a BASIC interpreter. It was relatively primitive, but fun. How would it look & feel with a more powerful programming lang…

> I grew up with a machine which booted into a BASIC interpreter ZX Spectrum by any chance?

Apple IIe and IIc. A friend's father had an IIe and I got a IIc for myself, later.
Post reply on HN