SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
PharoGs: Hosting Pharo in GemStone/S
James Foster
ESUG 2019 – Köln, Germany
Agenda
• Motivation
• GemStone Namespaces
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/27/19 ESUG 2019 2
Motivation
• "Now since people deploy on GemStone … I would love to have
… Pharo fully execute with compiler and other on top of GS
VM."
– Stéphane Ducasse (1 June 2019)
– http://forum.world.st/Re-Versioning-with-Iceberg-
td5099792i20.html#a5099905
8/28/19 ESUG 2019 3
"Develop in Pharo, deploy in GemStone"*
• Develop in Pharo
– Use familiar and powerful IDE
• Deploy in GemStone
– Scale-up image size (terabytes)
– Scale-up concurrent sessions (thousands)
– Shared object space with transactional persistence
– Industrial-strength reliability
*Dale Henrichs, 2004
8/26/19 ESUG 2019 4
Code Portability
• Grease (https://github.com/SeasideSt/Grease)
– Limited to common features
– Often an afterthought
– Constant porting effort
• Why not the full* Pharo
class library?
* For some definition of "full"!
8/26/19 ESUG 2019 5
Hardware
Operating System
Virtual Machine
Kernel Classes
Libraries
Frameworks
Applications
Version/Dialect Cohabitation
• Current project: one "guest"
– Host Pharo8.0 in GemStone 3.5
• Why not two or more "guests"?
– Use a Pharo7.0 library from Pharo8.0 code!
• Analogous to the module/namespace problem
8/26/19 ESUG 2019 6
IDE for a "Headless" Image
• Development for an image that does not have tools
– Use GemStone code browser, debugger, inspector
• Research into how "minimal" we can make an image
– No concerns about breaking image
• Research about what is truly "kernel"
– What would be minimal, stable API for base class library
8/27/19 ESUG 2019 7
Agenda
• Motivation
• GemStone Namespaces
– Globals
– Methods
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/28/19 ESUG 2019 8
Pharo Global Lookup
8/26/19 ESUG 2019 9
Smalltalk
(a SmalltalkImage)
a SystemDictionary
a GlobalVariable
(Association)
globals
a CompiledMethod
a Symbol
key
an Object
value
Image
GemStone Global Lookup
8/26/19 ESUG 2019 10
AllUsers
(a UserProfileSet)
a UserProfile
a SymbolList
(Array)
Repository
a SymbolDictionary a SymbolAssociation
symbolList
a CompiledMethod
a Symbol
key
an Object
value
Pharo Globals
• Create a new SymbolDictionary (named #'Pharo') to hold all
Pharo globals
• Most classes are unique to Pharo
– Even if they have the same name
• Some classes are shared between GemStone and Pharo
– Literals
– Other classes known to the VM
8/27/19 ESUG 2019 11
Literals (and their Superclasses)
• Array: #()
• BlockClosure: []
• Boolean: true, false
• ByteArray: #[1 2 3]
• Character: $a
8/26/19 ESUG 2019 12
• Float: 1.23
• SmallInteger: 42
• String: ‘Smalltalk’
• Symbol: #Array
• UndefinedObject: nil
Other Classes Known to the VM
• Behavior, Class, Metaclass
• Exception, MessageNotUnderstood, ZeroDivide, …
• Pragma
• Process
• ProcessorScheduler
• Semaphore
8/26/19 ESUG 2019 13
Agenda
• Motivation
• GemStone Namespaces
– Globals
– Methods
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/28/19 ESUG 2019 14
Problem: Conflicting Implementation
• Array>>printOn:
– Pharo
• #(1 2 3) printString '#(1 2 3)'
– GemStone
• #(1 2 3) printString 'anArray( 1, 2, 3)'
8/26/19 ESUG 2019 15
Method Namespaces
• 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
8/26/19 ESUG 2019 16
Pharo Method Dictionaries
8/26/19 ESUG 2019 17
Array Array class
a MethodDictionary a MethodDictionary
Arrayed
Collection
Arrayed
Collection class
a MethodDictionary a MethodDictionary
Sequenceable
Collection
Sequenceable
Collection class
a MethodDictionary a MethodDictionary
GemStone Method Dictionaries - 1
8/26/19 ESUG 2019 18
Array Array class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
Sequenceable
Collection
Sequenceable
Collection class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
GemStone Method Dictionaries - 2
8/26/19 ESUG 2019 19
Array Array class
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
method
dicts
a MethodDict [0]
nil
a MethodDict [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]
Message Send Examples
• 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)’
8/26/19 ESUG 2019 20
Array
method
dicts
a MethodDict [0]
nil
a MethodDict [2]
printOn: aStream
“for GemStone”
printOn: aStream
“for Pharo”
Agenda
• Motivation
• GemStone Namespaces
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/28/19 ESUG 2019 21
Overview of Hosting Process
• Prepare Pharo image
• Create GemStone files from Pharo
• Load to GemStone
• Install edits to methods
• Run tests
• "rinse and repeat"
8/26/19 ESUG 2019 22
Prepare Pharo Image
• Pharo "cleanup"
– 35 GitHub pull requests to Pharo (thanks to the community for help)
– Use "Minimal Image" (headless) to reduce porting effort
– Still has over 1 500 classes, 25 000 methods, and 500 primitives
• Load additional packages
– Minimal image is incomplete (references to undefined classes)
– Monticello
– SUnit and several test packages
8/26/19 ESUG 2019 23
Create GemStone Files from Pharo
• PharoGs.st generates PharoGs.tpz and other class-specific files
• 7 globals, 13 pools, 1862 classes, 30384 methods
– 46 classes are shared
• Automatic translation
– Comment out code with known issues, replace with error
– Primitives get a <PharoPrimitive> pragma
– Known compile errors get a <PharoCompileError> pragma
• Reference to missing instance variable
8/26/19 ESUG 2019 24
Use 30 GemStone Class with Same Name
• Array
• Behavior
• Boolean
• ByteArray
• CannotReturn
• Character
• Class
• Collection
• Delay
• Error
8/26/19 ESUG 2019 25
• Exception
• ExceptionSet
• Fraction
• Integer
• LargeInteger
• Magnitude
• Message
• MessageNotUnderstood
• Notification
• Number
• Object
• Pragma
• ProcessorScheduler
• Semaphore
• SequenceableCollection
• SmallInteger
• Symbol
• UndefinedObject
• Warning
• ZeroDivide
Use 16 GemStone Classes with Different Name
• ArithmeticError -> NumericError
• BlockClosure -> ExecBlock
• BoxedFloat64 -> Float
• ByteString -> String
• ByteSymbol -> Symbol
• ClassDescription -> Module
• CompiledMethod -> GsNMethod
• Float -> BinaryFloat
8/26/19 ESUG 2019 26
• Metaclass -> Metaclass3
• MethodDictionary -> GsMethodDictionary
• Process -> GsProcess
• ScaledDecimal -> FixedPoint
• SmallFloat64 -> SmallDouble
• String -> CharacterCollection
• WideString -> QuadByteString
• WideSymbol -> QuadByteSymbol
Load to GemStone
• Create #'Pharo' SymbolDictionary
– Also create a #'Pools' SymbolDictionary
• Add global for #'thisContext'
– Also some missing globals for tests, Iceberg, and Seaside
• Load classes and methods
• Set Pharo-specific method-lookup superclass
– Object "subclasses" from ProtoObject
– Array, ByteArray, and String "subclass" from ArrayedCollection
8/26/19 ESUG 2019 27
Image Initialization
• Initialize selected classes
– Not ready to initialize all of them!
• Smalltalk := SmalltalkImage new
• SharedPool allSubclasses do: [:each | each initialize]
• SystemOrganization := SystemOrganizer new
8/26/19 ESUG 2019 28
Install Edits to Methods
• 122 (of 1862) classes have at least one method modified
• Method edits
– PharoGs 809
– PharoGsError 320
– PharoCompileError 225
– PharoPrimitive 70
8/27/19 ESUG 2019 29
Run Tests
• Identify test failures
• Update replacement methods
• Reload
• "rinse and repeat"
8/27/19 ESUG 2019 30
Load Seaside
Metacello new
baseline:'Seaside3';
repository: 'github://SeasideSt/Seaside:master/repository';
onWarningLog;
load.
• Replace one method: GRPharoPlatform>>seasideSuspendFlowDo:
– Create a partial continuation
– Note that everything else in GRPharoPlatform works!
8/27/19 ESUG 2019 31
Agenda
• Motivation
• GemStone Namespaces
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/28/19 ESUG 2019 32
Demo
• (video)
8/27/19 ESUG 2019 33
Agenda
• Motivation
• GemStone Namespaces
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/28/19 ESUG 2019 34
Integrated Development Environment (IDE)
• JADE
– Code Browser
– Workspace
– Inspector
– Debugger
8/27/19 ESUG 2019 35
Agenda
• Motivation
• GemStone Namespaces
• Hosting Process
• Demo
• IDE
• Summary and Questions
8/28/19 ESUG 2019 36
Summary
• Proof of concept
– Can it be done?
• Challenges?
– Compiler, UFFI, thisContext, slots, traits, …
• Personal motivation
– Academic research (publish, degree)
– Not a GemTalk sponsored project
• But GemTalk has shown a lot of support for Pharo; talk to us about interest!
8/28/19 ESUG 2019 37
Code: https://github.com/jgfoster/PharoGs
8/27/19 ESUG 2019 38
Google "PharoGs"
8/28/19 ESUG 2019 39
Questions?
• James.Foster@GemTalkSystems.com
– VP for Finance and Operations
• James.Foster@WallaWalla.edu
– Assistant Professor of Computer Science
8/27/19 ESUG 2019 40

Contenu connexe

Similaire à PharoGs: Hosting Pharo in GemStone/S

Report: Test49 Geant4 Monte-Carlo Models Testing Tools
Report: Test49 Geant4 Monte-Carlo Models Testing ToolsReport: Test49 Geant4 Monte-Carlo Models Testing Tools
Report: Test49 Geant4 Monte-Carlo Models Testing Tools
Roman Atachiants
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
honey725342
 
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
ESUG
 
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Gaetano Giunta
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Guillaume Laforge
 

Similaire à PharoGs: Hosting Pharo in GemStone/S (20)

Distributing big astronomical catalogues with Greenplum - Greenplum Summit 2019
Distributing big astronomical catalogues with Greenplum - Greenplum Summit 2019Distributing big astronomical catalogues with Greenplum - Greenplum Summit 2019
Distributing big astronomical catalogues with Greenplum - Greenplum Summit 2019
 
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
 
getting-your-groovy-on
getting-your-groovy-ongetting-your-groovy-on
getting-your-groovy-on
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patterns
 
Graphite & Metrictank - Meetup Tel Aviv Yafo
Graphite & Metrictank - Meetup Tel Aviv YafoGraphite & Metrictank - Meetup Tel Aviv Yafo
Graphite & Metrictank - Meetup Tel Aviv Yafo
 
OSGi bootcamp - part 1
OSGi bootcamp - part 1OSGi bootcamp - part 1
OSGi bootcamp - part 1
 
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
Modernisation of legacy PHP applications using Symfony2 - PHP Northeast Confe...
 
Gemtalk Systems Product Roadmap
Gemtalk Systems Product RoadmapGemtalk Systems Product Roadmap
Gemtalk Systems Product Roadmap
 
Report: Test49 Geant4 Monte-Carlo Models Testing Tools
Report: Test49 Geant4 Monte-Carlo Models Testing ToolsReport: Test49 Geant4 Monte-Carlo Models Testing Tools
Report: Test49 Geant4 Monte-Carlo Models Testing Tools
 
Composing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap LayersComposing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap Layers
 
EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
 
Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)
Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)
Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)
 
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
 
