SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Virtual Smalltalk Images:
Model and Applications
Guillermo Polito, Stéphane Ducasse, Luc Fabrese,
Noury Bouraqadi

jueves 31 de octubre de 13
The context: Pharo

• Object oriented language
• Dynamic typing
• Highly reflective
• Image based
• Metacircular
2
jueves 31 de octubre 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)

[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

3
jueves 31 de octubre 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...)

[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

4
jueves 31 de octubre 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
jueves 31 de octubre de 13
Our solution:
Virtual images
with Object Spaces
•

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

[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)

6
jueves 31 de octubre de 13
Object Spaces

jueves 31 de octubre de 13
Oz Object Spaces
the model
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

8
jueves 31 de octubre de 13
Oz Object Spaces
the guest image

The Model

Host
Metaclass

Guest

Class
Metaclass
class

Metaclass
Class

Object

Metaclass
class

A

Caption:

Object

Smalltalk Image

Object
9

jueves 31 de octubre de 13

Object Space
Oz Object Spaces
the membrane

The Model

Host

ToolA

Guest
ToolB

Caption:

Smalltalk Image

Object
10

jueves 31 de octubre de 13

Object Space
The Model

Oz Object Spaces membrane:
the façade
•

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

11
jueves 31 de octubre de 13
The Model

Oz Object Spaces membrane:
mirrors
•

Direct object manipulation
Field manipulation: get and set values from object fields

•
•

•
•
•

Testing and conversion operations. e.g., #isNil,
#asBoolean

Size calculation: get the size of objects
Class access: introspect and modify the class of an
object

Some mirrors provide specialized operations. e.g., a
ClassMirror supports the #basicNew operation
12

jueves 31 de octubre de 13
The Model

Oz Object Spaces
control of execution
•

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

13
jueves 31 de octubre de 13
The Model

Oz Object Spaces
control of communication
•
•

One way communication: host to guest

•

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

Communication is achieved by creating and injecting
objects into the object space

14
jueves 31 de octubre de 13
Oz Object Spaces
applications
•
•
•
•
•

Image surgery
Image recovery and better Emergency Kernel
Controlled interruption
Image side Stack overflow and infinite loop detection
Sandboxing

15
jueves 31 de octubre de 13
The Vision
•
•
•
•
•
•

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
16

jueves 31 de octubre de 13
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

17
jueves 31 de octubre de 13
Behind Oz Object Spaces:
the implementation

18
jueves 31 de octubre de 13
Oz Object Spaces
the implementation
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)

19
jueves 31 de octubre de 13
The Implementation

Oz Object Spaces
Challenging infrastructure
•

Special Objects Array: an array the VM 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

20
jueves 31 de octubre de 13
The Implementation

Oz Object Spaces
memory layout

Host and Guest images share the same heap
The Object Memory

nil
host

•
•
•

false true
host

nil

...

host

guest

false true
guest

guest

...

'hi!'

...

host

Reuse of VM memory mechanisms
No extra VM support to handle cross-image references
Shared garbage collection
21

jueves 31 de octubre de 13
The Implementation

Oz Object Spaces
mirror 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
22

jueves 31 de octubre de 13
The Implementation

Oz Object Spaces
process manipulation
•
•

Processes are simple objects

•

Mirrors allow manipulation and maintain consistency of the
process model

In the host, they are represented through ProcessMirror,
ProcessSchedulerMirror and ContextMirror

23
jueves 31 de octubre de 13
The Implementation

Oz Object Spaces
context switch

Execution of code inside an object space is
based on a context switch:
1. The VM installs the object space as the current
environment to run
2. Runs until being preempted
3. Gives control back to the host

24
jueves 31 de octubre de 13
The Implementation

Oz Object Spaces
Pharo image contract
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.

25
jueves 31 de octubre de 13
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

26
jueves 31 de octubre de 13

Más contenido relacionado

Ähnlich wie Virtual Smalltalk Images - IWST - ESUG 2013

Android 1.5 to 3.0: a compatibility journey
Android 1.5 to 3.0: a compatibility journeyAndroid 1.5 to 3.0: a compatibility journey
Android 1.5 to 3.0: a compatibility journeyEmanuele Di Saverio
 
