Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Running Pharo on the
GemStone VM
James Foster
VP of Finance & Operations, GemTalk Systems LLC
ESUG 2017 – Maribor, Sloveni...
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 (sing...
Welcome to the magical
world of GemStone
• Object space limited by
disk, not RAM
• Object space shared
across multiple VMs...
GemStone/S Architecture
5
Gem Types
• Linked Gem
– Gem in application process space
• Remote Procedure Call (RPC) Gem
– GCI library in application s...
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
Repo...
Two-Machine Process Locations (Gem Remote from Stone)
10
Application
& GCI
Library
Gem
Gem Host
Remote SPC
Page
Server
N
E...
Three-Machine Process Locations
11
Application
& GCI
Library
Client Host
N
E
T
W
O
R
K
Gem
Gem Host
Remote SPC
Page
Server...
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 ...
Option 1: Complete Replacement
• Not possible in most Smalltalks
– Creating methods requires code
• GemStone schema editin...
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 CompiledMe...
GemStone/S Global Lookup
18
AllUsers
(a UserProfileSet)
a UserProfile
a SymbolList
(Array)
Repository
a SymbolDictionary a...
Unique or Shared SymbolDictionary Instances
19
AllUsers
Bob
a SymbolList
Repository
1. UserGlobals
Carol
a SymbolList
2. G...
Unique or Shared SymbolAssociation Instances
20
1. UserGlobals
assoc
#Arraykey
Array
value
2. Globals
1. UserGlobals
assoc...
Unique Keys
21
1. UserGlobals
assoc
#Arraykey
Array
value
2. Globals
1. UserGlobals
assoc
key
value
Bob’s SymbolList Carol...
Unique Values
22
1. UserGlobals
2. Globals
1. UserGlobals
Bob’s SymbolList Carol’s SymbolList
assoc
#OrderedCollection
key...
Problems with Parallel Class Hierarchy
• GemStone’s namespace model allows separate
hierarchy
• But complications exist:
–...
Complication: Literals (and their superclasses)
• Array: #()
• BlockClosure: []
• Boolean: true, false
• ByteArray: #[1 2 ...
Complication: Classes Known to the VM
• Behavior, Class, Metaclass
• Exception, MessageNotUnderstood, ZeroDivide, …
• Prag...
Problem: Conflicting Implementations
• Array>>printOn:
– Pharo
• #(1 2 3) printString '#(1 2 3)'
– GemStone
• #(1 2 3) pri...
Option 3: Parallel Methods in GemStone Classes
• Each GemStone class has a collection of
MethodDictionary instances
– Meth...
28
Array Array class
a MethodDictionary a MethodDictionary
Pharo Method Dictionaries
Arrayed
Collection
Arrayed
Collection...
29
Array Array 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]...
Sample Messages
• Implicit
– “in env 0” #(1 2 3) printString 'anArray( 1, 2, 3)'
– “in env 2” #(1 2 3) printString '#(1 2 ...
Problems with Using GemStone Classes
• GemStone class might have different schema
– OrderedCollection in Pharo
• Instance ...
Options
1. Replace all classes
But schema is wrong in some cases
And we would like to use tools during development
2. Use ...
Tools
• Topaz
– GemStone’s command-line interface
• GemBuilder for Smalltalk (GBS)
– GemStone’s GUI IDE for VA & VW
• Othe...
Issues
• Incomplete Class Types
– GemStone has in-memory Ephemerons, but no
Weak references
– No 32-bit objects
• GemStone...
Demo
• http://files.pharo.org/get-files/60/pharo-minimal.zip
• http://downloads.gemtalksystems.com/pub/GemStone64/3.4.0-Al...
Questions?
37
GemTalk Systems LLC
15220 NW Greenbrier Pkwy., Suite 240
Beaverton, Oregon, 97006
Voice & Fax: +1 503 766 47...
Upcoming SlideShare
Loading in …5
×

of

Running Pharo on the GemStone VM Slide 1 Running Pharo on the GemStone VM Slide 2 Running Pharo on the GemStone VM Slide 3 Running Pharo on the GemStone VM Slide 4 Running Pharo on the GemStone VM Slide 5 Running Pharo on the GemStone VM Slide 6 Running Pharo on the GemStone VM Slide 7 Running Pharo on the GemStone VM Slide 8 Running Pharo on the GemStone VM Slide 9 Running Pharo on the GemStone VM Slide 10 Running Pharo on the GemStone VM Slide 11 Running Pharo on the GemStone VM Slide 12 Running Pharo on the GemStone VM Slide 13 Running Pharo on the GemStone VM Slide 14 Running Pharo on the GemStone VM Slide 15 Running Pharo on the GemStone VM Slide 16 Running Pharo on the GemStone VM Slide 17 Running Pharo on the GemStone VM Slide 18 Running Pharo on the GemStone VM Slide 19 Running Pharo on the GemStone VM Slide 20 Running Pharo on the GemStone VM Slide 21 Running Pharo on the GemStone VM Slide 22 Running Pharo on the GemStone VM Slide 23 Running Pharo on the GemStone VM Slide 24 Running Pharo on the GemStone VM Slide 25 Running Pharo on the GemStone VM Slide 26 Running Pharo on the GemStone VM Slide 27 Running Pharo on the GemStone VM Slide 28 Running Pharo on the GemStone VM Slide 29 Running Pharo on the GemStone VM Slide 30 Running Pharo on the GemStone VM Slide 31 Running Pharo on the GemStone VM Slide 32 Running Pharo on the GemStone VM Slide 33 Running Pharo on the GemStone VM Slide 34 Running Pharo on the GemStone VM Slide 35 Running Pharo on the GemStone VM Slide 36 Running Pharo on the GemStone VM Slide 37
Upcoming SlideShare
GemTalk Systems Overview
Next
Download to read offline and view in fullscreen.

