CPU running smalltalk bytecode

Jerzy Karczmarczuk karczma at info.unicaen.fr
Fri Feb 8 11:12:26 UTC 2002


Hannes Hirzel response addressed to:


> Bergel Alexandre wrote:
> 
> > I have not work at a such low level, but I have some questions. VMs for 
> > Java, Smalltalk, OCaml seems to be almost the same. Each one contain 
> > features for :
> >       -stack based
> >       -Garbage Collector
> >       -lookup method
> >
> > Also, I have heard Lex talking about a CPU able to run Smalltalk platform.
> > Is it possible to have more information about it ? Perhaps next generation 
> > of CPU (Motorola, Intel, AMD, ...) could include such features...
> 
> Not directly an answer to your question but a link to a related
> area: virtual machines have a twenty or thirty years history in computer
> science and are nowadays becoming mainstream, most notably that MS
> embraces the concept with the .NET initiative (and the Common Language
> Runtime - a VM)


Just some 1.5 eurocents...

Virtual machines are there not for twenty or so, but for sixty years, and
perhaps more (shall we begin with Babbage?). The more-or-less abstract models
of computation co-exist with all practical realizations. Lisp and APL started
as "models" rather than directly as implementations.

The "posfix-code" calculator, i.e. a stack machine is the kernel of PostScript,
Forth, was the target of the first Lisp non-native compilers, and the target
of the native compilation of Algol60 on Burroughs (something-09?) which had
a hardware stack.

So, from the fact that some very different languages are based on stacked
data, that they dispose of the full dynamic memory allocation machinery, etc.
we cannot conclude too much. The devil is in the details. Standard Caml has
no need for method lookup. OCaml more...

"Virtual function" indirections sometimes can be realized in hardware; the FORTH
interpreter on Motorola 6809 was faster than "C". But RISCs usually can't do
it, and in general with paged memories such indirections are costly. 

I don't touch such low-level issues either, but I suspect that modern hardware
architectures are optimized to perform fast memory bloc transfers, and to cache
loops (with all addresses decoded statically). The flexibility of Smalltalk
(and of Lisp) does not go well with such a doctrine.

Less flexible VMachines, which don't recognize any "bytecodes", but use
threading
are faster. But I suspect that basing Smalltalk on a (say, indirect) threaded
code would be non-trivial. Anybody ever tried?


Jerzy Karczmarczuk
Caen, France

PS. Often the "hardware" is a micro-coded virtual machine as well.
    And we know that all them electrons, semiconductor energy bands, and
    other quantum fuzzy whatever are virtual "things" in this best of
    all virtual worlds we could buy...
    [References: books of Phillip Dick]



More information about the Squeak-dev mailing list