SlideShare a Scribd company logo
Esug 2017
Meta-modeling
Of custom
Pharo images
Pavel Krivanek, INRIA Nord Europe
The last conference day,
Friday before lunch,
The last presentation
And they want me to listen to a talk
That starts with
META- ????
What???
DEMO
Language meta-models
● provide statical description of the language
elements
● used for source code models and operations
above them
Blah blah…
When is the
plane departure?
meta-models plague
● Pharo runtime meta-model
● Monticello metamodel
● Refactoring Browser
● Ficus
● Hermes
● FAMIX
● Ring
● ...
Damn,
No instructions for
cases when the
terrorists attack with
a new meta-model
Ring
● meta-model to replace MC and RB
● Veronica Uquillas Gomez
● since Pharo 1.4 (2012)
● provide common API at structural and Runtime
level
● foundational model in Pharo
One ring to rule them all
 Metamodeling of custom Pharo images
Ring - problems
● not up-to-date
– slots
– layouts
– limited traits support (compositions...)
It was nice with you
But it is time to update
the ring
Ring - problems
● standalone models
● mixing of the model and real-time system
m := RGMethodDefinition
className: #Object
selector: #yourself
isMetaSide: false.
m methodClass >>> Object
real class
I found a resolution of the
Fermi paradox. Sooner or
later every civilization in the
universe reaches a point
when it mixes a model with
a Real-time system 
Ring - problems
● is nil real value or undefined value?
aClass := RGClassDefinition named: #ProtoObject.
aClass superclass >>> nil.
aClass2 := RGClassDefinition named: #SomeClass.
aClass2 superclass >>> nil I swear that a minute
ago the superclass was
there!
Ring - problems
● low tests coverage
protocol
self isActive
IfTrue: [ ^ ...].
self isHistorical
IfTrue: [ ^... ].
^ protocol
Self isHysterical iftrue:
Improved Ring
● requirements
– easy standalone models
– transparent linkage on run-time system
– cover new Pharo language features
– handle unresolved values
– usable for bootstrap
– browseable
– announcements
Do not forget to display an
inscription when heated in
a fire 
Improved Ring
● scenarios
– browse current run-time environment
– browse (& modify) external packages
– browse remote image
– run code quality check on an external packages
– browse external (unloaded) package like a loaded one
– bootstrap small IoT ready images
– study history of the code
Browse the previous commit of an external package like it
would be loaded into an external image running on a bulb in
my garden house
Ring 2 - fundamentals
1) every Ring model has own complete
environment
method := RG2MethodDefinition named: #someMethod.
method methodClass methods size >>> 1
method methodClass metaclass methods size >>> 0.
method package definedClasses size >>> 1.
layout := RG2EphemeronLayoutDefinition new.
layout parent isClass >>> 1.
layout environment hasTraits >>> false.
The next environmentalist!
Aaaaaaaaa!!!
Ring 2 - fundamentals
2) every model property is unresolved before we
know its real value
method := RG2MethodDefinition named: #someMethod.
method name isRing2Resolved >>> true.
method methodClass isRing2Resolved >>> false.
method package isRing2Resolved >>> false.
method package: (method environment ensurePackageNamed: #somePackage).
method package isRing2Resolved >>> true.
You only realize the real value
of something when you lost it
Ring 2 - fundamentals
3) every unresolved value has a default value
method := RG2MethodDefinition named: #someMethod.
method environment browse.
“Processor become: nil would be better default code!”
Ring 2 - fundamentals
4) every Ring environment has a backend
aClass := RG2ClassDefinition named: #Point.
aClass environment backend class >>> RG2EnvironmentBackend.
aClass superclass name >>> #unresolved.
aClass environment backend: (RG2ReadOnlyImageBackend for:
aClass environment).
aClass superclass name >>> #Object.
RG2TennisBackhand
Ring 2 - fundamentals
env := RG2Environment new.
env backend: (RG2ReadOnlyImageBackend for: env).
env browse.
now show the
same in
Nautilus
Hahaha!!
Ring 2 - fundamentals
RG2BehaviorDefinition>>#superclass
^ self backend forBehavior superclassFor: self
RG2EnvironmentBackend>>#superclassFor:
^ aRG2Behavior pvtSuperclass
RG2BehaviorDefinition>>#pvtSuperclass
^ superclass value
Collections:
localMethodsDo:
addLocalMethod:
removeLocalMethod:
cleanLocalMethods:
Behind Every Great Idea Is
a stupid implementation 
Ring 2 - fundamentals
4) backends can use other models
joinEnv := RG2Environment new.
joinEnv backend: (RG2ReadOnlyJoinBackend for: joinEnv).
joinEnv backend environment1: aRGEnvironment1.
joinEnv backend environment2: aRGEnvironment2.
Ring 2 - fundamentals
5) be as general as possible
– do not expect classes like Object, ProtoObject,
Metaclass
– do not expect that all metaclasses have the same
metaclass (Metaclass)
– do not expect that all Traits have the same metaclass
(Trait)
– do not expect that all class traits have the same
metaclass (ClassTrait)
– ProtoObject class superclass
Once I will be a general too!
Quiz
Object superclass >>> ProtoObject.
Object class superclass >>> ProtoObject class.
ProtoObject superclass >>> nil.
ProtoObject class class >>> Metaclass.
ProtoObject class superclass >>> ?
Metaclass class superclass >>> ?
Easy! Look, I know the answer
Default environments - classes
RG2ClassDefinition named: #SomeClass.
If you think it is easy to make such graphs in dia,
try it yourself
Default environments - traits
RG2TraitDefinition named: #SomeTrait.
I needed some complex graph
to look smart
Environments cleaning
● unify Metaclass (Metaclass, PCMetaclass)
● unify Trait
● unify TraitClass
● check class – superclass – superclass metaclass –
metaclass circles
● remove unused unreferenced behaviors
● remove unused unreferenced packages
● fix ProtoObject class superclass
Recycle trash And Prefer bicycles over cars
Query interface
● prevent huge class for environment
● RG2Environment provides only basic interface
needed for the backend
● #ask
● caching
environment := RG2Environment new.
environment ask allClasses.
Behind Every stupid Idea Is
an even more stupid   
implementation
Announcements
● enable tools binding
● multiple browsers on the same environment
● can be suspended
environment := RG2Environment new.
environment announcer.
environment := RG2Environment new.
environment announcer suspendAllWhile: [
environment clean.
].
Have you tried multiple environments
on the same browser?
Behavior kind switching
● example:
– during a package loading create an extension
method of a behavior, expect it is a class
– later realize that it is a trait
env := RG2Environment new.
class := env ensureClassNamed: #SomeBehavior.
class class >>> RG2ClassDefinition.
method := class ensureLocalMethodNamed: #someMethod.
trait := env ensureTraitNamed: #SomeBehavior.
(trait localMethods collect: #name) >>> #(someMethod).
trait class >>> RG2TraitDefinition.
(class == trait) >>> true
Blah blah, maybe I should go for lunch now to be
the first one there
Bootstrap
● by Guille Polito
● create image from a source code model
● small task-oriented images
repository := MCFileTreeRepository new
directory: './src' asFileReference;
yourself.
environment := repository asRing2Environment.
environment fixProtoObjectClassSuperclass.
environment addGlobalsNamed: #(#Smalltalk #SourceFiles
#Transcript #Undeclared #Display #TextConstants #Sensor
#Processor #SystemOrganization).
environment clean.
environment bootstrap.
Congratulations,
You have
a nice small 
image
Calypso
● by Denis Kudriashov
● new system browser
environment := RG2Environment new.
environment browse.
environment := RG2Environment new.
#Kernel asPackage mcWorkingCopy snapshot
importInto: environment asPackageNamed: #Kernel.
environment clean.
environment browse.
Calypso kept Odysseus prisoner for seven years and
they had sex together Although he was married
Hermes
● by Pablo Tesone
● binary packages exporter/loader
● needs full environment (instVars indexes)
toExport := #('SUnit-Core').
environment fixProtoObjectClassSuperclass.
environment addGlobalsNamed: #(#Smalltalk #UTF8TextConverter #MacRomanTextConverter #FileStream
ChangeSet Character).
environment clean.
toExport do: [ :packageName |
oldPackage := environment ask packageNamed: packageName.
hePackage := HERing2ToHermesBuilder new visitPackage: (oldPackage).
writer := HEBinaryReaderWriter new
stream: (File openForWriteFileNamed: packageName, '.hermes');
yourself.
hePackage writeInto: writer.
writer flush; close. ].
Never choose names from the Greek mythology,
Hermes was a patron of thiefs
Further work
● Pharo integration
● more backends
● more importers/exporters
● modify tools to support it (Dependency Analyzer,
QA)
● ...
And of course - rule them all
Thank you

