Hi,

(This is a bit long)

Below are some info I've assembled about the Animorhpic VM (AVM). 
Sorry for the redundancies (and line wrap!). IMO, the reply from Gilad
Bracha at Sun (one of its developers) is the most interesting.

My conclusions so far (might change!) are:
* AVM is very relevant to Ruby VM development. It combines a fast
  interpreter with dynamic compilation based on runtime profiling info.
* A release of AVM (now owned by SUN) is coming up but its unclear when.
* Its unclear how much can be learned from it since the VM sources will
  NOT be released (only binaries of the VM and the Smalltalk source for
  libraries etc).
    * This probably indicates that there are still techniques in there
      that are still commercially important => AVM still technically
      state-of-the-art!?
* There might be some docs released with the AVM release but none is
  available right now so it'll have to be written => I doubt new docs will be
  written for such an old project?!
* AVM probably machine-dependent since contains dynamic compiler that has
  to (?) emit machine code. Probably Sparc's.
* The academic papers from the people behind AVM (on Self, Strongtalk,
  Cecil etc) is highly relevant to VM development.

so mainly:

the Ruby community might learn from this but the AVM itself cannot be the
basis for a Ruby VM since there will be no sources available. I somewhat
doubt the future of AVM even for Smalltalk if there are no sources; how
would it evolve?

Regards,

Robert Feldt

Ps. Stephane: I CC:ed you since you've also expressed interest in
AVM.



Info on AVM
***********

Response from Gilad Bracha
--------------------------
>Hi Gilad,
>
>I'm working on VM related issues for the OO programming language Ruby and
>recently heard about the Animorphic VM. I haven't found much hard facts
on
>the technology even though there seems to be a lot of interest and
rumours
>goind around.
>
>I'd appreciate if you could point me to any papers of information on AVM
>and the technology it used/uses.
 
Robert,
 
I'll try and summarize things quickly; much of what I'll say you probably 
already know.
 
Animorphic Smalltalk was a Smalltalk system built around the mid-90s as 
part of a startup that was informally known as Animorphic Systems. In
early 
1997, Animorphic was acquired by Sun, and much of the underlying VM 
technology was put to real use in the Hotspot JVM.
 
Animorphic Smalltalk included a high performance VM, a blue-book
compatible 
library, novel browsers and flyweight glyph-based GUI framework, optional 
type system, mirror based reflection and mixins.

The VM was a mixed-mode system, with a fast interpreter as well as dynamic 
compiler that was invoked based on dynamic profiling info. The VM did not 
make use of the type system at all; typing was strictly optional. Method 
dispatch was based on inline caches, including PICs. All code was 
represented internally as mixins, and any class could be used as a mixin
as 
well. Benchmarks showed that we were 2.5-4 times faster than commercial 
Smalltalks at that time (Digitalk, ParcPlace (now Cincom) and IBM). The 
system could run well on PC with 16Mb of RAM; it could be made to run in 
less. We used generational GC and in the latest versions used the train 
algorithm as well.
 
I believe we were the first mixed mode VM. The use of mixed-mode 
(interpreter and compiler) was crucial for the combination of performance 
with small footprint; the only previous application of similar technology 
was Self, which was entirely compiled and had a huge footprint. It's also 
very important for good interactive response.
 
We are currently engaged in an effort to release Animorphic Smalltalk. 
Unfortunately,
the source is restricted to the Smalltalk code; the VM was written in C++, 
and will be released as a binary only.
The release will most likely be governed by a Berkeley style license
(i.e., 
very liberal). I hope we can get a release out soon, but cannot give a
firm 
time table.
 
When the release comes out, there may be some more documentation  which 
might be very interesting to you. However, that documentation does not 
exist at the moment - someone needs to write it. It isn't clear if some
one 
really will. At the moment, all the documentation that exists is on my web 
page.  You've probably looked at it. It isn't much, and it may not be 
entirely accurate.
 
Since your focus is on VM issues and not on Smalltalk, such a release may 
not be that useful to you. That said, I think it will be of some interest. 
Ruby's underlying model is very Smalltalk-like. The primary differences is 
that Ruby has mixins and let's objects change their class on the fly. The 
use of mixins  was well supported in our system with essentially no
penalty 
in either time or space. Changing the class of an object seems 
straightforward. Consequently, you can probably regard the performance of 
Animorphic as a good indication of what is possible. Ultimately, it also 
depends on resources; we could have done a good deal more given more time.
 
I hope this is helpful to you.
 
 
Cheers,  Gilad
 
*********************************************
Gilad Bracha
Computational Theologist
Sun Java Software
http://java.sun.com/people/gbracha/


Some links to info on Animorphic VM
-----------------------------------

