[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of Proto?



Ken Anderson <kanderson@bbn.com> writes:

> Jonathan, in your talk on Proto you mentioned your goal for Proto
> was 10K lines of code.
> 
> How close did you come to the goal? 

proto 0.108 is right around 10K lines at present using my friendly wc.
i'll send a more accurate line count early next week.  the line
counter that i'm writing avoids counting comments, blank lines, and
module specific constructs so as to NOT disincentivize their use.  i
probably should use character count instead so as to not
disincentivize line breaks, but unfortunately, line count is the most
often cited complexity metric.  to counter this i limit myself to 80
columns.

> You mentioned Proto was written in itself, which is a great idea.
> Can you describe how you bootstrap it?

i gave a mini-lecture on the bootstrap used in proto in an mit seminar
i taught (with greg sullivan and kostas arkoudous) on advanced dynamic
object-oriented language design and implementation topics.  this and a
couple other presentations can be found at:

  www.ai.mit.edu/~jrb/proto/

this material is out of date but gives the general idea.  i should be
updating this material soon to go along with the end of november
general open source release of proto.

as far as bootstrapping goes, there are two important issues: (1) how
do you get a language written in itself to begin with and then (2)
what work does it have to do to construct a working world?  

as far as (2) goes, the first consideration to me was that i use a
very simple mechanism.  the simplest i could think was a dynamic
bootstrap using form at a time execution semantics that manually
weaves together the object system / runtime.  

the second consideration was to minimally obfuscate the overall object
system definition with boot specific hacks such that it would still be
easily understandable.  unfortunately, this is at odds with the usual
dynamic bootstrap, so i spent a great deal of time coming up with
macros and conventions that made the final object system definition
look as much like it would in a bootstrapping regime not requiring
bootstrapping specific changes to the runtime definition.

in dylan we used a much more complicated static bootstrapping regime
that required far fewer bootstrap specific hacks.  the mechanism
involves a static mop and weaver that at the end of the day dumped out
a woven object system.  in order to avoid redundancy, a core part of
the object system / runtime definitions were actually defined in the
compiler.

i have seen dynamic bootstrap techniques used in keith playford's
eulisp object-system implementation and gregor kiczales' tiny clos
that employ a simple booter / redefinition nub that builds enough of
the world such that the entire unadulterated object system could be
sent through it.  unfortunately, keith has told me that the problem
with this mechanism is that it is quite fragile.

let me know if you would like to know more.

jonathan bachrach