More Related Content

PDF
Moldable meta-models for Moose
ESUG
 
PDF
Running Pharo on the GemStone VM
ESUG
 
PDF
Java SE 9 modules - an introduction (July 2018)
Stephen Colebourne
 
KEY
No locked doors, no windows barred: hacking OpenAM infrastructure
Andrew Petukhov
 
PDF
Introduction to the Java bytecode - So@t - 20130924
yohanbeschi
 
PDF
Greach 2014 - Metaprogramming with groovy
Iván López Martín
 
PPTX
Java history, versions, types of errors and exception, quiz
SAurabh PRajapati
 
PPTX
Logging and Exception
Azeem Mumtaz
 
Moldable meta-models for Moose
ESUG
 
Running Pharo on the GemStone VM
ESUG
 
Java SE 9 modules - an introduction (July 2018)
Stephen Colebourne
 
No locked doors, no windows barred: hacking OpenAM infrastructure
Andrew Petukhov
 
Introduction to the Java bytecode - So@t - 20130924
yohanbeschi
 
Greach 2014 - Metaprogramming with groovy
Iván López Martín
 
Java history, versions, types of errors and exception, quiz
SAurabh PRajapati
 
Logging and Exception
Azeem Mumtaz
 

What's hot (20)

PDF
Inside the JVM - Follow the white rabbit! / Breizh JUG
Sylvain Wallez
 
