SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
1
Prototalk: an Environment for
Teaching, Understanding,
Designing and Prototyping OO
Languages
Alexandre Bergel, Christophe Dony, Stéphane Ducasse
University of Bern (Switzerland)
LIRMM, Montpellier (France)
bergel@iam.unibe.ch
2
Outline
1. Prototype OO Languages
2. Expressing Different Languages
3. Prototalk
4. Example: Newtonscript
5. Conclusion
3
Prototype OO Languages
• Classless paradigm
• A prototype contains its state and
behavior
• Link between prototypes is usually
done using:
• Delegation
• Composition
4
Different Languages
• Self: Unification of variables and
methods and multiple parents
• ObjectLisp: variables distinct from
methods
• NewtonScript: two kinds of delegation
over two links
5
Prototalk
6
Goal and Design Decisions
• Uniformity: same syntax for all the
languages
• Minimality: minimal kernel to express
the most general semantics
• Extensibility: new languages has to be
implemented efficiently and easily
• Usability: integrated in the
environment
7
Prototalk
• Language represented by a subclass of
AbstractProto
• Execution of program by sending
evaluate: to it
• The AST is built using a
ProgramNodeBuilder
• It is composed of subclass of the
Smalltalk AST nodes
8
Architecture
AbstractObjectModel
evaluate: sourceCode
compileMethodAt: name
compile: codeSource
globalVar: varName put: aValue
nodeBuilder
NodeBuilder
newVariableName: name
newMessageReceiver: rcvr
...
ProgramNode
eval: context
MethodNode
selector
block
eval: context
applyWith: args in: context
VariableNode
variableName
eval: context
MessageNode
selector
eval: context
Language1
variables
methods
methodOwner: name
clone
...
Language1NodeBuilder
newVariableName: name
newMessageReceiver:
...
Language1
VariableNode
eval: context
Language1
MessageNode
eval: context
Prototalk Base
Implementation of Language1
9
Language1
• Language1 is a subclass of
AbstractProto
• Ability to execute programs
• Prototypes are represented by its
instances
• Provides primitives like clone, addVar:
addMethod:, hasVar:, ...
10
Example: NewtonScript
• It has a double inheritance: _proto is
searched prior to _parent
_parent
_proto
11
Double Inheritance
f := {getX: funct() x, _proto: {_proto: {x: 10}}};
f._parent := {x: 20};
f getX x: 10
x: 20
_parent
_proto
f.getX() ==> 10
12
In Prototalk
f := {getX: funct() x, _proto: {_proto: {x: 10}}};
f._parent := {x: 20};
f.getX() ==> 10
The same program in Prototalk:
NewtonScriptLike evaluate: ‘
f := PRoot clone.
f proto: (PRoot clone; proto: (PRoot clone; addSlot: ‘‘x = 10’’)).
f addSlot: ‘‘getX x’’.
f parent: (PRoot clone; addSlot: ‘x = 20’).
f getX.’
13
In Prototalk
AbstractProto
NewtonScriptLike
parent
proto
methodOwner: name
methodOwnerInProto: name
t := self methodOwnerInProto: name.
^ t isNil
ifTrue: [
parent isNil
ifTrue: [nil]
ifFalse: [parent methodOwner: name]]
ifFalse: [t]]
^ (slots includesKey: name)
ifTrue: [self]
ifFalse: [
proto isNil
ifTrue: [nil]
ifFalse:
[proto methodOwnerInProto: name]]
slots
14
Conclusion
• Platform to design and experiment
prototypes-based OO language
• Pure interpretation of programs
• Pedagogical tool: used at University
Paris VI, Montpellier and Berne
15
• Prototalk: an Environment for
Teaching, Understanding, Designing
and Prototyping OO languages
• bergel@iam.unibe.ch
16
17
Hierarchy of Object Model
AbstractProto
newEmpty
SlotProto
slots
clone
addSlot: name
method: code
methodNamed: name
L11
initInitials: slots
newInitials: slots
L11AndImplicitDelegation
parent
clone
methodLookup: name
parent
son
L16
ModifiableSlot
L7
L7AndImplicitDelegation
parent
initializeParent: parent
close
SelfLike
addSlot: slot
assignmentMethod: code
L7AndExplicitDelegation
18
ProgramNodeBuilder
SelfLikeAssignment
MethodBuilder
Smalltalk ProgramNodeBuilder
Prototalk ProgramNodeBuilder
ProgramNodeBuilder
newCondition(cond, then, else)
newLiteralValue(literal)
newMessageReceiver(object)
newMethodSelector(methName)
newVariable(varName)
newAssignmentVariable(name)
ImplicitDelegationPNB
newMessageReceiver: object
ImplicitDelegation
EncapsulationPNB
newMessageReceiver: object
newAssignmentVariable: name
ObjectLispLikePNB
newMessageReceiver: object
SelfLikePNB
newVariable: varName
EncapsulationPNB
newVariable: varName
newAssignmentVariable: name
ExplicitDelegationPNB
newMessageReceiver: object
ExplicitDelegationEncapsulationPNB
newVariable: varName
newAssignmentVariable: name
AbstractProto
nodeBuilder
19
Self, ObjectLisp, ...
Person
age=26
name=Luc
eat=...
Student
num=1234567
grade=2
doExam=...
Person
age=26
name=Luc
eat(...)
Student
num=1234567
grade=2
doExam(...)

