Virtual Smalltalk Images:
Model and Applications
Guillermo Polito, Stéphane Ducasse, Luc Fabrese,
Noury Bouraqadi
martes 10 de septiembre de 13
The context: Pharo
• Object oriented language
• Dynamic typing
• Highly reflective
• Image based
• Metacircular
2
martes 10 de septiembre de 13
Going meta has limitations[1,2]
Metacircularities
• hidden and uncontrollable dependencies e.g.,
• core libraries (e.g., #do: iteration method)
• core tools (e.g., compiler, debugger)
• Once broken, they are not easily reconstructed
• VM still needed for many tasks (e.g., process manipulation)
3
[1] Bootstrapping reflective languages: the case of Pharo, Polito et al. 2012 (in submission)
[2] The meta in meta-object architectures, Denker et al. 2008
martes 10 de septiembre de 13
Some existing solutions
• Casaccio et al. ’s object spaces[3] allowed atomic
operations on classes
• Bootstrapping a Smalltalk[1] allowed the recreation of an
entire Smalltalk system to alter metacircularities
• Pharo’s emergency evaluator allows recovery of some
critical errors
• Debugging/modifying the virtual machine to have complete
control
• Changes file allows code recovery
• Ad-hoc solutions (copy the class, modify copy, replace...)
4
[1] Bootstrapping reflective languages: the case of Pharo, Polito et al. 2012 (in submission)
[3] Object spaces for safe image surgery, Casaccio et al. 2009
martes 10 de septiembre de 13
What we would like from a
reflective system
• Full control
• Atomicity of changes
• Interactive
• High level tools for system recovery
• Recovery of both code and application data
5
martes 10 de septiembre de 13
Our solution:
Virtual images
with Object Spaces
6
[1] Gwenaël Casaccio, Damien Pollet, Marcus Denker, and Stéphane Ducasse. Object spaces for safe image surgery.
In Proceedings of ESUG International Workshop on Smalltalk Technologies (IWST’09)
• An full image is contained and controlled by another
image
• The container image is the host
• The contained image is the guest
• An Object Space[1] reifies the guest image and allows
the host to manipulate it as an object
martes 10 de septiembre de 13
Object Spaces
martes 10 de septiembre de 13
Oz Object Spaces
the model
8
A reification of a Smalltalk image with two
main components:
• The guest image it contains and encapsulates
• A membrane of objects controlling the communication
between host and guest objects
martes 10 de septiembre de 13
9
Host
Object Object SpaceSmalltalk ImageCaption:
Guest
Object
A
Class
Metaclass
Metaclass
class
Object
Class
Metaclass
Metaclass
class
Oz Object Spaces
the guest image
The Model
martes 10 de septiembre de 13
10
Host
ToolA
ToolB
Object Object SpaceSmalltalk ImageCaption:
Guest
Oz Object Spaces
the membrane
The Model
martes 10 de septiembre de 13
Oz Object Spaces membrane:
the façade
11
• The object space façade is the concrete reification of the
guest image
• Access to well known objects in the object space. e.g., nil,
true and false
• Access to classes in the object space
• Conversion of literals form the host to the guest, and
viceversa
The Model
martes 10 de septiembre de 13
Oz Object Spaces membrane:
mirrors
12
• Direct object manipulation
• Field manipulation: get and set values from object fields
• Size calculation: get the size of objects
• Class access: introspect and modify the class of an
object
• Testing and conversion operations. e.g., #isNil,
#asBoolean
• Some mirrors provide specialized operations. e.g., a
ClassMirror supports the #basicNew operation
The Model
martes 10 de septiembre de 13
Oz Object Spaces
control of execution
13
• Full control of an object space processes via mirrors i.e.,
create, suspend, resume and terminate processes and alter
values of their associated contexts
• Provide controlled windows of time for execution to an
object space
The Model
martes 10 de septiembre de 13
Oz Object Spaces
control of communication
14
• One way communication: host to guest
• Communication is achieved by creating and injecting
objects into the object space
• Mirrors ensure that object injection is safe and fulfills the
transitive closure property
• Sending messages: the particular case of injecting a process
with the desired code and introspect its result after
finished
• Literal translation from and to guest and host
The Model
martes 10 de septiembre de 13
Oz Object Spaces
applications
15
• Image surgery
• Image recovery and better Emergency Kernel
• Controlled interruption
• Image side Stack overflow and infinite loop detection
• Sandboxing
martes 10 de septiembre de 13
TheVision
16
• Many versions of the system running side by side
• Controlling resources at the language level
• Secure
• Completely modifiable and adaptable (while running)
• Specialized for particular needs
• With tools to analyze, modify and fix a system
• System surgeon
• System browsing and debugging
martes 10 de septiembre de 13
17
Virtual Smalltalk Images:
Model and Applications
• Oz Object spaces reify full Pharo images
• Irrestricted manipulation of guest’s objects through mirrors
• Control of guest’s execution
martes 10 de septiembre de 13
Behind Oz Object Spaces:
the implementation
18
martes 10 de septiembre de 13
Oz Object Spaces
the implementation
19
We implemented Oz on top of Pharo20:
• Virtual machine support for multiple images
• Image side library to install in the host (implementing the
membrane objects)
martes 10 de septiembre de 13
Oz Object Spaces
Challenging infrastructure
20
• Special Objects Array: an array theVM uses to
understand the running image objects i.e., the nil, true and
false instances, the compact classes, etc
• Green Threads: concurrency is managed with reified
user-level threads, the Process instances. No real
multithreading is supported
• VM Single Interpreter Assumptions: global
variables all around, plugin are single-interpreter aware
The Implementation
martes 10 de septiembre de 13
Host and Guest images share the same heap
• Reuse of VM memory mechanisms
• No extraVM support to handle cross-image references
• Shared garbage collection
Oz Object Spaces
memory layout
21
The Implementation
nil
host
false
host
true
host
nil
guest
false
guest
true
guest
'hi!'
host
... ... ...
The Object Memory
martes 10 de septiembre de 13
Oz Object Spaces
mirror implementation
22
The Implementation
Mirrors manipulate objects through two
main primitives:
• Execute a method on an object
• Try a primitive on an object
Mirror hierarchy based on roles and internal
structure
• ObjectMirror, ByteObjectMirror, WordObjectMirror
• ClassMirror, MethodDictionaryMirror, ProcessMirror
martes 10 de septiembre de 13
Oz Object Spaces
process manipulation
23
• Processes are simple objects
• In the host, they are represented through ProcessMirror,
ProcessSchedulerMirror and ContextMirror
• Mirrors allow manipulation and maintain consistency of the
process model
The Implementation
martes 10 de septiembre de 13
Oz Object Spaces
context switch
24
The Implementation
Execution of code inside an object space is
based on a context switch:
1. TheVM installs the object space as the current
environment to run
2. Runs until being preempted
3. Gives control back to the host
martes 10 de septiembre de 13
Oz Object Spaces
Pharo image contract
25
The Implementation
An image contract is composed by:
• Services: reachable objects from the image’s root. e.g.,
nil, true, false, the SystemDictionary. They appear in the
special objects array (the root object of an image).
• Format of the objects: amount and meaning of the
instance variables of core objects.They are configured in
the membrane.
martes 10 de septiembre de 13
26
Virtual Smalltalk Images:
Model and Applications
• Oz Object spaces reify full Pharo images
• Irrestricted manipulation of guest’s objects through mirrors
• Control of guest’s execution
martes 10 de septiembre de 13

More Related Content

PDF
Virtual Smalltalk Images - IWST - ESUG 2013
PPT
Business models and Virtual Worlds: The Second Life lesson
PDF
A Security Model for Virtual Infrastructure in the Cloud
DOCX
IMPORTING 3DS MODELS INTO VIRTUAL BATTLESPACE2
PPTX
September 23 2015 NISO Virtual Conference: Scholarly Communication Models: Ev...
PDF
PDF
Robotlegs AS3 from Flash and the City 2010
PPTX
Exploring metaprogramming using Ruby language
Virtual Smalltalk Images - IWST - ESUG 2013
Business models and Virtual Worlds: The Second Life lesson
A Security Model for Virtual Infrastructure in the Cloud
IMPORTING 3DS MODELS INTO VIRTUAL BATTLESPACE2
September 23 2015 NISO Virtual Conference: Scholarly Communication Models: Ev...
Robotlegs AS3 from Flash and the City 2010
Exploring metaprogramming using Ruby language

Similar to Virtual Smalltalk Images: Model and Applications (20)

PDF
Doug McCune - Using Open Source Flex and ActionScript Projects
PPT
10 reflection
PDF
Object garphs swapping
PDF
Virtual EMF - Standard talk at EclipseCon Europe 2011
PDF
Introduction - Lecture 1 - Advanced Topics in Information Systems (WE-DINF-15...
PDF
Mars - ESUG 2010
PDF
Smalltalk and ruby - 2012-12-08
PPTX
Visitor Pattern
PDF
Bringing OpenAPI to Your devOps
PPT
Framework for Evaluating Distributed Smalltalk Interface
PDF
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
PDF
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
PDF
Software Architecture: views and viewpoints
PDF
VASmalltalk, Today and Tomorrow
KEY
Using Smalltalk for controlling robotics systems
PPT
Oo Design And Patterns
PDF
Curation and Characterization of Web Services
PDF
Twisting the Triad
PPT
Doug McCune - Using Open Source Flex and ActionScript Projects
10 reflection
Object garphs swapping
Virtual EMF - Standard talk at EclipseCon Europe 2011
Introduction - Lecture 1 - Advanced Topics in Information Systems (WE-DINF-15...
Mars - ESUG 2010
Smalltalk and ruby - 2012-12-08
Visitor Pattern
Bringing OpenAPI to Your devOps
Framework for Evaluating Distributed Smalltalk Interface
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
JDD2015: Sustainability Supporting Data Variability: Keeping Core Components ...
Software Architecture: views and viewpoints
VASmalltalk, Today and Tomorrow
Using Smalltalk for controlling robotics systems
Oo Design And Patterns
Curation and Characterization of Web Services
Twisting the Triad
Ad

More from ESUG (20)

PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
PDF
Directing Generative AI for Pharo Documentation
PDF
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
PDF
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
PDF
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
PDF
Analysing Python Machine Learning Notebooks with Moose
PDF
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
PDF
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
PDF
Package-Aware Approach for Repository-Level Code Completion in Pharo
PDF
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
PDF
An Analysis of Inline Method Refactoring
PDF
Identification of unnecessary object allocations using static escape analysis
PDF
Control flow-sensitive optimizations In the Druid Meta-Compiler
PDF
Clean Blocks (IWST 2025, Gdansk, Poland)
PDF
Encoding for Objects Matters (IWST 2025)
PDF
Challenges of Transpiling Smalltalk to JavaScript
PDF
Immersive experiences: what Pharo users do!
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
PDF
Cavrois - an Organic Window Management (ESUG 2025)
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
Micromaid: A simple Mermaid-like chart generator for Pharo
Directing Generative AI for Pharo Documentation
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
Analysing Python Machine Learning Notebooks with Moose
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
Package-Aware Approach for Repository-Level Code Completion in Pharo
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
An Analysis of Inline Method Refactoring
Identification of unnecessary object allocations using static escape analysis
Control flow-sensitive optimizations In the Druid Meta-Compiler
Clean Blocks (IWST 2025, Gdansk, Poland)
Encoding for Objects Matters (IWST 2025)
Challenges of Transpiling Smalltalk to JavaScript
Immersive experiences: what Pharo users do!
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
Cavrois - an Organic Window Management (ESUG 2025)
Ad

Recently uploaded (20)

PDF
A review of recent deep learning applications in wood surface defect identifi...
PPT
Geologic Time for studying geology for geologist
PPTX
The various Industrial Revolutions .pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Tartificialntelligence_presentation.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPT
What is a Computer? Input Devices /output devices
PPTX
Benefits of Physical activity for teenagers.pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
A review of recent deep learning applications in wood surface defect identifi...
Geologic Time for studying geology for geologist
The various Industrial Revolutions .pptx
WOOl fibre morphology and structure.pdf for textiles
sustainability-14-14877-v2.pddhzftheheeeee
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Tartificialntelligence_presentation.pptx
1 - Historical Antecedents, Social Consideration.pdf
A novel scalable deep ensemble learning framework for big data classification...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Final SEM Unit 1 for mit wpu at pune .pptx
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
A contest of sentiment analysis: k-nearest neighbor versus neural network
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
O2C Customer Invoices to Receipt V15A.pptx
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
What is a Computer? Input Devices /output devices
Benefits of Physical activity for teenagers.pptx
Module 1.ppt Iot fundamentals and Architecture
Univ-Connecticut-ChatGPT-Presentaion.pdf

Virtual Smalltalk Images: Model and Applications

  • 1. Virtual Smalltalk Images: Model and Applications Guillermo Polito, Stéphane Ducasse, Luc Fabrese, Noury Bouraqadi martes 10 de septiembre de 13
  • 2. The context: Pharo • Object oriented language • Dynamic typing • Highly reflective • Image based • Metacircular 2 martes 10 de septiembre de 13
  • 3. Going meta has limitations[1,2] Metacircularities • hidden and uncontrollable dependencies e.g., • core libraries (e.g., #do: iteration method) • core tools (e.g., compiler, debugger) • Once broken, they are not easily reconstructed • VM still needed for many tasks (e.g., process manipulation) 3 [1] Bootstrapping reflective languages: the case of Pharo, Polito et al. 2012 (in submission) [2] The meta in meta-object architectures, Denker et al. 2008 martes 10 de septiembre de 13
  • 4. Some existing solutions • Casaccio et al. ’s object spaces[3] allowed atomic operations on classes • Bootstrapping a Smalltalk[1] allowed the recreation of an entire Smalltalk system to alter metacircularities • Pharo’s emergency evaluator allows recovery of some critical errors • Debugging/modifying the virtual machine to have complete control • Changes file allows code recovery • Ad-hoc solutions (copy the class, modify copy, replace...) 4 [1] Bootstrapping reflective languages: the case of Pharo, Polito et al. 2012 (in submission) [3] Object spaces for safe image surgery, Casaccio et al. 2009 martes 10 de septiembre de 13
  • 5. What we would like from a reflective system • Full control • Atomicity of changes • Interactive • High level tools for system recovery • Recovery of both code and application data 5 martes 10 de septiembre de 13
  • 6. Our solution: Virtual images with Object Spaces 6 [1] Gwenaël Casaccio, Damien Pollet, Marcus Denker, and Stéphane Ducasse. Object spaces for safe image surgery. In Proceedings of ESUG International Workshop on Smalltalk Technologies (IWST’09) • An full image is contained and controlled by another image • The container image is the host • The contained image is the guest • An Object Space[1] reifies the guest image and allows the host to manipulate it as an object martes 10 de septiembre de 13
  • 7. Object Spaces martes 10 de septiembre de 13
  • 8. Oz Object Spaces the model 8 A reification of a Smalltalk image with two main components: • The guest image it contains and encapsulates • A membrane of objects controlling the communication between host and guest objects martes 10 de septiembre de 13
  • 9. 9 Host Object Object SpaceSmalltalk ImageCaption: Guest Object A Class Metaclass Metaclass class Object Class Metaclass Metaclass class Oz Object Spaces the guest image The Model martes 10 de septiembre de 13
  • 10. 10 Host ToolA ToolB Object Object SpaceSmalltalk ImageCaption: Guest Oz Object Spaces the membrane The Model martes 10 de septiembre de 13
  • 11. Oz Object Spaces membrane: the façade 11 • The object space façade is the concrete reification of the guest image • Access to well known objects in the object space. e.g., nil, true and false • Access to classes in the object space • Conversion of literals form the host to the guest, and viceversa The Model martes 10 de septiembre de 13
  • 12. Oz Object Spaces membrane: mirrors 12 • Direct object manipulation • Field manipulation: get and set values from object fields • Size calculation: get the size of objects • Class access: introspect and modify the class of an object • Testing and conversion operations. e.g., #isNil, #asBoolean • Some mirrors provide specialized operations. e.g., a ClassMirror supports the #basicNew operation The Model martes 10 de septiembre de 13
  • 13. Oz Object Spaces control of execution 13 • Full control of an object space processes via mirrors i.e., create, suspend, resume and terminate processes and alter values of their associated contexts • Provide controlled windows of time for execution to an object space The Model martes 10 de septiembre de 13
  • 14. Oz Object Spaces control of communication 14 • One way communication: host to guest • Communication is achieved by creating and injecting objects into the object space • Mirrors ensure that object injection is safe and fulfills the transitive closure property • Sending messages: the particular case of injecting a process with the desired code and introspect its result after finished • Literal translation from and to guest and host The Model martes 10 de septiembre de 13
  • 15. Oz Object Spaces applications 15 • Image surgery • Image recovery and better Emergency Kernel • Controlled interruption • Image side Stack overflow and infinite loop detection • Sandboxing martes 10 de septiembre de 13
  • 16. TheVision 16 • Many versions of the system running side by side • Controlling resources at the language level • Secure • Completely modifiable and adaptable (while running) • Specialized for particular needs • With tools to analyze, modify and fix a system • System surgeon • System browsing and debugging martes 10 de septiembre de 13
  • 17. 17 Virtual Smalltalk Images: Model and Applications • Oz Object spaces reify full Pharo images • Irrestricted manipulation of guest’s objects through mirrors • Control of guest’s execution martes 10 de septiembre de 13
  • 18. Behind Oz Object Spaces: the implementation 18 martes 10 de septiembre de 13
  • 19. Oz Object Spaces the implementation 19 We implemented Oz on top of Pharo20: • Virtual machine support for multiple images • Image side library to install in the host (implementing the membrane objects) martes 10 de septiembre de 13
  • 20. Oz Object Spaces Challenging infrastructure 20 • Special Objects Array: an array theVM uses to understand the running image objects i.e., the nil, true and false instances, the compact classes, etc • Green Threads: concurrency is managed with reified user-level threads, the Process instances. No real multithreading is supported • VM Single Interpreter Assumptions: global variables all around, plugin are single-interpreter aware The Implementation martes 10 de septiembre de 13
  • 21. Host and Guest images share the same heap • Reuse of VM memory mechanisms • No extraVM support to handle cross-image references • Shared garbage collection Oz Object Spaces memory layout 21 The Implementation nil host false host true host nil guest false guest true guest 'hi!' host ... ... ... The Object Memory martes 10 de septiembre de 13
  • 22. Oz Object Spaces mirror implementation 22 The Implementation Mirrors manipulate objects through two main primitives: • Execute a method on an object • Try a primitive on an object Mirror hierarchy based on roles and internal structure • ObjectMirror, ByteObjectMirror, WordObjectMirror • ClassMirror, MethodDictionaryMirror, ProcessMirror martes 10 de septiembre de 13
  • 23. Oz Object Spaces process manipulation 23 • Processes are simple objects • In the host, they are represented through ProcessMirror, ProcessSchedulerMirror and ContextMirror • Mirrors allow manipulation and maintain consistency of the process model The Implementation martes 10 de septiembre de 13
  • 24. Oz Object Spaces context switch 24 The Implementation Execution of code inside an object space is based on a context switch: 1. TheVM installs the object space as the current environment to run 2. Runs until being preempted 3. Gives control back to the host martes 10 de septiembre de 13
  • 25. Oz Object Spaces Pharo image contract 25 The Implementation An image contract is composed by: • Services: reachable objects from the image’s root. e.g., nil, true, false, the SystemDictionary. They appear in the special objects array (the root object of an image). • Format of the objects: amount and meaning of the instance variables of core objects.They are configured in the membrane. martes 10 de septiembre de 13
  • 26. 26 Virtual Smalltalk Images: Model and Applications • Oz Object spaces reify full Pharo images • Irrestricted manipulation of guest’s objects through mirrors • Control of guest’s execution martes 10 de septiembre de 13