3 Likes

Share

Download to read offline

Running Pharo on the GemStone VM

Download to read offline

ESUG 2017

Youtube: https://youtu.be/TkvjUXn3tGs

First Name: James
Last Name: Foster

Abstract:

One of the features of traditional Smalltalk is that the development
tools are in the same object space as the application being
developed. A corollary is that it has generally been a challenge to
debug a remote object space or build up a new class library from
scratch. But GemStone's multi-user architecture provides some
intriguing abilities to isolate not just classes, but methods. In
this presentation we provide an introduction to GemStone/S and
demonstrate running a Minimal-Pharo (with over 1400 classes) in
GemStone.

Bio:

As a junior-high student in 1971, James discovered the local
university’s computer center and a life-long obsession with computers
began. He was introduced to Smalltalk/V for the Mac in the mid-90s,
and became a Smalltalk bigot. James is VP of Finance & Operations for
GemTalk Systems and is a passionate advocate for GemStone and all
things Smalltalk. [Because this presentation includes an introduction
to GemStone we request that it come early in the week, before other
GemStone-related presentations.]

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Running Pharo on the GemStone VM

  1. 1. Running Pharo on the GemStone VM James Foster VP of Finance & Operations, GemTalk Systems LLC ESUG 2017 – Maribor, Slovenia 4 September 2017
  2. 2. Agenda • GemStone/S Introduction • Replacing Base Class Libraries • Questions 2
  3. 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. 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
  5. 5. GemStone/S Architecture 5
  6. 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. 7. One-Machine Process Locations (Linked Gem) 7 Application & GCI Library Gem Stone SPC Repository
  8. 8. One-Machine Process Locations (RPC Gem) 8 Application & GCI Library Gem Stone SPC Repository NetLDI
  9. 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. 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. 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
  12. 12. Shared Page Cache 12
  13. 13. Agenda • GemStone/S Introduction • Replacing Base Class Libraries • Questions 13
  14. 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. 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. 16. Option 2: Parallel Class Hierarchy • GemStone’s namespace model allows separate hierarchy 16
  17. 17. Pharo Global Lookup 17 Smalltalk (a SmalltalkImage) a SystemDictionary a GlobalVariable (Association) globals a CompiledMethod a Symbolkey an Object value Image
  18. 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. 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. 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. 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. 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. 23. Problems with Parallel Class Hierarchy • GemStone’s namespace model allows separate hierarchy • But complications exist: – Literals – Classes known to the VM 23
  24. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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
  36. 36. Demo • http://files.pharo.org/get-files/60/pharo-minimal.zip • http://downloads.gemtalksystems.com/pub/GemStone64/3.4.0-Alpha4/ • https://github.com/jgfoster/PharoGs/tree/james/james 36
  37. 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 ®
  • rishikulkarni

    Sep. 2, 2020
  • PrudhviKumar20

    Oct. 25, 2017
  • philippeback

    Sep. 10, 2017

ESUG 2017 Youtube: https://youtu.be/TkvjUXn3tGs First Name: James Last Name: Foster Abstract: One of the features of traditional Smalltalk is that the development tools are in the same object space as the application being developed. A corollary is that it has generally been a challenge to debug a remote object space or build up a new class library from scratch. But GemStone's multi-user architecture provides some intriguing abilities to isolate not just classes, but methods. In this presentation we provide an introduction to GemStone/S and demonstrate running a Minimal-Pharo (with over 1400 classes) in GemStone. Bio: As a junior-high student in 1971, James discovered the local university’s computer center and a life-long obsession with computers began. He was introduced to Smalltalk/V for the Mac in the mid-90s, and became a Smalltalk bigot. James is VP of Finance & Operations for GemTalk Systems and is a passionate advocate for GemStone and all things Smalltalk. [Because this presentation includes an introduction to GemStone we request that it come early in the week, before other GemStone-related presentations.]

Views

Total views

984

On Slideshare

0

From embeds

0

Number of embeds

22

Actions

Downloads

6

Shares

0

Comments

0

Likes

3

×