PPTX
Java bytecode and classes
yoavwix
 
PPTX
Java 9 features
shrinath97
 
ODP
Ast transformation
Gagan Agrawal
 
PPTX
Java byte code & virtual machine
Laxman Puri
 
PPTX
What's new in Java 11
Michel Schudel
 
PPTX
Build, logging, and unit test tools
Allan Huang
 
PDF
Introduction to Groovy runtime metaprogramming and AST transforms
Marcin Grzejszczak
 
PDF
New Features Of JDK 7
Deniz Oguz
 
PPT
Invoke dynamics
Balamurugan Soundararajan
 
PDF
55 new things in Java 7 - Devoxx France
David Delabassee
 
PDF
An Introduction to Java Compiler and Runtime
Omar Bashir
 
PDF
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Volha Banadyseva
 
PDF
Understanding Java Dynamic Proxies
Rafael Luque Leiva
 
PDF
PHP Development Tools
Antony Abramchenko
 
PDF
Code lifecycle in the jvm - TopConf Linz
Ivan Krylov
 
PDF
Java Course 15: Ant, Scripting, Spring, Hibernate
Anton Keks
 
PPTX
JAVA BYTE CODE
Javed Ahmed Samo
 
PDF
What to expect from Java 9
Ivan Krylov
 
Inside the JVM - Follow the white rabbit! / Breizh JUG
Sylvain Wallez
 
Java bytecode and classes
yoavwix
 
Java 9 features
shrinath97
 
Ast transformation
Gagan Agrawal
 
Java byte code & virtual machine
Laxman Puri
 
What's new in Java 11
Michel Schudel
 
Build, logging, and unit test tools
Allan Huang
 
Introduction to Groovy runtime metaprogramming and AST transforms
Marcin Grzejszczak
 
New Features Of JDK 7
Deniz Oguz
 
Invoke dynamics
Balamurugan Soundararajan
 
55 new things in Java 7 - Devoxx France
David Delabassee
 
An Introduction to Java Compiler and Runtime
Omar Bashir
 
Владимир Иванов. Java 8 и JVM: что нового в HotSpot
Volha Banadyseva
 
Understanding Java Dynamic Proxies
Rafael Luque Leiva
 
PHP Development Tools
Antony Abramchenko
 
Code lifecycle in the jvm - TopConf Linz
Ivan Krylov
 
Java Course 15: Ant, Scripting, Spring, Hibernate
Anton Keks
 
JAVA BYTE CODE
Javed Ahmed Samo
 
What to expect from Java 9
Ivan Krylov
 
Ad

Similar to Metamodeling of custom Pharo images (20)

PDF
2013 pharo conference
Pharo
 
PPTX
API Documentation Workshop tcworld India 2015
Tom Johnson
 
PDF
Of Harmony and Stinginess: Applicative, Monad, and iterative library design
jspha
 
PPTX
Raml basic tutorial
Arun Yaligar
 
PDF
Developing Distributed Semantic Systems
Antonio Garrote Hernández
 
PDF
Microservices Practitioner Summit Jan '15 - Don't Build a Distributed Monolit...
Ambassador Labs
 
