SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Running Pharo on the
GemStone VM
James Foster
VP of Finance & Operations, GemTalk Systems LLC
FAST 2017 – La Plata, Argentina
8 November 2017
Agenda
• GemStone/S Introduction
• Replacing Base Class Libraries
• Questions
2
Limitations of traditional Smalltalks
• Object space (image) must fit in (virtual) RAM
• Object space visible to one (single-threaded) VM
• Sharing objects between VMs is difficult
– Convert to non-object format (binary, XML, SQL)
– No built-in object identity for multiple exports
• Object state is lost when VM exits
3
Welcome to the magical
world of GemStone
• Object space limited by
disk, not RAM
• Object space shared
across multiple VMs on
multiple hosts
• Transactional
persistence
• Image from
http://www.flickr.com/photos/laffy4k/182219003/
• Creative Commons License
http://creativecommons.org/licenses/by-sa/2.0/ 4
GemStone/S Architecture
5
Gem Types
• Linked Gem
– Gem in application process space
• Remote Procedure Call (RPC) Gem
– GCI library in application space
– Gem has separate process
6
Application &
GCI Library
Gem
OS Process
Gem
Application &
GCI Library TCP/IP
OS Process 1 OS Process 2
One-Machine Process Locations (Linked Gem)
7
Application
& GCI
Library Gem
Stone
SPC
Repository
One-Machine Process Locations (RPC Gem)
8
Application
& GCI
Library
Gem
Stone
SPC
Repository
NetLDI
Two-Machine Process Locations (Gem on Stone Host)
9
Application
& GCI
Library
Client Host
N
E
T
W
O
R
K
Gem
Stone
SPC
Repository
Stone Host
NetLDI
Two-Machine Process Locations (Gem Remote from Stone)
10
Application
& GCI
Library
Gem
Gem Host
Remote SPC
Page
Server
N
E
T
W
O
R
K
NetLDI
Stone
SPC
Repository
Stone Host
Page
Server
NetLDI
Three-Machine Process Locations
11
Application
& GCI
Library
Client Host
N
E
T
W
O
R
K
Gem
Gem Host
Remote SPC
Page
Server
N
E
T
W
O
R
K
NetLDI
Stone
SPC
Repository
Stone Host
Page
Server
NetLDI
Shared Page Cache
12
Agenda
• GemStone/S Introduction
• Replacing Base Class Libraries
• Questions
13
Replacing Base Class Libraries
• Smalltalk was intended to allow exploration
• Portability
– ANSI
– Grease
• Can we go to a lower level?
• One approach to learn more
14
Option 1: Complete Replacement
• Not possible in most Smalltalks
– Creating methods requires code
• GemStone schema editing with Topaz
– Build process starts with a few base classes
– But no methods for any class (initially)
• Challenges
– Difficult to debug (most tools are internal)
– VM has knowledge of schema
15
Option 2: Parallel Class Hierarchy
• GemStone’s namespace model allows separate
hierarchy
16
Pharo Global Lookup
17
Smalltalk
(a SmalltalkImage)
a SystemDictionary
a GlobalVariable
(Association)
globals
a CompiledMethod
a Symbolkey
an Object
value
Image
GemStone/S Global Lookup
18
AllUsers
(a UserProfileSet)
a UserProfile
a SymbolList
(Array)
Repository
a SymbolDictionary a SymbolAssociation
symbolList
a CompiledMethod
a Symbolkey
an Object
value
Unique or Shared SymbolDictionary Instances
19
AllUsers
Bob
a SymbolList
Repository
1. UserGlobals
Carol
a SymbolList
2. Globals
1. UserGlobals
3. Published
SymbolDictionary instances
Unique or Shared SymbolAssociation Instances
20
1. UserGlobals
assoc
#Arraykey
Array
value
2. Globals
1. UserGlobals
assoc
key
value
Bob’s SymbolList Carol’s SymbolList
Unique Keys
21
1. UserGlobals
assoc
#Arraykey
Array
value
2. Globals
1. UserGlobals
assoc
key
value
Bob’s SymbolList Carol’s SymbolList
#List
Unique Values
22
1. UserGlobals
2. Globals
1. UserGlobals
Bob’s SymbolList Carol’s SymbolList
assoc
#OrderedCollection
key
OrderedCollection
value
assoc
key
OrderedCollectionvalue
Problems with Parallel Class Hierarchy
• GemStone’s namespace model allows separate
hierarchy
• But complications exist:
– Literals
– Classes known to the VM
23
Complication: Literals (and their superclasses)
• Array: #()
• BlockClosure: []
• Boolean: true, false
• ByteArray: #[1 2 3]
• Character: $a
• Float: 1.23
• SmallInteger: 42
• String: ‘Smalltalk’
• Symbol: #Array
• UndefinedObject: nil
24
Complication: Classes Known to the VM
• Behavior, Class, Metaclass
• Exception, MessageNotUnderstood, ZeroDivide, …
• Pragma
• Process
• ProcessorScheduler
• So, we need to use (some) base classes
25
Problem: Conflicting Implementations
• Array>>printOn:
– Pharo
• #(1 2 3) printString '#(1 2 3)'
– GemStone
• #(1 2 3) printString 'anArray( 1, 2, 3)'
26
Option 3: Parallel Methods in GemStone Classes
• Each GemStone class has a collection of
MethodDictionary instances
– Methods are compiled into an “environment”
– Message sends to same environment (by default)
• Method environments:
0 = GemStone/S (default)
1 = Maglev (reserved for Ruby)
2+ are for others
– We use 2 for Pharo
27
28
Array Array class
a MethodDictionary a MethodDictionary
Pharo Method Dictionaries
Arrayed
Collection
Arrayed
Collection class
a MethodDictionary a MethodDictionary
Sequenceable
Collection
Sequenceable
Collection class
a MethodDictionary a MethodDictionary
29
Array Array class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
GemStone Method Dictionaries - 1
Sequenceable
Collection
Sequenceable
Collection class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
30
Array Array class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
GemStone Method Dictionaries - 2
Sequenceable
Collection
Sequenceable
Collection class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
Arrayed
Collection
Arrayed
Collection class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
Sample Messages
• Implicit
– “in env 0” #(1 2 3) printString 'anArray( 1, 2, 3)'
– “in env 2” #(1 2 3) printString '#(1 2 3)'
• Explicit
– #(1 2 3) @env0:printString 'anArray( 1, 2, 3)'
– #(1 2 3) @env2:printString '#(1 2 3)’
31
Array
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
printOn: aStream
“for GemStone”
printOn: aStream
“for Pharo”
Problems with Using GemStone Classes
• GemStone class might have different schema
– OrderedCollection in Pharo
• Instance variables: (array firstIndex lastIndex)
– OrderedCollection in GemStone
• No instance variables
– Since OrderedCollection is not known to the
compiler, we don’t have to use GemStone’s class
32
Options
1. Replace all classes
But schema is wrong in some cases
And we would like to use tools during development
2. Use parallel classes exclusively
But compiler & VM know about some GemStone classes
3. Use parallel methods exclusively
But schema is different for some classes
4. Hybrid
Use GemStone classes when necessary
Use parallel classes otherwise
Use method environment 2 for everything
33
Tools
• Topaz
– GemStone’s command-line interface
• GemBuilder for Smalltalk (GBS)
– GemStone’s GUI IDE for VA & VW
• Others
– tODE
– gt4gemstone
– Jade
34
Issues
• Incomplete Class Types
– GemStone has in-memory Ephemerons, but no
Weak references
– No 32-bit objects
• GemStone compiler is in VM
– Not as easy to experiment with new syntax
• Low-level objects may need extensive rewrite
– BlockClosure, Process, ProcessorScheduler, etc.
35
Demo
• http://files.pharo.org/get-files/60/pharo-minimal.zip
• http://downloads.gemtalksystems.com/pub/GemStone64/3.4.0/
• https://github.com/jgfoster/PharoGs/tree/james/james
36
Questions?
37
GemTalk Systems LLC
15220 NW Greenbrier Pkwy., Suite 240
Beaverton, Oregon, 97006
Voice & Fax: +1 503 766 4714
james.foster@gemtalksystems.com
James G. Foster
VP	of	Finance	&	Operations
www.gemtalksystems.com
®

