[self-interest] Info

Jecel Assumpcao Jr jecel at merlintec.com
Tue Feb 27 22:42:52 UTC 2001


On Wed, 21 Feb 2001,  Michael Lewis wrote:
> Can someone please help me out, Im new to this stuff
> so please bear with me.
>  Before delving into cel/self, I thought it usefull to
> atleast code up a very
>  basic system.

I have been discussing something very similar with a friend.

>  I can see that if I drop the premise of 'all objects'
> it becomes much easier,
>  but I'd like to keep the Smalltalk/Self etc idea of
> all objects.

It doesn't make things easier because then you have to keep checking
everywhere if you received a proper object or a "primitive" as an
argument. Having everything as an object is the simplest solution.

>  So I have a basic Objects structure as:
> 
>  struct Object {
> 	int ref_count;
> 	bool isMethod;
> 	vector<Object*> inst_vars;
>  };
> 
>  Canonical Classes
>  -----------------
>   Class, Object, ....

So you have a class based system? That makes things more complex.
 
>  Example
>  -------
> 
>   Class: 
> 	[ Class	]
> 	[1	]
> 	[ false	]
> 	-> [ Integer ]		[Object]	[Object]		[Dictinary]
> 	   [false]		[false]		[false]			[false]
> 	   [ no. of inst_vars]	[SuperObject]
> [ClassObject=?nil?]	[Methods]
> 
> 	... [Method	]
> 	    [true	]
> 	    [....	]
> 	
>   ... which relies on 'Object', 'Dictionary',
> 'Methods', 'Integer', 'Symbol', 'String'

I didn't understand your notation.

>   Now I can see that I need to do some bootstrapping
> of the objects,
> 
>   I'd have a 'GlobalSymbolTable' 
> 
> 	Object* 	| Object*
> 	<Symbol>  	<Index to Object Table>
> 	
> 	[Class]	 	[x]
> 	[Object] 	[x]
> 	[Symbol] 	[x]
>  	[Dictionary]	[x]
> 	...
> 	...

Same problem here.

>   but how on earth do you go about that bootstrap
> process??
> 
>  
>   I've seen 'Little Smalltalk' but it does not
> describe how the bootstrap process
>   works,

In Little Smalltalk there is a special textual notation for describing
all the objects in the system. And there is a special C program called
"imageBuilder" that can read this text and create a binary image file
that can be read by the interpreter.

Many of the objects in Little Smalltalk form a parser which can read
the text source of a Smalltalk method and create the internal
representation of that method. So it doesn't need to understand the
text format that the imageBuilder program does.

>   Anyone have any ideas??? .... evry time I think
> about it, I manage
>   to invent a chicken and an egg and then decide which
> comes first, tho'
>   sometimes I manage half and egg and half a chicken
> [basically bad]...

In Self there is a lot of functionality in the virtual machine itself,
unlike most Smalltalks. There is a complete parser, for example. When
you start up Self, it create a very small number of objects (the lobby,
some empty objects as the parents of block, integers and other such
things and also a vector of mirror prototypes) in what is called "the
empty world". With those objects plus the rich set of primitives in the
virtual machine, the whole Self system can be created by reading in all
the .self files (which were created by hand in some text editor in the
first version - now most of them are generated from a running system
using the transporter).

I know I have used a lot of Self specific terms in these explanations,
so I don't think they will help you very much. If you could describe
your notation or your problem in more detail I might be able to figure
something out.

-- Jecel



More information about the Self-interest mailing list