KEY
Polyglot parallelism
Phillip Toland
 
PDF
Microservices and the Art of Taming the Dependency Hell Monster
C4Media
 
PDF
WebObjects Developer Tools
WO Community
 
PDF
Rest Reuse And Serendipity
QConLondon2008
 
PDF
FP Days: Down the Clojure Rabbit Hole
Christophe Grand
 
PPTX
Java Modularity with OSGi
Ilya Rybak
 
PPTX
Mule soft meetup_4_mty_online_oct_2020
Veyra Celina
 
KEY
Pharo, an innovative and open-source Smalltalk
Serge Stinckwich
 
PPT
Introduction to Web Services - Architecture
Matrix823409
 
PDF
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
mfrancis
 
PDF
FASTEN: Scaling static analyses to ecosystem, presented at FOSDEM 2020 in Bru...
Fasten Project
 
PDF
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
apidays
 
PDF
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
mfrancis
 
2013 pharo conference
Pharo
 
API Documentation Workshop tcworld India 2015
Tom Johnson
 
Of Harmony and Stinginess: Applicative, Monad, and iterative library design
jspha
 
Raml basic tutorial
Arun Yaligar
 
Developing Distributed Semantic Systems
Antonio Garrote Hernández
 
Microservices Practitioner Summit Jan '15 - Don't Build a Distributed Monolit...
Ambassador Labs
 
Polyglot parallelism
Phillip Toland
 
Microservices and the Art of Taming the Dependency Hell Monster
C4Media
 
WebObjects Developer Tools
WO Community
 
Rest Reuse And Serendipity
QConLondon2008
 
FP Days: Down the Clojure Rabbit Hole
Christophe Grand
 
Java Modularity with OSGi
Ilya Rybak
 
Mule soft meetup_4_mty_online_oct_2020
Veyra Celina
 
Pharo, an innovative and open-source Smalltalk
Serge Stinckwich
 
Introduction to Web Services - Architecture
Matrix823409
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
mfrancis
 
FASTEN: Scaling static analyses to ecosystem, presented at FOSDEM 2020 in Bru...
Fasten Project
 
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
apidays
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
mfrancis
 
Ad

More from ESUG (20)

PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PDF
Directing Generative AI for Pharo Documentation
ESUG
 
PDF
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
ESUG
 
PDF
Integrating Executable Requirements in Prototyping
ESUG
 
PDF
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
ESUG
 
PDF
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
ESUG
 
PDF
Analysing Python Machine Learning Notebooks with Moose
ESUG
 
PDF
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
ESUG
 
PDF
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
ESUG
 
PDF
Package-Aware Approach for Repository-Level Code Completion in Pharo
ESUG
 
PDF
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
ESUG
 
PDF
An Analysis of Inline Method Refactoring
ESUG
 
PDF
Identification of unnecessary object allocations using static escape analysis
ESUG
 
PDF
Control flow-sensitive optimizations In the Druid Meta-Compiler
ESUG
 
PDF
Clean Blocks (IWST 2025, Gdansk, Poland)
ESUG
 
PDF
Encoding for Objects Matters (IWST 2025)
ESUG
 
PDF
Challenges of Transpiling Smalltalk to JavaScript
ESUG
 
PDF
Immersive experiences: what Pharo users do!
ESUG
 
PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
ESUG
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
Directing Generative AI for Pharo Documentation
ESUG
 
Even Lighter Than Lightweiht: Augmenting Type Inference with Primitive Heuris...
ESUG
 
Integrating Executable Requirements in Prototyping
ESUG
 
Composing and Performing Electronic Music on-the-Fly with Pharo and Coypu
ESUG
 
Gamifying Agent-Based Models in Cormas: Towards the Playable Architecture for...
ESUG
 
Analysing Python Machine Learning Notebooks with Moose
ESUG
 
FASTTypeScript metamodel generation using FAST traits and TreeSitter project
ESUG
 
Migrating Katalon Studio Tests to Playwright with Model Driven Engineering
ESUG
 
Package-Aware Approach for Repository-Level Code Completion in Pharo
ESUG
 
Evaluating Benchmark Quality: a Mutation-Testing- Based Methodology
ESUG
 
An Analysis of Inline Method Refactoring
ESUG
 
Identification of unnecessary object allocations using static escape analysis
ESUG
 
Control flow-sensitive optimizations In the Druid Meta-Compiler
ESUG
 
Clean Blocks (IWST 2025, Gdansk, Poland)
ESUG
 