Contenu connexe

Tendances

Database madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemyDatabase madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemy
Jaime Buelta
 

Tendances (8)

A evolução da persistência de dados (com sqlite) no android
A evolução da persistência de dados (com sqlite) no androidA evolução da persistência de dados (com sqlite) no android
A evolução da persistência de dados (com sqlite) no android
 
Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2Zend Framework 1 + Doctrine 2
Zend Framework 1 + Doctrine 2
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Database madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemyDatabase madness with_mongoengine_and_sql_alchemy
Database madness with_mongoengine_and_sql_alchemy
 
Using Dojo
Using DojoUsing Dojo
Using Dojo
 
Dom
DomDom
Dom
 
G3 Summit 2016 - Taking Advantage of Groovy Annotations
G3 Summit 2016 - Taking Advantage of Groovy AnnotationsG3 Summit 2016 - Taking Advantage of Groovy Annotations
G3 Summit 2016 - Taking Advantage of Groovy Annotations
 
Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0Migrating from Ext GWT 2.x to 3.0
Migrating from Ext GWT 2.x to 3.0
 

Similaire à Running Pharo on the Gemstone VM by James Foster

Edu.mit.jwi 2.2.3 manual
Edu.mit.jwi 2.2.3 manualEdu.mit.jwi 2.2.3 manual
Edu.mit.jwi 2.2.3 manual
zxcvbbb
 

