<div dir="ltr">Hi Ben,<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 3, 2017 at 6:30 PM, Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 4, 2017 at 5:59 AM, Paul DeBruicker <span dir="ltr"><<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
The blue book<br>
<a href="http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.pdf" rel="noreferrer" target="_blank">http://stephane.ducasse.free.f<wbr>r/FreeBooks/BlueBook/Bluebook.<wbr>pdf</a><br>
<br><br>
and all the info on this blog should get you started<br>
<br>
<a href="http://www.mirandabanda.org/cogblog/about-cog/" rel="noreferrer" target="_blank">http://www.mirandabanda.org/co<wbr>gblog/about-cog/</a><br>
<br>
<br><br>
michel sangala wrote<br>
> Good morning, i want to know all about pharo'VM, books and notes, i also<br>
> want to know differences between pharo'VM and JavaVM, thanks a lot<br><br>
</blockquote></div><br></div><div class="gmail_extra">At its most concise:</div><div class="gmail_extra">* #become:</div><div class="gmail_extra">* resumable exceptions<br></div><div class="gmail_extra">* message passing<br></div><div class="gmail_extra">* its just an execution engine<br></div></div></blockquote><div><br></div><div>I see three important things missing, contexts, self-definition and doesNotUnderstand:.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra"><div class="gmail_extra"><br></div></div><div class="gmail_extra">The links below expand on these, except the last which I'll expand on briefly.</div><div class="gmail_extra"><br></div><div class="gmail_extra">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: </div><div class="gmail_extra">* bytecode interpreter</div><div class="gmail_extra">* JIT bytecode to machine code compilation</div><div class="gmail_extra">* memory allocation</div><div class="gmail_extra">* primitives hiding platform differences</div><div class="gmail_extra">* primitives accelerating speed sensitive activities</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://gbracha.blogspot.com.au/2009/07/miracle-of-become.html" target="_blank">https://gbracha.blogspot.com.<wbr>au/2009/07/miracle-of-become.<wbr>html</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://stackoverflow.com/questions/18231382/java-equivalent-of-smalltalks-become" target="_blank">http://stackoverflow.com/<wbr>questions/18231382/java-<wbr>equivalent-of-smalltalks-<wbr>become</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://forum.world.st/Debugging-in-Production-Servers-tp4756136p4756337.html" target="_blank">http://forum.world.st/<wbr>Debugging-in-Production-<wbr>Servers-tp4756136p4756337.html</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://scg.unibe.ch/archive/papers/Vran12a.pdf" target="_blank">http://scg.unibe.ch/archive/<wbr>papers/Vran12a.pdf</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://swing.fit.cvut.cz/projects/stx/doc/online/english/programming/stForJavaGuys.html" target="_blank">http://swing.fit.cvut.cz/<wbr>projects/stx/doc/online/<wbr>english/programming/<wbr>stForJavaGuys.html</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://pdfs.semanticscholar.org/a0e2/5003010f1e2e3af958208ac9a540c8c7bc4b.pdf" target="_blank">https://pdfs.semanticscholar.<wbr>org/a0e2/<wbr>5003010f1e2e3af958208ac9a540c8<wbr>c7bc4b.pdf</a></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://stackoverflow.com/questions/3102695/what-are-the-key-differences-between-oo-in-smalltalk-and-java" target="_blank">http://stackoverflow.com/<wbr>questions/3102695/what-are-<wbr>the-key-differences-between-<wbr>oo-in-smalltalk-and-java</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://stackoverflow.com/questions/5638052/is-it-really-all-about-message-passing-in-smalltalk/5638259" target="_blank">http://stackoverflow.com/<wbr>questions/5638052/is-it-<wbr>really-all-about-message-<wbr>passing-in-smalltalk/5638259</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="http://softwareengineering.stackexchange.com/questions/140602/what-is-message-passing-in-oo" target="_blank">http://softwareengineering.<wbr>stackexchange.com/questions/<wbr>140602/what-is-message-<wbr>passing-in-oo</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><a href="https://www.quora.com/What-is-the-difference-between-message-passing-versus-calling-a-function-method-invocation" target="_blank">https://www.quora.com/What-is-<wbr>the-difference-between-<wbr>message-passing-versus-<wbr>calling-a-function-method-<wbr>invocation</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">btw, note that the Pharo VM is a branding of the OpenSmalltalk-VM, </div><div class="gmail_extra">   <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm" target="_blank">https://github.com/<wbr>OpenSmalltalk/opensmalltalk-vm</a><br></div><div class="gmail_extra">which is the original Squeak-VM renamed, since there are now several</div><div class="gmail_extra">downstream consumers: Pharo, Squeak, Cuis & Newspeak. </div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">cheers -ben<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">P.S. just an aside for anyone unfamiliar with reading Smalltalk syntax...</div><div class="gmail_extra"><a href="http://www2.ing.unipi.it/~a009435/issw/extra/readingSmalltalk.pdf" target="_blank">http://www2.ing.unipi.it/~<wbr>a009435/issw/extra/<wbr>readingSmalltalk.pdf</a></div><div><br></div></div><div class="gmail_extra"><br></div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>