Weitere ähnliche Inhalte

Andere mochten auch

Welcome ESUG 2005
Welcome ESUG 2005Welcome ESUG 2005
Welcome ESUG 2005ESUG
 
MBA Smalltalk: to manage your objects
MBA Smalltalk: to manage your objectsMBA Smalltalk: to manage your objects
MBA Smalltalk: to manage your objectsESUG
 
trabalho 2
trabalho 2trabalho 2
trabalho 2nlopesr
 
The Value of Smalltalk
The Value of SmalltalkThe Value of Smalltalk
The Value of SmalltalkESUG
 
Meta-Driven Browsers
Meta-Driven BrowsersMeta-Driven Browsers
Meta-Driven BrowsersESUG
 
Ocean
OceanOcean
OceanESUG
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageESUG
 

Andere mochten auch (7)

Welcome ESUG 2005
Welcome ESUG 2005Welcome ESUG 2005
Welcome ESUG 2005
 
MBA Smalltalk: to manage your objects
MBA Smalltalk: to manage your objectsMBA Smalltalk: to manage your objects
MBA Smalltalk: to manage your objects
 
trabalho 2
trabalho 2trabalho 2
trabalho 2
 
The Value of Smalltalk
The Value of SmalltalkThe Value of Smalltalk
The Value of Smalltalk
 
Meta-Driven Browsers
Meta-Driven BrowsersMeta-Driven Browsers
Meta-Driven Browsers
 
Ocean
OceanOcean
Ocean
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta Language
 

Ähnlich wie Prototalk

Design patterns illustrated 010PHP
Design patterns illustrated 010PHPDesign patterns illustrated 010PHP
Design patterns illustrated 010PHPHerman Peeren
 
1. Mini seminar intro
1. Mini seminar intro1. Mini seminar intro
1. Mini seminar introLeonid Maslov
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming LanguageYLTO
 
Python for Delphi Developers - Part 1 Introduction
Python for Delphi Developers - Part 1 IntroductionPython for Delphi Developers - Part 1 Introduction
Python for Delphi Developers - Part 1 IntroductionEmbarcadero Technologies
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2sadhana312471
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4Max Kleiner
 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaActiveState
 
Xbase implementing specific domain language for java
Xbase  implementing specific domain language for javaXbase  implementing specific domain language for java
Xbase implementing specific domain language for javaYash Patel
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesEelco Visser
 