Similaire à Running Pharo on the Gemstone VM by James Foster (20)

Running Pharo on the GemStone VM
Running Pharo on the GemStone VMRunning Pharo on the GemStone VM
Running Pharo on the GemStone VM
 
Gemtalk Systems Product Roadmap
Gemtalk Systems Product RoadmapGemtalk Systems Product Roadmap
Gemtalk Systems Product Roadmap
 
GemStone/64 product update and road map
GemStone/64 product update and road mapGemStone/64 product update and road map
GemStone/64 product update and road map
 
Libertyvasion2010
Libertyvasion2010Libertyvasion2010
Libertyvasion2010
 
GemStone Update 2023
GemStone Update 2023GemStone Update 2023
GemStone Update 2023
 
Intro to GemStone/S
Intro to GemStone/SIntro to GemStone/S
Intro to GemStone/S
 
PharoGs: Hosting Pharo in GemStone/S
PharoGs: Hosting Pharo in GemStone/SPharoGs: Hosting Pharo in GemStone/S
PharoGs: Hosting Pharo in GemStone/S
 
Jvm internals
Jvm internalsJvm internals
Jvm internals
 
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin NakovJava 7 - New Features - by Mihail Stoynov and Svetlin Nakov
Java 7 - New Features - by Mihail Stoynov and Svetlin Nakov
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
keti companion classifier
keti companion classifierketi companion classifier
keti companion classifier
 
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft..."Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
"Source Code Abstracts Classification Using CNN", Vadim Markovtsev, Lead Soft...
 
Edu.mit.jwi 2.2.3 manual
Edu.mit.jwi 2.2.3 manualEdu.mit.jwi 2.2.3 manual
Edu.mit.jwi 2.2.3 manual
 
Mining Software Archives to Support Software Development
Mining Software Archives to Support Software DevelopmentMining Software Archives to Support Software Development
Mining Software Archives to Support Software Development
 
Memory Analysis of the Dalvik (Android) Virtual Machine
Memory Analysis of the Dalvik (Android) Virtual MachineMemory Analysis of the Dalvik (Android) Virtual Machine
Memory Analysis of the Dalvik (Android) Virtual Machine
 