Project Universe – Context-aware Project Management System
Project Universe – Context-aware Project Management SystemProject Universe – Context-aware Project Management System
Project Universe – Context-aware Project Management SystemDaniel Kornev
 
Artificial Intelligence, Machine Learning and Deep Learning
Artificial Intelligence, Machine Learning and Deep LearningArtificial Intelligence, Machine Learning and Deep Learning
Artificial Intelligence, Machine Learning and Deep LearningSujit Pal
 
Introduction to-cocos2d
Introduction to-cocos2dIntroduction to-cocos2d
Introduction to-cocos2dsagaroceanic11
 
nunuStudio Geometrix 2017
nunuStudio Geometrix 2017nunuStudio Geometrix 2017
nunuStudio Geometrix 2017José Ferrão
 
The Contextual Wizard of Oz
The Contextual Wizard of OzThe Contextual Wizard of Oz
The Contextual Wizard of OzThomas Grill
 
App specific app architecture
App specific app architectureApp specific app architecture
App specific app architecturePetr Zvoníček
 
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
 
Object detection with deep learning
Object detection with deep learningObject detection with deep learning
Object detection with deep learningSushant Shrivastava
 
Attacking and Auditing Containers - Nishith Khadadiya
Attacking and Auditing Containers - Nishith KhadadiyaAttacking and Auditing Containers - Nishith Khadadiya
Attacking and Auditing Containers - Nishith KhadadiyaNSConclave
 
Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Marakana Inc.
 
Structural organization and architecture of a virtual reality explorer
Structural organization and architecture of a virtual reality explorerStructural organization and architecture of a virtual reality explorer
Structural organization and architecture of a virtual reality explorerPrachi Gupta
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patternsKyle Drake
 
Promises of Deep Learning
Promises of Deep LearningPromises of Deep Learning
Promises of Deep LearningDavid Khosid
 
7 characteristics of container-native infrastructure, Docker Zurich 2015-09-08
7 characteristics of container-native infrastructure, Docker Zurich 2015-09-087 characteristics of container-native infrastructure, Docker Zurich 2015-09-08
7 characteristics of container-native infrastructure, Docker Zurich 2015-09-08Casey Bisson
 

Ähnlich wie Virtual Smalltalk Images - IWST - ESUG 2013 (20)

Android 1.5 to 3.0: a compatibility journey
Android 1.5 to 3.0: a compatibility journeyAndroid 1.5 to 3.0: a compatibility journey
Android 1.5 to 3.0: a compatibility journey
 
Design_Patterns_Dr.CM.ppt
Design_Patterns_Dr.CM.pptDesign_Patterns_Dr.CM.ppt
Design_Patterns_Dr.CM.ppt
 
Project Universe – Context-aware Project Management System
Project Universe – Context-aware Project Management SystemProject Universe – Context-aware Project Management System
Project Universe – Context-aware Project Management System
 
Unity Tipps and Tricks
Unity Tipps and TricksUnity Tipps and Tricks
Unity Tipps and Tricks
 
Artificial Intelligence, Machine Learning and Deep Learning
Artificial Intelligence, Machine Learning and Deep LearningArtificial Intelligence, Machine Learning and Deep Learning
Artificial Intelligence, Machine Learning and Deep Learning
 
Introduction to Cocos2d
Introduction to Cocos2dIntroduction to Cocos2d
Introduction to Cocos2d
 
Introduction to-cocos2d
Introduction to-cocos2dIntroduction to-cocos2d
Introduction to-cocos2d
 
nunuStudio Geometrix 2017
nunuStudio Geometrix 2017nunuStudio Geometrix 2017
nunuStudio Geometrix 2017
 
The Contextual Wizard of Oz
The Contextual Wizard of OzThe Contextual Wizard of Oz
The Contextual Wizard of Oz
 
App specific app architecture
App specific app architectureApp specific app architecture
App specific app architecture
 
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
 
Object detection with deep learning
Object detection with deep learningObject detection with deep learning
Object detection with deep learning
 
Attacking and Auditing Containers - Nishith Khadadiya
Attacking and Auditing Containers - Nishith KhadadiyaAttacking and Auditing Containers - Nishith Khadadiya
Attacking and Auditing Containers - Nishith Khadadiya
 
Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)Learn How to Unit Test Your Android Application (with Robolectric)
Learn How to Unit Test Your Android Application (with Robolectric)
 
