using gcj for a different language - is it possible?

Andrew Haley aph@redhat.com
Sun Jan 11 15:23:00 GMT 2004


Per Bothner writes:
 > Andrew Haley wrote:
 > > Per Bothner writes:
 > > > 'a become: b' swaps object identity.
 > > > After the become all references that used to point to the
 > > > object references by a now point to the object that used to be
 > > > referenced by b.
 > > >
 > > > This isn't really practical to support unless you use indirection
 > > > via an object table, which Objective-C doesn't.
 > > 
 > > I think the trick used in Smalltalk was to copy and then overwrite
 > > both objects with a special indirection object.  We could do this in
 > > gcj.
 > > 
 > ...
 > So it is possible to implement becomes: reasonably efficiently,
 > as long as you stick to SmallTalk object, where you can only access
 > the fields of the current objects.  If you care enough.

Okay, I take your point -- become: can be done reasonably efficiently
in the gcj runtime only if you don't have external access to fields.
But in the context of using gcj for a Smalltalk runtime that's all we
need, and I don't know of other languages still in use that support
become:.  (An aside: the truly frightening semantics of become: make
me thing of the infamous COME FROM statement!)

Andrew.



More information about the Java mailing list