Clonedigger-Python
Clonedigger-PythonClonedigger-Python
Clonedigger-Python
 
GemStone/S 64 Update
 GemStone/S 64 Update GemStone/S 64 Update
GemStone/S 64 Update
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
.NET Deserialization Attacks
.NET Deserialization Attacks.NET Deserialization Attacks
.NET Deserialization Attacks
 
Grow and Shrink - Dynamically Extending the Ruby VM Stack
Grow and Shrink - Dynamically Extending the Ruby VM StackGrow and Shrink - Dynamically Extending the Ruby VM Stack
Grow and Shrink - Dynamically Extending the Ruby VM Stack
 

Plus de FAST

Powerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming LanguagesPowerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming Languages
FAST
 
Constructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineConstructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden Engine
FAST
 
Demystifying the creation of coding tools
Demystifying the creation of coding toolsDemystifying the creation of coding tools
Demystifying the creation of coding tools
FAST
 
Application Starter: the entry point for your application
Application Starter: the entry point for your applicationApplication Starter: the entry point for your application
Application Starter: the entry point for your application
FAST
 
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
FAST
 
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldVASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
FAST
 
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopHands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
FAST
 

Plus de FAST (20)

Threads, Critical Sections, and Termination
Threads, Critical Sections, and TerminationThreads, Critical Sections, and Termination
Threads, Critical Sections, and Termination
 
OOP with Smalltalk
OOP with SmalltalkOOP with Smalltalk
OOP with Smalltalk
 
Powerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming LanguagesPowerlang: a Vehicle for Lively Implementing Programming Languages
Powerlang: a Vehicle for Lively Implementing Programming Languages
 
Constructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineConstructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden Engine
 
Demystifying the creation of coding tools
Demystifying the creation of coding toolsDemystifying the creation of coding tools
Demystifying the creation of coding tools
 
Application Starter: the entry point for your application
Application Starter: the entry point for your applicationApplication Starter: the entry point for your application
Application Starter: the entry point for your application
 
Improving the Pharo VM
Improving the Pharo VMImproving the Pharo VM
Improving the Pharo VM
 
What is (not) Pharo 8?
What is (not) Pharo 8?What is (not) Pharo 8?
What is (not) Pharo 8?
 
Stargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIsStargate: an interstellar journey to RESTful APIs
Stargate: an interstellar journey to RESTful APIs
 
Opening Smalltalks 2019
Opening Smalltalks 2019Opening Smalltalks 2019
Opening Smalltalks 2019
 
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção JrSmalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
Smalltalk Computers, Past and Future by Jecel Mattos de Assumpção Jr
 
Adaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção JrAdaptive Compilation by Jecel Mattos de Assumpção Jr
Adaptive Compilation by Jecel Mattos de Assumpção Jr
 
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
Choosing where to run our objects: the S8 Smalltalk approach by Description:F...
 
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
Using 128 GPU cores, Tensorflow and VASmalltalk to detect Kolsh beers with ES...
 
Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...Improving VASmalltalk deployment, availability and scalability with Docker by...
Improving VASmalltalk deployment, availability and scalability with Docker by...
 
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the worldVASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
VASmalltalk and Raspberry Pi powering the largest MIDI instrument of the world
 
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting WorkshopHands-on Raspberry Pi and VA Smalltalk - Starting Workshop
Hands-on Raspberry Pi and VA Smalltalk - Starting Workshop
 
Live typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan WilkinsonLive typing: Update and what's next by Hernan Wilkinson
Live typing: Update and what's next by Hernan Wilkinson
 
Enhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth BermanEnhanced Email Protocol Framework for VAST by Seth Berman
Enhanced Email Protocol Framework for VAST by Seth Berman
 
