RScheme

Donovan Kolbly donovan@rscheme.org
Tue, 31 Mar 1998 12:28:37 -0600 (CST)


On Tue, 31 Mar 1998, Fare Rideau wrote:

> Dear Donovan,
>    I'm interested in building an reflective operating system,
> integrated within a high-level language, and featuring a persistent store.

Sounds interesting!

> >From what I read about RScheme, it might very well be
> a good starting point for my coding (other people with different projects
> are wondering the same on the LispOS mailing-list).
> 
> However, there are several points that I'm worried about:
> 
> * how "modular" is the system? That is, how easy would it be for me
>  to steal parts of it, so as to mix-and-match with other code I'd write
>  (or steal from other people)? There does not seem to be any ROADMAP
>  for newcomers to understand what files correspond
>  to what parts of the system, and which parts rely on which other parts.

Admittedly, there is nothing like a roadmap beyond the README.  We are
currently working on documenting the internals of the system, but there is
much to do yet.  Suggestions as to where to focus our efforts are welcome! 

In terms of "modularity", I'd say RScheme is more modular than most scheme
systems I've seen, but is a far cry from a componentized plug-and-play
cafeteria-plan language system (which I have visions of creating at some
distant point in the future).  It talks to C moderately well, but does
have problems interfacing with other code that has unusual execution
semantics (ie, callbacks, threads, engines, etc). 

> 
> * so that the system can develop itself in a standalone way,
>  and ability to store classes and native code in the persistent store,
>  without having to resort to a file system; classes ought to be
>  fully first-class objects, not associated to a global name.
>  However, I understand that the current RScheme system does not
>  allow that. Would it be possible to add it, or would I be better off
>  starting from scratch?

Au contraire;  classes are first-class and NOT associated with a global
name (although they are usually stored in top-level variables, the classes
themselves are quite anonymous (they have names the same way RScheme
procedures have "names" -- for debugging and readability purposes))

> 
> * another things that would be useful are first-class environments
>  and a few other things that MIT-Scheme provides, so as to port edwin,
>  if possible.

I don't know much about edwin; first-class introspective environments are
probably easy to add if you know what you need.  First-class reflective
(affective) environments are probably intractable without trashing
performance too severely.

> 
> * So as to allow both efficient real-time processes and orthogonally
>  persistent (perhaps distributed) data, I intend to split the heap
>  into several zones with different priorities and policies,
>  which means different code-generation (or interpretation) tactics,
>  and indirect communication between real-time and distributed parts.
>  Actually, I intend to annotate types with extra information bits,
>  such as linearity, modifiability, real-time accessibility, etc.
>  For security and resource monitoring purposes,
>  having separate yet communicating heaps (e.g. one per "user")
>  would also be good.
>  How would that fit or not in the RScheme runtime and compiler?

Hmm.  Not sure how that would fit in.  RScheme already has a prototypical
notion of "allocation area" -- this is how it understands when to
allocate in a persistent area -- but the areas are not insulated from one
another.

Probably this kind of stuff would fit in just fine, but there's a lot to
be thought about. 

> 
> * So as to allow users to control what happens before the system may crash,
>  I need some way to monitor the way GC and persistence are done,
>  considering that if the system starts eating to much memory,
>  the system should not fail or swap to death, which would be all the
>  more damaging that persistence of processes would have the same
>  behavior appear back after reboot!
>  Is such thing doable from the RScheme GC and store?

Most likely, if you can specify what you want and are willing to pay the
price (eg, you could keep track of how much allocation a particular "user"
has done and kick them off if they eat too much).  Depending on what
policies you'd want to implement, you'd have to work out some mechanisms
(and I'd be happy to participate in that discussion).  Different
mechanisms will then have different performance characteristics in the
RScheme framework.  [Sorry about the generic comments here]

> 
> * If not RScheme, which existing system would you advise to steal code from?

Hmm.  The only other option that would come to mind would be guile, since
there may be some benefit in being "compatible" with the GNU project.
However, I understand that code can be difficult to work with.

> 
> * Do you know anyone interested in building such a system?

Not specifically.  Personally, I'm fascinated by the ideas and would be
happy to help out, but I don't have a lot of time to spend on it.

> 
> 
> Other minor questions/remarks about RScheme:
> 
> * minor notes about tech.ps:
>  2^29 is not rendered correctly on page 1;
>  two-bytes should be four-bytes on page 5;
>  [I'll send more feadback as I re-read the docs carefully]

Thanks; I'll make sure these get fixed.

> 
> * What happened to the old texinfo documentation?

It was out of date; I intend to generate texinfo from the sgml sources,
but I wasn't able to ship that with 0.7.2.

> 
> * What does the R in RScheme mean?

Two things (the name was Paul's idea):  "R" is for "Reflective" (though
not very, at the moment), and, hey, is "ouR" scheme.

> 
> * Is Prof. Paul Wilson still taking active part in the development of RScheme?

pretty much.  He's busy being a professor, of course, but we're all busy
with day jobs.

> 
> * I once mailed to Prof Wilson about a technique of generating
>  safe-point-recovery code together with optimized native code,
>  so as to be able to combine GC with reactive preemptive multi-threading,
>  but received no response. Has the technique ever been considered?
>  or was discarded because it wasn't effective, or because it costs too much,
>  or just because Prof Wilson doesn't have time?
>  I understand that the technique is not effective when compiling to C,
>  since the C compiler's optimizations prevent recovery, unless they are
>  disabled (with volatile variables and other serializations),
>  which defeats the purpose.

I don't recall him mentioning this explicitly, so I'm not sure.  What is
"reactive" preemptive multi-threading?  I'm not sure what the issues are,
myself.  Is the idea to checkpoint the heap image at every safe point, so
that if the process crashes you can come back to where you left off?  That
sounds expensive, right off hand...

RScheme does have a user-level threading facility (preemptive at the
scheme level, cooperative within the runtime system) which you could use
for the threading part.

> Thanks for all, congratulations for your code, and best regards,

Thanks for your comments.  I'm interested to know how you proceed.

-- Donovan Kolbly                       RScheme Development Group
   (W) 512-459-8745 x 26		d.kolbly@rscheme.org
					http://www.rscheme.org/~donovan/