Fri Jul 17 14:54:52 CEST 2009

PF / Staapl / PLT Scheme

So.. Is there hope?

I constantly oscillate between times where I think I should just rip
out the guts and start over with a new VM, and times where I think
things are not so bad and the current VM can be grown into something
more mature.  Unfortunately, the latter happens mostly after not
looking at the code for a while..  The overall structure, which is
what I remember after leaving the code alone, is quite allright, it's
just the leaves on the ground that are rotten...

What needs fixing?

  1. packet types

The type system and the way polymorphism is handled is currently
implemented in a very bizarre way: there is the type ID and the
symbolic representation.  I would like to unify this into one.

  2. macros

There are too many C preprocessor macros that make source code
analysis difficult.  The bulk of these should be replaced with inline
functions, and macros that are in some sense "typed" or have a clear
semantics such that a C parser with possibly some extensions
(i.e. Dave Herman's c.plt) can be used to parse it.

  3. duplication in the kernel code

A lot of the code can be factored and macro-generated.  However, I
don't dare to approach this without automated tools

  4. abstracting plugins to a simpler API

This can be done manually: most of the plugins can be separated into
some decoupled C code that is useful in other projects, and a C<->PF