SlideShare a Scribd company logo
1 of 26
Download to read offline
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

Similar to Virtual Smalltalk Images: Model and Applications

Speeding up mobile web apps
Speeding up mobile web appsSpeeding up mobile web apps
Speeding up mobile web appsIvano Malavolta
 
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
[KubeCon EU 2021] Introduction and Deep Dive Into ContainerdAkihiro Suda
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdKohei Tokunaga
 
SQL Queries on Smalltalk Objects
SQL Queries on Smalltalk ObjectsSQL Queries on Smalltalk Objects
SQL Queries on Smalltalk ObjectsESUG
 
App specific app architecture
App specific app architectureApp specific app architecture
App specific app architecturePetr Zvoníček
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cFrank Munz
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascriptAyush Sharma
 
Tugrik: A new persistence option for Pharo
Tugrik: A new persistence option for PharoTugrik: A new persistence option for Pharo
Tugrik: A new persistence option for PharoESUG
 
Scriptable Objects in Unity Game Engine (C#)
Scriptable Objects in Unity Game Engine (C#)Scriptable Objects in Unity Game Engine (C#)
Scriptable Objects in Unity Game Engine (C#)Om Shridhar
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....AboutYouGmbH
 
History of Object Orientation in OOP.ppt
History of Object Orientation in OOP.pptHistory of Object Orientation in OOP.ppt
History of Object Orientation in OOP.pptathar549116
 
History of Object Orientation in OOP.ppt
History of Object Orientation in OOP.pptHistory of Object Orientation in OOP.ppt
History of Object Orientation in OOP.pptMuhammad Athar
 
The Contextual Wizard of Oz
The Contextual Wizard of OzThe Contextual Wizard of Oz
The Contextual Wizard of OzThomas Grill
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciRajesh Kolla
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overviewNicolaas Matthijs
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 

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

Decorator design pattern
Decorator design patternDecorator design pattern
Decorator design pattern
 
Speeding up mobile web apps
Speeding up mobile web appsSpeeding up mobile web apps
Speeding up mobile web apps
 
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
SQL Queries on Smalltalk Objects
SQL Queries on Smalltalk ObjectsSQL Queries on Smalltalk Objects
SQL Queries on Smalltalk Objects
 
Containers 101
Containers 101Containers 101
Containers 101
 
App specific app architecture
App specific app architectureApp specific app architecture
App specific app architecture
 
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12cDocker in the Oracle Universe / WebLogic 12c / OFM 12c
Docker in the Oracle Universe / WebLogic 12c / OFM 12c
 
Design patterns in javascript
Design patterns in javascriptDesign patterns in javascript
Design patterns in javascript
 
Tugrik: A new persistence option for Pharo
Tugrik: A new persistence option for PharoTugrik: A new persistence option for Pharo
Tugrik: A new persistence option for Pharo
 
Scriptable Objects in Unity Game Engine (C#)
Scriptable Objects in Unity Game Engine (C#)Scriptable Objects in Unity Game Engine (C#)
Scriptable Objects in Unity Game Engine (C#)
 
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
 
History of Object Orientation in OOP.ppt
History of Object Orientation in OOP.pptHistory of Object Orientation in OOP.ppt
History of Object Orientation in OOP.ppt
 
History of Object Orientation in OOP.ppt
History of Object Orientation in OOP.pptHistory of Object Orientation in OOP.ppt
History of Object Orientation in OOP.ppt
 
The Contextual Wizard of Oz
The Contextual Wizard of OzThe Contextual Wizard of Oz
The Contextual Wizard of Oz
 
Manasa
ManasaManasa
Manasa
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aci
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overview
 
Stoop 437-proxy
Stoop 437-proxyStoop 437-proxy
Stoop 437-proxy
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Recently uploaded (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.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