Animorphic VM (AVM) was a VM (and dynamic compiler!) 
supporting both Smalltalk and Java that was 
developed mid-1990's by a group of researchers previously working on Self. 
They were bought by SUN in 1996 and their Java tech made it into the
Hotspot 
Java Jitter/dynamic optimizer. There has been rumours that SUN plan to
make 
its source code open. This is interesting since such a VM might include 
techniques that can be used to implement Ruby VM's.

There is a lot of rumours on the great performance of the Animorphic VM
but
very little has been published and its hard to get by facts. Here's
a list of interesting links with summaries (some from Conrad Schneiker):

http://brain.cs.uiuc.edu/StWritersCoop/Topics+having+found+authors
"Animorphic Smalltalk: The animorphic Smalltalk is still today (more than
5
years after its baught by SUN and the end of the project) one of the most
interesting Smalltalk. Besides having the fastest VM, it is based on
Mixins,
incorporate a type system, new thought about Smalltalk GUI, recomposition
of
reflective Smalltalk aspects. Gilad Bracha gilad.bracha / eng.sun.com
promised
to write a chapter on this amazing Smalltalk."

http://cow.physics.wisc.edu/~craigm/idl/archive/msg00077.html
"The Self group started out at Stanford.  They later
     moved to Sun.  Then, they formed a company
     Animorphic, to commercialize the technology.
     (Apparently, they got the memory consumption back
     down to a reasonable level.)  But, before they
     could, they were bought by Sun.  Sun's HotSpot
     compiler for Java is supposed to be based on
     this technology."

http://lampwww.epfl.ch/events.html
"A High Performance Mixin Implementation (Gilad Bracha, Sun Microsystems)"
 
"We describe the use and implementation of mixins in the Animorphic
Smalltalk system, a high performance Smalltalk virtual machine and
programming environment. Mixins are the basic unit of implementation, and
are directly supported by the VM. At the language level, code can be
defined
either in mixins or in classes, but classes are merely sugar for mixin
definition and application. The Strongtalk type system supports the
optional
static typechecking of mixins in an encapsulated manner. Mixins are used
at
key points in the library. The system is the fastest Smalltalk
implementation to date, typically three times faster than other Smalltalk
implementations. Gilad Bracha received his Ph.D. 1992 from the University
of
Utah. He is now with Sun Microsystems where he worked on the
specifications
of the Java Programming Language and the Java Virtual Machine. He is
currently the specification lead for an effort to extend the language to
support generic types."

Papers
******
"Extending Smalltalk with Mixins" Gilad Bracha and David Griswold,
OOPSLA96 Workshop on Extending the Smalltalk Language,
http://java.sun.com/people/gbracha/mwp.html

Similarities to Ruby's Mixin concept:
 * A mixin can be composed with another mixin, to produce a composite
mixin, in a manner completely analogous to function composition. (I think
the same effect is accomplished in Ruby by including both modules in a
class)

Differences:
 * A mixin is not a class; it must be invoked on an actual superclass 
   parameter to PRODUCE A CLASS.
 
Facts on the company Animorphic Systems
***************************************
Also known as Longview Technologies
(http://developer.java.sun.com/developer/onlineTraining/webcasts/javaone01/rhutcherson.html)

Founded in 1994

Sun aquired them in early 1997
http://java.sun.com/pr/1997/feb/pr970218-01.html
http://www.wired.com/news/topstories/0,1287,6557,00.html

(Technical) People
******************
Urs H÷ýzle, Co-founder of Animorphic systems,
http://www.cs.ucsb.edu/~urs/
http://buffy.eecs.berkeley.edu/Seminars/Old.98/Apr/980413.hoelzle.html
Probably the professor behind most of this (Self, Animorphic and Hotspot)
Principal designer of Java Hotspot
Currently works at google

Gilad Bracha, http://java.sun.com/people/gbracha/
Now at SUN.
I mailed him on the 17/10 2001 and asked him for pointers.

Lars Bak, Lecturer at Aarhus University,
Has course on OO VM implementation
http://www.daimi.au.dk/doc152.html: "...worked on Animorphic systems"
Also worked on Self.

Robert Griesemer, Senior Staff Engineer, HotSpot Client Compiler Group,
Sun Microsystems
"He joined Longview Technologies (aka Animorphic Systems), a newly founded
startup company in Palo Alto, California, in 1994. At Longview, he was
instrumental in designing and implementing Smalltalk and Java virtual
machines. Since 1997 Robert has been with Sun Microsystems where he
continued to work on the Java HotSpot Virtual Machine technology
originally developed at Longview. In particular, he has been responsible
for the design and implementation of the interpreter and much of the
runtime architecture as well as the Client Compiler. He has been the
Technical Lead of the Java HotSpot Virtual Machine team for the last
year."

David Griswold, was President of LongView Technologies
Co-authored some related papers with Bracha and was main author on Sun's
Java Hotspot paper.

David Ungar
Unclear if he was involved but probable.