[unios] tril's typed object system

Tril dem@tunes.org
Mon, 28 Dec 1998 19:31:06 -0800 (PST)


From: Tril <dem@tunes.org>


On Sat, 26 Dec 1998, Anders Petersson wrote:

> >From: Tril <dem@tunes.org>
> >Metaprogramming.  To perform an action, the objects are first strongly
> >type-checked, then linked directly together.  Since they have already been
> >typechecked, they can be treated as one composite object.  The
> >specification (we prefer that term to 'code' because a specification is
> >not in ASCII format, but made of objects) for the two together can be
> >optimized.  We believe this solution is both fast AND safe.
> 
> I don't think I really understand what you mean...
> How can objects be type-checked? Is that a compile-time operation?
> How can you link objects together? You must have a different definition of
> objects than we (or maybe just I). What *is* your definition of objects?

Yes, my definition is unique.  First, the object system is a type system. 
'Objects' to me is the highest (most generic) type.  When someone says,
"everything in the system is an object", I have a very practical
definition of this.  Every type is a subtype of the type 'objects'.  A
single 'object' is any member of this most generic type-- any entity in
the system, at all.  And, every object has a single, known type somewhere
in the hierarchy of types.

Subtyping is creating a more specialized type (or category-- I won't say
'class' because it suggests traditional OO).  All members of the subtype
are also members of the supertype.  Being in a type has a practical
definition, too.  It means certain operations are available, but also that
an object of a type can be REPLACED by any other object of the same type,
that is, any other object having the same properties.  This replacement
ability makes objects into "components" in a pluggable system.

Everything being a subtype of one "most-super" type creates a unified
typesystem, the core of an integrated OS.  Where every object can be
related to every other, and for every possible action, the system knows
whether it is valid or not.  Checking whether an action is valid or not is
typechecking.  It is a requirement for every operation.  Mandatory strong
typing gives the system as much security as needed.

Operations on a type are (by definition of subtype) available on every
object of any of its subtypes.  So, to implement generic operations, you
write them for types high up in the type hierarchy.  Then they work on the
type they are written for, plus every type below it.  For instance,
anything that can be done to an 'object', by definition of the 'objects'
type as the most generic type, can be done to every single object in the
system.

There are no messages involved.  Instead, the evaluation model uses
"partial evaluation", in which generic functions are specialized based on
their arguments' type, to produce specialized functions.  When enough
information is available (when all arguments are known), the function can
be fully evaluated to produce its result.

Functions are written using the type system (in fact defining a function
is basically the same as defining a new type), and always have arguments
in the type system and results in the type system.  Therefore all
functions can be treated uniformly, because they are objects in the type
system too (and all operations available on objects work for functions).

You'll be able to stick hardware, abstract resources like memory, time,
protocols, other languages, anything you want, into the type system.  You
can ignore the word 'type' and just call it a system :)

This is a basic sketch, I'm still developing the ideas though.  In fact
this post probably makes no sense.  But you asked for it.  I guess you can
ask any questions you want, because that will help me crystallize the
model.  [tril braces for storm]

David Manifold <dem@tunes.org>
This message is placed in the public domain.


------------------------------------------------------------------------
To unsubscribe from this mailing list, or to change your subscription
to digest, go to the ONElist web site, at http://www.onelist.com and
select the User Center link from the menu bar on the left.
------------------------------------------------------------------------
UniOS Group
http://members.xoom.com/unios