VA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth BermanVA Smalltalk Product Update by Seth Berman
VA Smalltalk Product Update by Seth Berman
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Running Pharo on the Gemstone VM by James Foster

  • 1. Running Pharo on the GemStone VM James Foster VP of Finance & Operations, GemTalk Systems LLC FAST 2017 – La Plata, Argentina 8 November 2017
  • 2. Agenda • GemStone/S Introduction • Replacing Base Class Libraries • Questions 2
  • 3. Limitations of traditional Smalltalks • Object space (image) must fit in (virtual) RAM • Object space visible to one (single-threaded) VM • Sharing objects between VMs is difficult – Convert to non-object format (binary, XML, SQL) – No built-in object identity for multiple exports • Object state is lost when VM exits 3
  • 4. Welcome to the magical world of GemStone • Object space limited by disk, not RAM • Object space shared across multiple VMs on multiple hosts • Transactional persistence • Image from http://www.flickr.com/photos/laffy4k/182219003/ • Creative Commons License http://creativecommons.org/licenses/by-sa/2.0/ 4
  • 6. Gem Types • Linked Gem – Gem in application process space • Remote Procedure Call (RPC) Gem – GCI library in application space – Gem has separate process 6 Application & GCI Library Gem OS Process Gem Application & GCI Library TCP/IP OS Process 1 OS Process 2
  • 7. One-Machine Process Locations (Linked Gem) 7 Application & GCI Library Gem Stone SPC Repository
  • 8. One-Machine Process Locations (RPC Gem) 8 Application & GCI Library Gem Stone SPC Repository NetLDI
  • 9. Two-Machine Process Locations (Gem on Stone Host) 9 Application & GCI Library Client Host N E T W O R K Gem Stone SPC Repository Stone Host NetLDI
  • 10. Two-Machine Process Locations (Gem Remote from Stone) 10 Application & GCI Library Gem Gem Host Remote SPC Page Server N E T W O R K NetLDI Stone SPC Repository Stone Host Page Server NetLDI
  • 11. Three-Machine Process Locations 11 Application & GCI Library Client Host N E T W O R K Gem Gem Host Remote SPC Page Server N E T W O R K NetLDI Stone SPC Repository Stone Host Page Server NetLDI
  • 13. Agenda • GemStone/S Introduction • Replacing Base Class Libraries • Questions 13
  • 14. Replacing Base Class Libraries • Smalltalk was intended to allow exploration • Portability – ANSI – Grease • Can we go to a lower level? • One approach to learn more 14
  • 15. Option 1: Complete Replacement • Not possible in most Smalltalks – Creating methods requires code • GemStone schema editing with Topaz – Build process starts with a few base classes – But no methods for any class (initially) • Challenges – Difficult to debug (most tools are internal) – VM has knowledge of schema 15
  • 16. Option 2: Parallel Class Hierarchy • GemStone’s namespace model allows separate hierarchy 16
  • 17. Pharo Global Lookup 17 Smalltalk (a SmalltalkImage) a SystemDictionary a GlobalVariable (Association) globals a CompiledMethod a Symbolkey an Object value Image
  • 18. GemStone/S Global Lookup 18 AllUsers (a UserProfileSet) a UserProfile a SymbolList (Array) Repository a SymbolDictionary a SymbolAssociation symbolList a CompiledMethod a Symbolkey an Object value
  • 19. Unique or Shared SymbolDictionary Instances 19 AllUsers Bob a SymbolList Repository 1. UserGlobals Carol a SymbolList 2. Globals 1. UserGlobals 3. Published SymbolDictionary instances
  • 20. Unique or Shared SymbolAssociation Instances 20 1. UserGlobals assoc #Arraykey Array value 2. Globals 1. UserGlobals assoc key value Bob’s SymbolList Carol’s SymbolList
  • 21. Unique Keys 21 1. UserGlobals assoc #Arraykey Array value 2. Globals 1. UserGlobals assoc key value Bob’s SymbolList Carol’s SymbolList #List
  • 22. Unique Values 22 1. UserGlobals 2. Globals 1. UserGlobals Bob’s SymbolList Carol’s SymbolList assoc #OrderedCollection key OrderedCollection value assoc key OrderedCollectionvalue
  • 23. Problems with Parallel Class Hierarchy • GemStone’s namespace model allows separate hierarchy • But complications exist: – Literals – Classes known to the VM 23
  • 24. Complication: Literals (and their superclasses) • Array: #() • BlockClosure: [] • Boolean: true, false • ByteArray: #[1 2 3] • Character: $a • Float: 1.23 • SmallInteger: 42 • String: ‘Smalltalk’ • Symbol: #Array • UndefinedObject: nil 24
  • 25. Complication: Classes Known to the VM • Behavior, Class, Metaclass • Exception, MessageNotUnderstood, ZeroDivide, … • Pragma • Process • ProcessorScheduler • So, we need to use (some) base classes 25
  • 26. Problem: Conflicting Implementations • Array>>printOn: – Pharo • #(1 2 3) printString '#(1 2 3)' – GemStone • #(1 2 3) printString 'anArray( 1, 2, 3)' 26
  • 27. Option 3: Parallel Methods in GemStone Classes • Each GemStone class has a collection of MethodDictionary instances – Methods are compiled into an “environment” – Message sends to same environment (by default) • Method environments: 0 = GemStone/S (default) 1 = Maglev (reserved for Ruby) 2+ are for others – We use 2 for Pharo 27
  • 28. 28 Array Array class a MethodDictionary a MethodDictionary Pharo Method Dictionaries Arrayed Collection Arrayed Collection class a MethodDictionary a MethodDictionary Sequenceable Collection Sequenceable Collection class a MethodDictionary a MethodDictionary
  • 29. 29 Array Array class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2] GemStone Method Dictionaries - 1 Sequenceable Collection Sequenceable Collection class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2]
  • 30. 30 Array Array class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2] GemStone Method Dictionaries - 2 Sequenceable Collection Sequenceable Collection class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2] Arrayed Collection Arrayed Collection class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2]
  • 31. Sample Messages • Implicit – “in env 0” #(1 2 3) printString 'anArray( 1, 2, 3)' – “in env 2” #(1 2 3) printString '#(1 2 3)' • Explicit – #(1 2 3) @env0:printString 'anArray( 1, 2, 3)' – #(1 2 3) @env2:printString '#(1 2 3)’ 31 Array method dicts a MethodDict [0] nil a MethodDict [2] printOn: aStream “for GemStone” printOn: aStream “for Pharo”
  • 32. Problems with Using GemStone Classes • GemStone class might have different schema – OrderedCollection in Pharo • Instance variables: (array firstIndex lastIndex) – OrderedCollection in GemStone • No instance variables – Since OrderedCollection is not known to the compiler, we don’t have to use GemStone’s class 32
  • 33. Options 1. Replace all classes But schema is wrong in some cases And we would like to use tools during development 2. Use parallel classes exclusively But compiler & VM know about some GemStone classes 3. Use parallel methods exclusively But schema is different for some classes 4. Hybrid Use GemStone classes when necessary Use parallel classes otherwise Use method environment 2 for everything 33
  • 34. Tools • Topaz – GemStone’s command-line interface • GemBuilder for Smalltalk (GBS) – GemStone’s GUI IDE for VA & VW • Others – tODE – gt4gemstone – Jade 34
  • 35. Issues • Incomplete Class Types – GemStone has in-memory Ephemerons, but no Weak references – No 32-bit objects • GemStone compiler is in VM – Not as easy to experiment with new syntax • Low-level objects may need extensive rewrite – BlockClosure, Process, ProcessorScheduler, etc. 35
  • 37. Questions? 37 GemTalk Systems LLC 15220 NW Greenbrier Pkwy., Suite 240 Beaverton, Oregon, 97006 Voice & Fax: +1 503 766 4714 james.foster@gemtalksystems.com James G. Foster VP of Finance & Operations www.gemtalksystems.com ®