Structural organization and architecture of a virtual reality explorer
Structural organization and architecture of a virtual reality explorerStructural organization and architecture of a virtual reality explorer
Structural organization and architecture of a virtual reality explorer
 
Stoop 437-proxy
Stoop 437-proxyStoop 437-proxy
Stoop 437-proxy
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
 
Promises of Deep Learning
Promises of Deep LearningPromises of Deep Learning
Promises of Deep Learning
 
7 characteristics of container-native infrastructure, Docker Zurich 2015-09-08
7 characteristics of container-native infrastructure, Docker Zurich 2015-09-087 characteristics of container-native infrastructure, Docker Zurich 2015-09-08
7 characteristics of container-native infrastructure, Docker Zurich 2015-09-08
 

Mehr von Guille Polito

Run-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented RuntimesRun-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented RuntimesGuille Polito
 
PADR - Engineering for Reseach
PADR - Engineering for ReseachPADR - Engineering for Reseach
PADR - Engineering for ReseachGuille Polito
 
First-class undefined classes for Pharo
First-class undefined classes for PharoFirst-class undefined classes for Pharo
First-class undefined classes for PharoGuille Polito
 
Understanding the Pharo dev Process
Understanding the Pharo dev ProcessUnderstanding the Pharo dev Process
Understanding the Pharo dev ProcessGuille Polito
 
Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)Guille Polito
 
Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013Guille Polito
 
Where am I in my Phd - October 2012
Where am I in my Phd - October 2012Where am I in my Phd - October 2012
Where am I in my Phd - October 2012Guille Polito
 
Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012Guille Polito
 
DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011Guille Polito
 

Mehr von Guille Polito (9)

Run-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented RuntimesRun-Fail-Grow: Creating Tailored Object Oriented Runtimes
Run-Fail-Grow: Creating Tailored Object Oriented Runtimes
 
PADR - Engineering for Reseach
PADR - Engineering for ReseachPADR - Engineering for Reseach
PADR - Engineering for Reseach
 
First-class undefined classes for Pharo
First-class undefined classes for PharoFirst-class undefined classes for Pharo
First-class undefined classes for Pharo
 
Understanding the Pharo dev Process
Understanding the Pharo dev ProcessUnderstanding the Pharo dev Process
Understanding the Pharo dev Process
 
Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)Oz Object Spaces - Uqbar Workshop 2013 (spanish)
Oz Object Spaces - Uqbar Workshop 2013 (spanish)
 
Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013Going Native With DBXTalk - Smalltalks 2013
Going Native With DBXTalk - Smalltalks 2013
 
Where am I in my Phd - October 2012
Where am I in my Phd - October 2012Where am I in my Phd - October 2012
Where am I in my Phd - October 2012
 
Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012Bootstrapping a Smalltalk - Smalltalks 2012
Bootstrapping a Smalltalk - Smalltalks 2012
 
DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011DBXTalk - Smalltalks 2011
DBXTalk - Smalltalks 2011
 

Último

UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1DianaGray10
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarThousandEyes
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kitJamie (Taka) Wang
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024Brian Pichman
 
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxGraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxNeo4j
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.IPLOOK Networks
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTopCSSGallery
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0DanBrown980551
 
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosScenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosErol GIRAUDY
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfInfopole1
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptxHansamali Gamage
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Muhammad Tiham Siddiqui
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4DianaGray10
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxSatishbabu Gunukula
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 

Último (20)

UiPath Studio Web workshop series - Day 1
UiPath Studio Web workshop series  - Day 1UiPath Studio Web workshop series  - Day 1
UiPath Studio Web workshop series - Day 1
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
20140402 - Smart house demo kit
20140402 - Smart house demo kit20140402 - Smart house demo kit
20140402 - Smart house demo kit
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024
 
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptxGraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
GraphSummit Copenhagen 2024 - Neo4j Vision and Roadmap.pptx
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.Introduction - IPLOOK NETWORKS CO., LTD.
Introduction - IPLOOK NETWORKS CO., LTD.
 
Top 10 Squarespace Development Companies
Top 10 Squarespace Development CompaniesTop 10 Squarespace Development Companies
Top 10 Squarespace Development Companies
 
LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0LF Energy Webinar - Unveiling OpenEEMeter 4.0
LF Energy Webinar - Unveiling OpenEEMeter 4.0
 
Scenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenariosScenario Library et REX Discover industry- and role- based scenarios
Scenario Library et REX Discover industry- and role- based scenarios
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
 
Oracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptxOracle Database 23c Security New Features.pptx
Oracle Database 23c Security New Features.pptx
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 

Virtual Smalltalk Images - IWST - ESUG 2013

  • 1. Virtual Smalltalk Images: Model and Applications Guillermo Polito, Stéphane Ducasse, Luc Fabrese, Noury Bouraqadi jueves 31 de octubre de 13
  • 2. The context: Pharo • Object oriented language • Dynamic typing • Highly reflective • Image based • Metacircular 2 jueves 31 de octubre 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) [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 3 jueves 31 de octubre 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...) [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 4 jueves 31 de octubre 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 jueves 31 de octubre de 13
  • 6. Our solution: Virtual images with Object Spaces • 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 [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) 6 jueves 31 de octubre de 13
  • 7. Object Spaces jueves 31 de octubre de 13
  • 8. Oz Object Spaces the model 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 8 jueves 31 de octubre de 13
  • 9. Oz Object Spaces the guest image The Model Host Metaclass Guest Class Metaclass class Metaclass Class Object Metaclass class A Caption: Object Smalltalk Image Object 9 jueves 31 de octubre de 13 Object Space
  • 10. Oz Object Spaces the membrane The Model Host ToolA Guest ToolB Caption: Smalltalk Image Object 10 jueves 31 de octubre de 13 Object Space
  • 11. The Model Oz Object Spaces membrane: the façade • 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 11 jueves 31 de octubre de 13
  • 12. The Model Oz Object Spaces membrane: mirrors • Direct object manipulation Field manipulation: get and set values from object fields • • • • • Testing and conversion operations. e.g., #isNil, #asBoolean Size calculation: get the size of objects Class access: introspect and modify the class of an object Some mirrors provide specialized operations. e.g., a ClassMirror supports the #basicNew operation 12 jueves 31 de octubre de 13
  • 13. The Model Oz Object Spaces control of execution • 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 13 jueves 31 de octubre de 13
  • 14. The Model Oz Object Spaces control of communication • • One way communication: host to guest • 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 Communication is achieved by creating and injecting objects into the object space 14 jueves 31 de octubre de 13
  • 15. Oz Object Spaces applications • • • • • Image surgery Image recovery and better Emergency Kernel Controlled interruption Image side Stack overflow and infinite loop detection Sandboxing 15 jueves 31 de octubre de 13
  • 16. The Vision • • • • • • 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 16 jueves 31 de octubre 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 17 jueves 31 de octubre de 13
  • 18. Behind Oz Object Spaces: the implementation 18 jueves 31 de octubre de 13
  • 19. Oz Object Spaces the implementation 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) 19 jueves 31 de octubre de 13
  • 20. The Implementation Oz Object Spaces Challenging infrastructure • Special Objects Array: an array the VM 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 20 jueves 31 de octubre de 13
  • 21. The Implementation Oz Object Spaces memory layout Host and Guest images share the same heap The Object Memory nil host • • • false true host nil ... host guest false true guest guest ... 'hi!' ... host Reuse of VM memory mechanisms No extra VM support to handle cross-image references Shared garbage collection 21 jueves 31 de octubre de 13
  • 22. The Implementation Oz Object Spaces mirror 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 22 jueves 31 de octubre de 13
  • 23. The Implementation Oz Object Spaces process manipulation • • Processes are simple objects • Mirrors allow manipulation and maintain consistency of the process model In the host, they are represented through ProcessMirror, ProcessSchedulerMirror and ContextMirror 23 jueves 31 de octubre de 13
  • 24. The Implementation Oz Object Spaces context switch Execution of code inside an object space is based on a context switch: 1. The VM installs the object space as the current environment to run 2. Runs until being preempted 3. Gives control back to the host 24 jueves 31 de octubre de 13
  • 25. The Implementation Oz Object Spaces Pharo image contract 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. 25 jueves 31 de octubre 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 26 jueves 31 de octubre de 13