SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
© Marcus Denker
The Reflectivity
Marcus Denker
with:
Philippe Marschall
David Röthlisberger
Nik Haldiman / Stefan Reichhart
Adrian Lienhard / Lukas Renggli
Eric Tanter
Stephane Ducasse
Oscar Nierstrasz
© Marcus Denker
Structural Reflection
> Structure modeled as objects
— Classes, methods are objects
— Causally connected
> Uses:
— Development environments
— Language extensions and experiments
© Marcus Denker
Methods and Reflection
> Method are Objects
> No high-level model for sub-method elements
— Message sends
— Assignments
— Variable access
> Structural reflection stops at the granularity of methods
© Marcus Denker
Sub-Method Reflection
> Many tools work on sub method level
— Profiler, Refactoring Tool, Debugger, Type Checker
> Communication between tools needed
— example: Code coverage
> All tools use different representations
— Tools are harder to build
— Communication not possible
© Marcus Denker
Solution: Reflective Methods
> Annotated, persistent AST
> Bytecode generated on demand and cached
:ReflectiveMethod
annotation
#(12 13 45 38 98 128
84 72 42 77 22 28 59
32 7 49 51 87 64)
:CompiledMethod
compiledMethod
reflectiveMethodannotation
Tools VM
© Marcus Denker
Reflectivity
> Implementation of Reflective Methods for Squeak
Smalltalk
> Smalltalk Compiler generates Reflective Methods
— Translated to Bytecode on demand
> Open Compiler: Plugins
— Generator plugin: called before code generation
– Transform a copy of the AST
— Analysis plugin: called after name analysis
© Marcus Denker
DEMO I
> Show invalidation of code
> Show assert Demo
© Marcus Denker
Reflective Methods: Annotations
> Source visible annotations
— extended Smalltalk syntax
> Source invisible annotations
— Reflective API
— Can reference any object
> Every node can be annotated
> Semantics: Compiler Plugins
(9 raisedTo: 10000) <:evaluateAtCompiletime:>
© Marcus Denker
Example: Pluggable Type-System
> Example for textual annotations
bitFromBoolean: aBoolean <:type: Boolean :>
^ (aBoolean ifTrue: [1] ifFalse: [0]) <:type: Integer :>
> Optional, pluggable type-system
> Types stored as annotations in the Reflective Methods
© Marcus Denker
Reflex: Partial Behavioral Reflection
> Hooksets: collection of operation occurrences
> Links
— Bind hooksets to metaobjects
— Define Protocol between base and meta
> Goals
— Highly selective reification
— Flexiblel metalevel engineering
– Protocol specification
– Cross-cutting hooksets
activation
condition
hookset
metaobject
links
Tanter, OOPSLA03
© Marcus Denker
Links as Annotations
Meta
Link
> Links can be annotations on the AST
© Marcus Denker
Demo II: Geppetto
> Show Bounce Demo

Más contenido relacionado

La actualidad más candente (6)

Ipc ppt
Ipc pptIpc ppt
Ipc ppt
 
Architectural patterns part 3
Architectural patterns part 3Architectural patterns part 3
Architectural patterns part 3
 
Interprocess communication
Interprocess communicationInterprocess communication
Interprocess communication
 
Interprocess communication (IPC) IN O.S
Interprocess communication (IPC) IN O.SInterprocess communication (IPC) IN O.S
Interprocess communication (IPC) IN O.S
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
ITFT_Inter process communication
ITFT_Inter process communicationITFT_Inter process communication
ITFT_Inter process communication
 

Destacado (7)

TH4.T03.3ExtractionofReflectivityfromMicrowaveBlackbodyTargetwithFreeSpaceMea...
TH4.T03.3ExtractionofReflectivityfromMicrowaveBlackbodyTargetwithFreeSpaceMea...TH4.T03.3ExtractionofReflectivityfromMicrowaveBlackbodyTargetwithFreeSpaceMea...
TH4.T03.3ExtractionofReflectivityfromMicrowaveBlackbodyTargetwithFreeSpaceMea...
 
Impulsivity, Attention Deficits, and Addiction - Perspectives on Diagnoses an...
Impulsivity, Attention Deficits, and Addiction - Perspectives on Diagnoses an...Impulsivity, Attention Deficits, and Addiction - Perspectives on Diagnoses an...
Impulsivity, Attention Deficits, and Addiction - Perspectives on Diagnoses an...
 
Gmcase
GmcaseGmcase
Gmcase
 
Fotografias Tomadas En El Tiempo Exacto
Fotografias Tomadas En El Tiempo ExactoFotografias Tomadas En El Tiempo Exacto
Fotografias Tomadas En El Tiempo Exacto
 
Reflection
ReflectionReflection
Reflection
 
Dissertation Final
Dissertation FinalDissertation Final
Dissertation Final
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 

Similar a Demo: Reflectivity

Similar a Demo: Reflectivity (20)

Lecture: Reflection
Lecture: ReflectionLecture: Reflection
Lecture: Reflection
 
Lecture: Reflection
Lecture: ReflectionLecture: Reflection
Lecture: Reflection
 
Sub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral ReflectionSub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral Reflection
 
Talk: Practical, Pluggable Types
Talk: Practical, Pluggable TypesTalk: Practical, Pluggable Types
Talk: Practical, Pluggable Types
 
Reflection and Context
Reflection and ContextReflection and Context
Reflection and Context
 
Presentation about my Research
Presentation about my ResearchPresentation about my Research
Presentation about my Research
 
Refactoring
RefactoringRefactoring
Refactoring
 
Sub-Method Reflection
Sub-Method ReflectionSub-Method Reflection
Sub-Method Reflection
 