Comment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre docComment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre docJérémie Bresson
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityGeorgePeterBanyard
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Max Kleiner
 
Pal gov.tutorial4.session12 2.wordnets
Pal gov.tutorial4.session12 2.wordnetsPal gov.tutorial4.session12 2.wordnets
Pal gov.tutorial4.session12 2.wordnetsMustafa Jarrar
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovypaulbowler
 
Creating a textual domain specific language
Creating a textual domain specific languageCreating a textual domain specific language
Creating a textual domain specific languageVicente García Díaz
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudyYusuke Ando
 

Ähnlich wie Prototalk (20)

Design patterns illustrated 010PHP
Design patterns illustrated 010PHPDesign patterns illustrated 010PHP
Design patterns illustrated 010PHP
 
1. Mini seminar intro
1. Mini seminar intro1. Mini seminar intro
1. Mini seminar intro
 
Future Programming Language
Future Programming LanguageFuture Programming Language
Future Programming Language
 
Python for Delphi Developers - Part 1 Introduction
Python for Delphi Developers - Part 1 IntroductionPython for Delphi Developers - Part 1 Introduction
Python for Delphi Developers - Part 1 Introduction
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4
 
Python: The Programmer's Lingua Franca
Python: The Programmer's Lingua FrancaPython: The Programmer's Lingua Franca
Python: The Programmer's Lingua Franca
 
Xbase implementing specific domain language for java
Xbase  implementing specific domain language for javaXbase  implementing specific domain language for java
Xbase implementing specific domain language for java
 
TI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific LanguagesTI1220 Lecture 14: Domain-Specific Languages
TI1220 Lecture 14: Domain-Specific Languages
 
Comment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre docComment Asciidoctor peut vous aider pour votre doc
Comment Asciidoctor peut vous aider pour votre doc
 
PHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing InsanityPHP 8: Process & Fixing Insanity
PHP 8: Process & Fixing Insanity
 
Andy On Closures
Andy On ClosuresAndy On Closures
Andy On Closures
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Pal gov.tutorial4.session12 2.wordnets
Pal gov.tutorial4.session12 2.wordnetsPal gov.tutorial4.session12 2.wordnets
Pal gov.tutorial4.session12 2.wordnets
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
DSL's with Groovy
DSL's with GroovyDSL's with Groovy
DSL's with Groovy
 
Creating a textual domain specific language
Creating a textual domain specific languageCreating a textual domain specific language
Creating a textual domain specific language
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
 

Mehr von 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 programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
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 RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
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 resultsESUG
 
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 6ESUG
 
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 GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
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 ModesESUG
 
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 ReportESUG
 
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 APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
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 CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
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 JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
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 TransformationsESUG
 

Mehr von 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
 
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
 
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
 

