[Vm-dev] informations about pharo'VM

Eliot Miranda eliot.miranda at gmail.com
Tue Apr 4 18:31:06 UTC 2017


Hi Ben,

On Mon, Apr 3, 2017 at 6:30 PM, Ben Coman <btc at openinworld.com> wrote:

>
>
>
> On Tue, Apr 4, 2017 at 5:59 AM, Paul DeBruicker <pdebruic at gmail.com>
> wrote:
>
>>
>> The blue book
>> http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.pdf
>>
>>
>> and all the info on this blog should get you started
>>
>> http://www.mirandabanda.org/cogblog/about-cog/
>>
>>
>>
>> michel sangala wrote
>> > Good morning, i want to know all about pharo'VM, books and notes, i also
>> > want to know differences between pharo'VM and JavaVM, thanks a lot
>>
>>
> At its most concise:
> * #become:
> * resumable exceptions
> * message passing
> * its just an execution engine
>

I see three important things missing, contexts, self-definition and
doesNotUnderstand:.

Contexts are really important to Smalltalk-80 Smalltalks (true
Smalltalks).  Smalltalk provides access to the current activation record
from the language.  Hence the exception system is largely above the VM.
The only thing that needs to be in the VM is unwind-protect.  Everything
else (exception search, handler activation) can be done by walking the
linked list of method activations starting from thisContext.  Hence the
debugger is written entirely in Salltalk and execution can be simulated
above the VM by sending messages to contexts to ask them to interpret their
methods' bytecodes.  Hence processes can be serialized, exchanged between
images, etc.

Self-definition (why the VM is just an execution engine):  All the objects
that comprise a Smalltalk program are themselves defined by Smalltalk
classes.  So classes are general instances of Class or Metaclass (instances
of specific metaclasses that inherit from either Class or Metaclass).
Methods are instances of CompiledMethod.  Activation records are instances
of class Context (MethodContext or BlockContext in older versions).  Hence
the compiler is written in Smalltalk and does not live in the VM.

doesNotUnderstand:, a key part of message passing.  When a message is sent
to an object and that object's class, nor any superclass of the class
implements a method with the message's selector, the VM reifies the message
as an instance of Message (holding selector and arguments) and sends
doesNotUnderstand: to the object with the message as an argument.  Hence
Smalltalk provides transparent proxies that can catch messages and forward
them.  Implement a class that doesn't inherit from Object and implements
doesNotUnderstand: and its instances catch any and all messages sent to
them.


>
> The links below expand on these, except the last which I'll expand on
> briefly.
>
> IIUC, the JVM class libraries are often considered part of the VM.  With
> Smalltalk, the class libraries are part of *your* Image, written in
> Smalltalk (you have direct access to understanding and debugging them in
> the context of your running application).  The Pharo VM provides only:
> * bytecode interpreter
> * JIT bytecode to machine code compilation
> * memory allocation
> * primitives hiding platform differences
> * primitives accelerating speed sensitive activities
>
>
> https://gbracha.blogspot.com.au/2009/07/miracle-of-become.html
>
> http://stackoverflow.com/questions/18231382/java-equivalent-of-smalltalks-
> become
>
>
> http://forum.world.st/Debugging-in-Production-
> Servers-tp4756136p4756337.html
>
> http://scg.unibe.ch/archive/papers/Vran12a.pdf
>
> http://swing.fit.cvut.cz/projects/stx/doc/online/english/programming/
> stForJavaGuys.html
>
> https://pdfs.semanticscholar.org/a0e2/5003010f1e2e3af958208ac9a540c8
> c7bc4b.pdf
>
> http://stackoverflow.com/questions/3102695/what-are-
> the-key-differences-between-oo-in-smalltalk-and-java
>
> http://stackoverflow.com/questions/5638052/is-it-really-all-about-message-
> passing-in-smalltalk/5638259
>
> http://softwareengineering.stackexchange.com/questions/
> 140602/what-is-message-passing-in-oo
>
> https://www.quora.com/What-is-the-difference-between-
> message-passing-versus-calling-a-function-method-invocation
>
>
> btw, note that the Pharo VM is a branding of the OpenSmalltalk-VM,
>    https://github.com/OpenSmalltalk/opensmalltalk-vm
> which is the original Squeak-VM renamed, since there are now several
> downstream consumers: Pharo, Squeak, Cuis & Newspeak.
>
>
> cheers -ben
>
> P.S. just an aside for anyone unfamiliar with reading Smalltalk syntax...
> http://www2.ing.unipi.it/~a009435/issw/extra/readingSmalltalk.pdf
>
>
>
>


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170404/eb3de965/attachment.html>


More information about the Vm-dev mailing list