From: oreillym@tartarus.uwa.edu.au (Michael O'Reilly)
Newsgroups: comp.object
Subject: Implementing an OO system
Date: 26 Sep 1992 09:36:10 GMT
Organization: The University of Westrn Australia
NNTP-Posting-Host: tartarus.uwa.edu.au
X-Newsreader: Tin 1.1 PL5


I am writing a concurrent, distributed, persistent, object oriented
programming environment and have a few problems (surprise, surprise. :).
The language used is one I made up. (Vaguely C like. I like C's
concise syntax, and non of the OO languages around seem to have
anything like it). The distribution is coarse grained, and
communications are assumed to be expensive. Memory is assumed to be
relatively cheap. CPU time assumed to be moderately expensive. (I.e.
Would like to have a high efficiency. ). Just to make things easier,
and more portable, the language is interpreted. The language is
strongly typed, with the intention of static binding as many methods
calls as possible.

It is OO as a fairly fine level. Integers strings etc al are classes.
I.e. '1' is an object of class Int. etc.

1) Has anyone got any pointers on a good garbage collection scheme to
use??? I am using reference counting at the moment (the distributed
nature seems to require it. Any know any different??) 

2) What is a good way to handle garbage collection of class
definitions?? The problem here is that nothing using the class isn't
a good reason to throw it away. At some instance, there may be not
class that actually uses the List class, but you can't throw it away!
On the other hand, it is conceivable that during development, a number
of superfluous classes get created.

3) What is a good way to handle recursive class definitions?? (i.e.
How would you implement it??). The class I had in mind is...

	class List {
		List next;
		Data d;
		/* various normal methods defined */
		}

	class Data {
		List l; /* List of data */
		String s; /* and some string.. */
		/* more methods here */
		}
How does a compiler handle this sort of thing??? I have a few
solutions in mind, but they aren't very clean.. :(

4) What is a good syntax, and/or implementation of parameterized
classes like 
	class List(T) {
		List l;
		T data;
		/* blah blah */
		}
What if you want two items of data?? Yes, you could make T a complex
type with two elements, but would this be less efficient??

5) Concurrency. Anyone got any pointers for coarse grained
concurrency?? I had in mind an exclusion system like...

		/* code.. */
		{{ /* This block is exclusive per object */
			t = a;
			a = b;
			b = t;
		}}
The gets implemented by compiling in a lock acquisition for some lock
numbered N (where N is computed from the object handle and the
function). The lock gets created if it doesn't exist. Problems here
include making sure N is unique. Maybe maybe N a 64 bit number
comprised of a 32 bit object handle, and a 32 program counter.

Anyone got any better ideas for supporting concurrency??


6) Conformance. Anyone got some pointer to papers/information on
this? Particularly efficient implementation of it?

7) Given that the system will be persistent,and given that there are
likely to be a number of people working with is simultaneously, what
is a good way of handles modules or some other system to manage class
conflicts (two people defining different class of the same name.. )

As you have realized, I don't have a lot of experience with OO systems.
I wanted a distributed, concurrent system , and an OO like system seems
a like a good way to get it. Pure OO is very likely won't be.