GemStone Update 2023
GemStone Update 2023GemStone Update 2023
GemStone Update 2023
 
Fast and Reproducible Deep Learning
Fast and Reproducible Deep LearningFast and Reproducible Deep Learning
Fast and Reproducible Deep Learning
 
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
유닉스_헤리티지_handouts_v3.pdf
유닉스_헤리티지_handouts_v3.pdf유닉스_헤리티지_handouts_v3.pdf
유닉스_헤리티지_handouts_v3.pdf
 

Plus de 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 programming
ESUG
 
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
ESUG
 
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 results
ESUG
 
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
ESUG
 
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
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
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
ESUG
 
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
ESUG
 
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
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
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
ESUG
 

Plus de 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
 
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
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalk
 

Dernier

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Dernier (20)

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 

PharoGs: Hosting Pharo in GemStone/S

  • 1. PharoGs: Hosting Pharo in GemStone/S James Foster ESUG 2019 – Köln, Germany
  • 2. Agenda • Motivation • GemStone Namespaces • Hosting Process • Demo • IDE • Summary and Questions 8/27/19 ESUG 2019 2
  • 3. Motivation • "Now since people deploy on GemStone … I would love to have … Pharo fully execute with compiler and other on top of GS VM." – Stéphane Ducasse (1 June 2019) – http://forum.world.st/Re-Versioning-with-Iceberg- td5099792i20.html#a5099905 8/28/19 ESUG 2019 3
  • 4. "Develop in Pharo, deploy in GemStone"* • Develop in Pharo – Use familiar and powerful IDE • Deploy in GemStone – Scale-up image size (terabytes) – Scale-up concurrent sessions (thousands) – Shared object space with transactional persistence – Industrial-strength reliability *Dale Henrichs, 2004 8/26/19 ESUG 2019 4
  • 5. Code Portability • Grease (https://github.com/SeasideSt/Grease) – Limited to common features – Often an afterthought – Constant porting effort • Why not the full* Pharo class library? * For some definition of "full"! 8/26/19 ESUG 2019 5 Hardware Operating System Virtual Machine Kernel Classes Libraries Frameworks Applications
  • 6. Version/Dialect Cohabitation • Current project: one "guest" – Host Pharo8.0 in GemStone 3.5 • Why not two or more "guests"? – Use a Pharo7.0 library from Pharo8.0 code! • Analogous to the module/namespace problem 8/26/19 ESUG 2019 6
  • 7. IDE for a "Headless" Image • Development for an image that does not have tools – Use GemStone code browser, debugger, inspector • Research into how "minimal" we can make an image – No concerns about breaking image • Research about what is truly "kernel" – What would be minimal, stable API for base class library 8/27/19 ESUG 2019 7
  • 8. Agenda • Motivation • GemStone Namespaces – Globals – Methods • Hosting Process • Demo • IDE • Summary and Questions 8/28/19 ESUG 2019 8
  • 9. Pharo Global Lookup 8/26/19 ESUG 2019 9 Smalltalk (a SmalltalkImage) a SystemDictionary a GlobalVariable (Association) globals a CompiledMethod a Symbol key an Object value Image
  • 10. GemStone Global Lookup 8/26/19 ESUG 2019 10 AllUsers (a UserProfileSet) a UserProfile a SymbolList (Array) Repository a SymbolDictionary a SymbolAssociation symbolList a CompiledMethod a Symbol key an Object value
  • 11. Pharo Globals • Create a new SymbolDictionary (named #'Pharo') to hold all Pharo globals • Most classes are unique to Pharo – Even if they have the same name • Some classes are shared between GemStone and Pharo – Literals – Other classes known to the VM 8/27/19 ESUG 2019 11
  • 12. Literals (and their Superclasses) • Array: #() • BlockClosure: [] • Boolean: true, false • ByteArray: #[1 2 3] • Character: $a 8/26/19 ESUG 2019 12 • Float: 1.23 • SmallInteger: 42 • String: ‘Smalltalk’ • Symbol: #Array • UndefinedObject: nil
  • 13. Other Classes Known to the VM • Behavior, Class, Metaclass • Exception, MessageNotUnderstood, ZeroDivide, … • Pragma • Process • ProcessorScheduler • Semaphore 8/26/19 ESUG 2019 13
  • 14. Agenda • Motivation • GemStone Namespaces – Globals – Methods • Hosting Process • Demo • IDE • Summary and Questions 8/28/19 ESUG 2019 14
  • 15. Problem: Conflicting Implementation • Array>>printOn: – Pharo • #(1 2 3) printString '#(1 2 3)' – GemStone • #(1 2 3) printString 'anArray( 1, 2, 3)' 8/26/19 ESUG 2019 15
  • 16. Method Namespaces • 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 8/26/19 ESUG 2019 16
  • 17. Pharo Method Dictionaries 8/26/19 ESUG 2019 17 Array Array class a MethodDictionary a MethodDictionary Arrayed Collection Arrayed Collection class a MethodDictionary a MethodDictionary Sequenceable Collection Sequenceable Collection class a MethodDictionary a MethodDictionary
  • 18. GemStone Method Dictionaries - 1 8/26/19 ESUG 2019 18 Array Array class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2] Sequenceable Collection Sequenceable Collection class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [2]
  • 19. GemStone Method Dictionaries - 2 8/26/19 ESUG 2019 19 Array Array class method dicts a MethodDict [0] nil a MethodDict [2] method dicts a MethodDict [0] nil a MethodDict [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]
  • 20. Message Send Examples • 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)’ 8/26/19 ESUG 2019 20 Array method dicts a MethodDict [0] nil a MethodDict [2] printOn: aStream “for GemStone” printOn: aStream “for Pharo”
  • 21. Agenda • Motivation • GemStone Namespaces • Hosting Process • Demo • IDE • Summary and Questions 8/28/19 ESUG 2019 21
  • 22. Overview of Hosting Process • Prepare Pharo image • Create GemStone files from Pharo • Load to GemStone • Install edits to methods • Run tests • "rinse and repeat" 8/26/19 ESUG 2019 22
  • 23. Prepare Pharo Image • Pharo "cleanup" – 35 GitHub pull requests to Pharo (thanks to the community for help) – Use "Minimal Image" (headless) to reduce porting effort – Still has over 1 500 classes, 25 000 methods, and 500 primitives • Load additional packages – Minimal image is incomplete (references to undefined classes) – Monticello – SUnit and several test packages 8/26/19 ESUG 2019 23
  • 24. Create GemStone Files from Pharo • PharoGs.st generates PharoGs.tpz and other class-specific files • 7 globals, 13 pools, 1862 classes, 30384 methods – 46 classes are shared • Automatic translation – Comment out code with known issues, replace with error – Primitives get a <PharoPrimitive> pragma – Known compile errors get a <PharoCompileError> pragma • Reference to missing instance variable 8/26/19 ESUG 2019 24
  • 25. Use 30 GemStone Class with Same Name • Array • Behavior • Boolean • ByteArray • CannotReturn • Character • Class • Collection • Delay • Error 8/26/19 ESUG 2019 25 • Exception • ExceptionSet • Fraction • Integer • LargeInteger • Magnitude • Message • MessageNotUnderstood • Notification • Number • Object • Pragma • ProcessorScheduler • Semaphore • SequenceableCollection • SmallInteger • Symbol • UndefinedObject • Warning • ZeroDivide
  • 26. Use 16 GemStone Classes with Different Name • ArithmeticError -> NumericError • BlockClosure -> ExecBlock • BoxedFloat64 -> Float • ByteString -> String • ByteSymbol -> Symbol • ClassDescription -> Module • CompiledMethod -> GsNMethod • Float -> BinaryFloat 8/26/19 ESUG 2019 26 • Metaclass -> Metaclass3 • MethodDictionary -> GsMethodDictionary • Process -> GsProcess • ScaledDecimal -> FixedPoint • SmallFloat64 -> SmallDouble • String -> CharacterCollection • WideString -> QuadByteString • WideSymbol -> QuadByteSymbol
  • 27. Load to GemStone • Create #'Pharo' SymbolDictionary – Also create a #'Pools' SymbolDictionary • Add global for #'thisContext' – Also some missing globals for tests, Iceberg, and Seaside • Load classes and methods • Set Pharo-specific method-lookup superclass – Object "subclasses" from ProtoObject – Array, ByteArray, and String "subclass" from ArrayedCollection 8/26/19 ESUG 2019 27
  • 28. Image Initialization • Initialize selected classes – Not ready to initialize all of them! • Smalltalk := SmalltalkImage new • SharedPool allSubclasses do: [:each | each initialize] • SystemOrganization := SystemOrganizer new 8/26/19 ESUG 2019 28
  • 29. Install Edits to Methods • 122 (of 1862) classes have at least one method modified • Method edits – PharoGs 809 – PharoGsError 320 – PharoCompileError 225 – PharoPrimitive 70 8/27/19 ESUG 2019 29
  • 30. Run Tests • Identify test failures • Update replacement methods • Reload • "rinse and repeat" 8/27/19 ESUG 2019 30
  • 31. Load Seaside Metacello new baseline:'Seaside3'; repository: 'github://SeasideSt/Seaside:master/repository'; onWarningLog; load. • Replace one method: GRPharoPlatform>>seasideSuspendFlowDo: – Create a partial continuation – Note that everything else in GRPharoPlatform works! 8/27/19 ESUG 2019 31
  • 32. Agenda • Motivation • GemStone Namespaces • Hosting Process • Demo • IDE • Summary and Questions 8/28/19 ESUG 2019 32
  • 34. Agenda • Motivation • GemStone Namespaces • Hosting Process • Demo • IDE • Summary and Questions 8/28/19 ESUG 2019 34
  • 35. Integrated Development Environment (IDE) • JADE – Code Browser – Workspace – Inspector – Debugger 8/27/19 ESUG 2019 35
  • 36. Agenda • Motivation • GemStone Namespaces • Hosting Process • Demo • IDE • Summary and Questions 8/28/19 ESUG 2019 36
  • 37. Summary • Proof of concept – Can it be done? • Challenges? – Compiler, UFFI, thisContext, slots, traits, … • Personal motivation – Academic research (publish, degree) – Not a GemTalk sponsored project • But GemTalk has shown a lot of support for Pharo; talk to us about interest! 8/28/19 ESUG 2019 37
  • 40. Questions? • James.Foster@GemTalkSystems.com – VP for Finance and Operations • James.Foster@WallaWalla.edu – Assistant Professor of Computer Science 8/27/19 ESUG 2019 40