Subject: Writing a SchemeOS in Copious Free Time

From: Moshe Zadka <[email-masked]>
Date: Sat, 13 May 2000 22:21:11 +0300 (IDT)

I have a plan to write a SchemeOS, and Chen asked me to elaborate a bit on
what I plan to do. As soon as I have code, I would enjoy sharing it with
everyone -- maybe a CVS archive.

Assumption: as far as kernels go, Linux is great. I have no wish to
rewrite ext2fs, for example.

So, what we need is a way to have a Scheme layer *on top* of an existing
OS, with moderately good portability.

Details:
1. Take Scm, or guile. Rip out the Scheme virtual machine. Add thin
interfaces to all system calls. Rip out any unneeded implemented-in-C
functions -- have only the procedures R5RS calls "basic".

2. Write a R5RS compiler in Scheme to our given virtual machine.

3. Write an init-process in Scheme. All its configuration files, of
course, should be Scheme programs.

(By this time, we have a fully functioning OS -- but no utilities)

4. Write a C compiler, using the VM as target platform. Actually, I can
build on gcc, and just write a new backend. It won't be very easy, but I
can have it in the end.

(Now, compile all utilities for the new target platform. By this time, you
have a fully functioning OS, in all sense)

5. Optimization stage. Have the compilers written be optimizing compilers.
Have the VM heavily optimized.

(Now, we have a fast and functional system)

Now, the really fun part starts -- we have a Scheme machine, and we can
play around with it. Your imagination is the limit. For example: program
encounters an exception? Just launch up a debugger. User can correct the
problem on the fly, and keep running. 

--
Moshe Zadka <[email-masked]>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com

---

From: Moshe Zadka <[email-masked]>
Date: Sun, 14 May 2000 23:21:26 +0300 (IDT)

On Sun, 14 May 2000, Gal Shalif wrote:

> Some ideas may be borowed from the "Scheme Shell" 
> (http://www.swiss.ai.mit.edu/ftpdir/scsh/)

I've used scsh, and read about it. If anything could be borrowed, it could
be the VM, but that is greatly over engineered. Otherwise, it is just a
UNIX interface with some syntactic sugar, which is nice but not what I
need. Of course, once we have a SchemeOS, scsh should be ported to it to
serve as the standard shell.

What I do need is help in: optimizing in the presence of call/cc (I have
some ideas about that). Actually, any Scheme optimization text is welcome,
but I'm afraid I'm becoming too much obsessed with optimizing. I think
I'll try and write an unoptimized version first to test ideas. 

PS.
Scheme48, on which scsh is based, is not free software, so I can't use
implementations. I intend SchemeOS to be released under the GPL