Encoding for Objects Matters (IWST 2025)
ESUG
 
Challenges of Transpiling Smalltalk to JavaScript
ESUG
 
Immersive experiences: what Pharo users do!
ESUG
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 

Recently uploaded (20)

PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 

Metamodeling of custom Pharo images

  • 1. Esug 2017 Meta-modeling Of custom Pharo images Pavel Krivanek, INRIA Nord Europe
  • 2. The last conference day, Friday before lunch, The last presentation And they want me to listen to a talk That starts with META- ???? What???
  • 4. Language meta-models ● provide statical description of the language elements ● used for source code models and operations above them Blah blah… When is the plane departure?
  • 5. meta-models plague ● Pharo runtime meta-model ● Monticello metamodel ● Refactoring Browser ● Ficus ● Hermes ● FAMIX ● Ring ● ... Damn, No instructions for cases when the terrorists attack with a new meta-model
  • 6. Ring ● meta-model to replace MC and RB ● Veronica Uquillas Gomez ● since Pharo 1.4 (2012) ● provide common API at structural and Runtime level ● foundational model in Pharo One ring to rule them all
  • 8. Ring - problems ● not up-to-date – slots – layouts – limited traits support (compositions...) It was nice with you But it is time to update the ring
  • 9. Ring - problems ● standalone models ● mixing of the model and real-time system m := RGMethodDefinition className: #Object selector: #yourself isMetaSide: false. m methodClass >>> Object real class I found a resolution of the Fermi paradox. Sooner or later every civilization in the universe reaches a point when it mixes a model with a Real-time system 
  • 10. Ring - problems ● is nil real value or undefined value? aClass := RGClassDefinition named: #ProtoObject. aClass superclass >>> nil. aClass2 := RGClassDefinition named: #SomeClass. aClass2 superclass >>> nil I swear that a minute ago the superclass was there!
  • 11. Ring - problems ● low tests coverage protocol self isActive IfTrue: [ ^ ...]. self isHistorical IfTrue: [ ^... ]. ^ protocol Self isHysterical iftrue:
  • 12. Improved Ring ● requirements – easy standalone models – transparent linkage on run-time system – cover new Pharo language features – handle unresolved values – usable for bootstrap – browseable – announcements Do not forget to display an inscription when heated in a fire 
  • 13. Improved Ring ● scenarios – browse current run-time environment – browse (& modify) external packages – browse remote image – run code quality check on an external packages – browse external (unloaded) package like a loaded one – bootstrap small IoT ready images – study history of the code Browse the previous commit of an external package like it would be loaded into an external image running on a bulb in my garden house
  • 14. Ring 2 - fundamentals 1) every Ring model has own complete environment method := RG2MethodDefinition named: #someMethod. method methodClass methods size >>> 1 method methodClass metaclass methods size >>> 0. method package definedClasses size >>> 1. layout := RG2EphemeronLayoutDefinition new. layout parent isClass >>> 1. layout environment hasTraits >>> false. The next environmentalist! Aaaaaaaaa!!!
  • 15. Ring 2 - fundamentals 2) every model property is unresolved before we know its real value method := RG2MethodDefinition named: #someMethod. method name isRing2Resolved >>> true. method methodClass isRing2Resolved >>> false. method package isRing2Resolved >>> false. method package: (method environment ensurePackageNamed: #somePackage). method package isRing2Resolved >>> true. You only realize the real value of something when you lost it
  • 16. Ring 2 - fundamentals 3) every unresolved value has a default value method := RG2MethodDefinition named: #someMethod. method environment browse. “Processor become: nil would be better default code!”
  • 17. Ring 2 - fundamentals 4) every Ring environment has a backend aClass := RG2ClassDefinition named: #Point. aClass environment backend class >>> RG2EnvironmentBackend. aClass superclass name >>> #unresolved. aClass environment backend: (RG2ReadOnlyImageBackend for: aClass environment). aClass superclass name >>> #Object. RG2TennisBackhand
  • 18. Ring 2 - fundamentals env := RG2Environment new. env backend: (RG2ReadOnlyImageBackend for: env). env browse. now show the same in Nautilus Hahaha!!
  • 19. Ring 2 - fundamentals RG2BehaviorDefinition>>#superclass ^ self backend forBehavior superclassFor: self RG2EnvironmentBackend>>#superclassFor: ^ aRG2Behavior pvtSuperclass RG2BehaviorDefinition>>#pvtSuperclass ^ superclass value Collections: localMethodsDo: addLocalMethod: removeLocalMethod: cleanLocalMethods: Behind Every Great Idea Is a stupid implementation 
  • 20. Ring 2 - fundamentals 4) backends can use other models joinEnv := RG2Environment new. joinEnv backend: (RG2ReadOnlyJoinBackend for: joinEnv). joinEnv backend environment1: aRGEnvironment1. joinEnv backend environment2: aRGEnvironment2.
  • 21. Ring 2 - fundamentals 5) be as general as possible – do not expect classes like Object, ProtoObject, Metaclass – do not expect that all metaclasses have the same metaclass (Metaclass) – do not expect that all Traits have the same metaclass (Trait) – do not expect that all class traits have the same metaclass (ClassTrait) – ProtoObject class superclass Once I will be a general too!
  • 22. Quiz Object superclass >>> ProtoObject. Object class superclass >>> ProtoObject class. ProtoObject superclass >>> nil. ProtoObject class class >>> Metaclass. ProtoObject class superclass >>> ? Metaclass class superclass >>> ? Easy! Look, I know the answer
  • 23. Default environments - classes RG2ClassDefinition named: #SomeClass. If you think it is easy to make such graphs in dia, try it yourself
  • 24. Default environments - traits RG2TraitDefinition named: #SomeTrait. I needed some complex graph to look smart
  • 25. Environments cleaning ● unify Metaclass (Metaclass, PCMetaclass) ● unify Trait ● unify TraitClass ● check class – superclass – superclass metaclass – metaclass circles ● remove unused unreferenced behaviors ● remove unused unreferenced packages ● fix ProtoObject class superclass Recycle trash And Prefer bicycles over cars
  • 26. Query interface ● prevent huge class for environment ● RG2Environment provides only basic interface needed for the backend ● #ask ● caching environment := RG2Environment new. environment ask allClasses. Behind Every stupid Idea Is an even more stupid    implementation
  • 27. Announcements ● enable tools binding ● multiple browsers on the same environment ● can be suspended environment := RG2Environment new. environment announcer. environment := RG2Environment new. environment announcer suspendAllWhile: [ environment clean. ]. Have you tried multiple environments on the same browser?
  • 28. Behavior kind switching ● example: – during a package loading create an extension method of a behavior, expect it is a class – later realize that it is a trait env := RG2Environment new. class := env ensureClassNamed: #SomeBehavior. class class >>> RG2ClassDefinition. method := class ensureLocalMethodNamed: #someMethod. trait := env ensureTraitNamed: #SomeBehavior. (trait localMethods collect: #name) >>> #(someMethod). trait class >>> RG2TraitDefinition. (class == trait) >>> true Blah blah, maybe I should go for lunch now to be the first one there
  • 29. Bootstrap ● by Guille Polito ● create image from a source code model ● small task-oriented images repository := MCFileTreeRepository new directory: './src' asFileReference; yourself. environment := repository asRing2Environment. environment fixProtoObjectClassSuperclass. environment addGlobalsNamed: #(#Smalltalk #SourceFiles #Transcript #Undeclared #Display #TextConstants #Sensor #Processor #SystemOrganization). environment clean. environment bootstrap. Congratulations, You have a nice small  image
  • 30. Calypso ● by Denis Kudriashov ● new system browser environment := RG2Environment new. environment browse. environment := RG2Environment new. #Kernel asPackage mcWorkingCopy snapshot importInto: environment asPackageNamed: #Kernel. environment clean. environment browse. Calypso kept Odysseus prisoner for seven years and they had sex together Although he was married
  • 31. Hermes ● by Pablo Tesone ● binary packages exporter/loader ● needs full environment (instVars indexes) toExport := #('SUnit-Core'). environment fixProtoObjectClassSuperclass. environment addGlobalsNamed: #(#Smalltalk #UTF8TextConverter #MacRomanTextConverter #FileStream ChangeSet Character). environment clean. toExport do: [ :packageName | oldPackage := environment ask packageNamed: packageName. hePackage := HERing2ToHermesBuilder new visitPackage: (oldPackage). writer := HEBinaryReaderWriter new stream: (File openForWriteFileNamed: packageName, '.hermes'); yourself. hePackage writeInto: writer. writer flush; close. ]. Never choose names from the Greek mythology, Hermes was a patron of thiefs
  • 32. Further work ● Pharo integration ● more backends ● more importers/exporters ● modify tools to support it (Dependency Analyzer, QA) ● ... And of course - rule them all