Practical, Pluggable Types
Practical, Pluggable TypesPractical, Pluggable Types
Practical, Pluggable Types
 
TypePlug -- Practical, Pluggable Types
TypePlug -- Practical, Pluggable TypesTypePlug -- Practical, Pluggable Types
TypePlug -- Practical, Pluggable Types
 
Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral Reflection
 
Unstuck
UnstuckUnstuck
Unstuck
 
Software Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience ReportSoftware Evolution from the Field: an Experience Report
Software Evolution from the Field: an Experience Report
 
08 refactoring
08 refactoring08 refactoring
08 refactoring
 
DDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVCDDD, CQRS and testing with ASP.Net MVC
DDD, CQRS and testing with ASP.Net MVC
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"
 
Stoop 305-reflective programming5
Stoop 305-reflective programming5Stoop 305-reflective programming5
Stoop 305-reflective programming5
 
Developing multi-platform microservices using .NET core
 Developing multi-platform microservices using .NET core Developing multi-platform microservices using .NET core
Developing multi-platform microservices using .NET core
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinks
 
Behavioral Reflection
Behavioral ReflectionBehavioral Reflection
Behavioral Reflection
 

Más de Marcus Denker

Más de Marcus Denker (20)

Soil And Pharo
Soil And PharoSoil And Pharo
Soil And Pharo
 
ConstantBlocks in Pharo11
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11
 
Demo: Improved DoIt
Demo: Improved DoItDemo: Improved DoIt
Demo: Improved DoIt
 
First Class Variables as AST Annotations
First Class Variables as AST AnnotationsFirst Class Variables as AST Annotations
First Class Variables as AST Annotations
 
Supporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportSupporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo Support
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Variables in Pharo
Variables in PharoVariables in Pharo
Variables in Pharo
 
Improving code completion for Pharo
Improving code completion for PharoImproving code completion for Pharo
Improving code completion for Pharo
 
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinksVUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
VUB Brussels Lecture 2019: Advanced Reflection: MetaLinks
 
Slot Composition
Slot CompositionSlot Composition
Slot Composition
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinks
 
PHARO IOT
PHARO IOTPHARO IOT
PHARO IOT
 
Open-Source: An Infinite Game
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite Game
 
Lecture: MetaLinks
Lecture: MetaLinksLecture: MetaLinks
Lecture: MetaLinks
 
PharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to Pharo
 
Feedback Loops in Practice
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in Practice
 
Pharo6 - ESUG17
Pharo6 - ESUG17Pharo6 - ESUG17
Pharo6 - ESUG17
 
Pharo6
Pharo6Pharo6
Pharo6
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Perfection & Feedback Loops or: why worse is better
Perfection & Feedback Loops or: why worse is betterPerfection & Feedback Loops or: why worse is better
Perfection & Feedback Loops or: why worse is better
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

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
 
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...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 

Demo: Reflectivity

  • 1. © Marcus Denker The Reflectivity Marcus Denker with: Philippe Marschall David Röthlisberger Nik Haldiman / Stefan Reichhart Adrian Lienhard / Lukas Renggli Eric Tanter Stephane Ducasse Oscar Nierstrasz
  • 2. © Marcus Denker Structural Reflection > Structure modeled as objects — Classes, methods are objects — Causally connected > Uses: — Development environments — Language extensions and experiments
  • 3. © Marcus Denker Methods and Reflection > Method are Objects > No high-level model for sub-method elements — Message sends — Assignments — Variable access > Structural reflection stops at the granularity of methods
  • 4. © Marcus Denker Sub-Method Reflection > Many tools work on sub method level — Profiler, Refactoring Tool, Debugger, Type Checker > Communication between tools needed — example: Code coverage > All tools use different representations — Tools are harder to build — Communication not possible
  • 5. © Marcus Denker Solution: Reflective Methods > Annotated, persistent AST > Bytecode generated on demand and cached :ReflectiveMethod annotation #(12 13 45 38 98 128 84 72 42 77 22 28 59 32 7 49 51 87 64) :CompiledMethod compiledMethod reflectiveMethodannotation Tools VM
  • 6. © Marcus Denker Reflectivity > Implementation of Reflective Methods for Squeak Smalltalk > Smalltalk Compiler generates Reflective Methods — Translated to Bytecode on demand > Open Compiler: Plugins — Generator plugin: called before code generation – Transform a copy of the AST — Analysis plugin: called after name analysis
  • 7. © Marcus Denker DEMO I > Show invalidation of code > Show assert Demo
  • 8. © Marcus Denker Reflective Methods: Annotations > Source visible annotations — extended Smalltalk syntax > Source invisible annotations — Reflective API — Can reference any object > Every node can be annotated > Semantics: Compiler Plugins (9 raisedTo: 10000) <:evaluateAtCompiletime:>
  • 9. © Marcus Denker Example: Pluggable Type-System > Example for textual annotations bitFromBoolean: aBoolean <:type: Boolean :> ^ (aBoolean ifTrue: [1] ifFalse: [0]) <:type: Integer :> > Optional, pluggable type-system > Types stored as annotations in the Reflective Methods
  • 10. © Marcus Denker Reflex: Partial Behavioral Reflection > Hooksets: collection of operation occurrences > Links — Bind hooksets to metaobjects — Define Protocol between base and meta > Goals — Highly selective reification — Flexiblel metalevel engineering – Protocol specification – Cross-cutting hooksets activation condition hookset metaobject links Tanter, OOPSLA03
  • 11. © Marcus Denker Links as Annotations Meta Link > Links can be annotations on the AST
  • 12. © Marcus Denker Demo II: Geppetto > Show Bounce Demo