Kürzlich hochgeladen

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...Martijn de Jong
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Prototalk

  • 1. 1 Prototalk: an Environment for Teaching, Understanding, Designing and Prototyping OO Languages Alexandre Bergel, Christophe Dony, Stéphane Ducasse University of Bern (Switzerland) LIRMM, Montpellier (France) bergel@iam.unibe.ch
  • 2. 2 Outline 1. Prototype OO Languages 2. Expressing Different Languages 3. Prototalk 4. Example: Newtonscript 5. Conclusion
  • 3. 3 Prototype OO Languages • Classless paradigm • A prototype contains its state and behavior • Link between prototypes is usually done using: • Delegation • Composition
  • 4. 4 Different Languages • Self: Unification of variables and methods and multiple parents • ObjectLisp: variables distinct from methods • NewtonScript: two kinds of delegation over two links
  • 6. 6 Goal and Design Decisions • Uniformity: same syntax for all the languages • Minimality: minimal kernel to express the most general semantics • Extensibility: new languages has to be implemented efficiently and easily • Usability: integrated in the environment
  • 7. 7 Prototalk • Language represented by a subclass of AbstractProto • Execution of program by sending evaluate: to it • The AST is built using a ProgramNodeBuilder • It is composed of subclass of the Smalltalk AST nodes
  • 8. 8 Architecture AbstractObjectModel evaluate: sourceCode compileMethodAt: name compile: codeSource globalVar: varName put: aValue nodeBuilder NodeBuilder newVariableName: name newMessageReceiver: rcvr ... ProgramNode eval: context MethodNode selector block eval: context applyWith: args in: context VariableNode variableName eval: context MessageNode selector eval: context Language1 variables methods methodOwner: name clone ... Language1NodeBuilder newVariableName: name newMessageReceiver: ... Language1 VariableNode eval: context Language1 MessageNode eval: context Prototalk Base Implementation of Language1
  • 9. 9 Language1 • Language1 is a subclass of AbstractProto • Ability to execute programs • Prototypes are represented by its instances • Provides primitives like clone, addVar: addMethod:, hasVar:, ...
  • 10. 10 Example: NewtonScript • It has a double inheritance: _proto is searched prior to _parent _parent _proto
  • 11. 11 Double Inheritance f := {getX: funct() x, _proto: {_proto: {x: 10}}}; f._parent := {x: 20}; f getX x: 10 x: 20 _parent _proto f.getX() ==> 10
  • 12. 12 In Prototalk f := {getX: funct() x, _proto: {_proto: {x: 10}}}; f._parent := {x: 20}; f.getX() ==> 10 The same program in Prototalk: NewtonScriptLike evaluate: ‘ f := PRoot clone. f proto: (PRoot clone; proto: (PRoot clone; addSlot: ‘‘x = 10’’)). f addSlot: ‘‘getX x’’. f parent: (PRoot clone; addSlot: ‘x = 20’). f getX.’
  • 13. 13 In Prototalk AbstractProto NewtonScriptLike parent proto methodOwner: name methodOwnerInProto: name t := self methodOwnerInProto: name. ^ t isNil ifTrue: [ parent isNil ifTrue: [nil] ifFalse: [parent methodOwner: name]] ifFalse: [t]] ^ (slots includesKey: name) ifTrue: [self] ifFalse: [ proto isNil ifTrue: [nil] ifFalse: [proto methodOwnerInProto: name]] slots
  • 14. 14 Conclusion • Platform to design and experiment prototypes-based OO language • Pure interpretation of programs • Pedagogical tool: used at University Paris VI, Montpellier and Berne
  • 15. 15 • Prototalk: an Environment for Teaching, Understanding, Designing and Prototyping OO languages • bergel@iam.unibe.ch
  • 16. 16
  • 17. 17 Hierarchy of Object Model AbstractProto newEmpty SlotProto slots clone addSlot: name method: code methodNamed: name L11 initInitials: slots newInitials: slots L11AndImplicitDelegation parent clone methodLookup: name parent son L16 ModifiableSlot L7 L7AndImplicitDelegation parent initializeParent: parent close SelfLike addSlot: slot assignmentMethod: code L7AndExplicitDelegation
  • 18. 18 ProgramNodeBuilder SelfLikeAssignment MethodBuilder Smalltalk ProgramNodeBuilder Prototalk ProgramNodeBuilder ProgramNodeBuilder newCondition(cond, then, else) newLiteralValue(literal) newMessageReceiver(object) newMethodSelector(methName) newVariable(varName) newAssignmentVariable(name) ImplicitDelegationPNB newMessageReceiver: object ImplicitDelegation EncapsulationPNB newMessageReceiver: object newAssignmentVariable: name ObjectLispLikePNB newMessageReceiver: object SelfLikePNB newVariable: varName EncapsulationPNB newVariable: varName newAssignmentVariable: name ExplicitDelegationPNB newMessageReceiver: object ExplicitDelegationEncapsulationPNB newVariable: varName newAssignmentVariable: name AbstractProto nodeBuilder