SlideShare a Scribd company logo
1 of 22
Download to read offline
Sub-Method Reflection

              Marcus Denker
              Stéphane Ducasse
              Adrian Lienhard
              Philippe Marschall




© Marcus Denker
Roadmap




>    Structural Reflection and Sub-Method Reflection
>    Persephone: Sub-Method Reflection for Smalltalk
>    Example I: Instrumentation Framework
>    Example II: Pluggable Type-System
>    Benchmarks + Memory
>    Future Work




© Marcus Denker
Structural Reflection



>    Structure modeled as objects

     — e.g. Classes, methods
     — Causally connected

>    Uses:
     — Development environments
     — Language extensions and experiments




© Marcus Denker
Methods and Reflection



>    Method are Objects
     — e.g in Smalltalk


>    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
Existing Method Representations




>    Existing representations for Methods

     — Text

     — Bytecode

     — AST




© Marcus Denker
Requirements


>    Causal Connection

>    Abstraction Level

>    Extensibility

>    Persistency

>    Size and Performance


© Marcus Denker
Text




>    Low level abstraction
     — String of Characters


>    Not causally connected
     — Need to call compiler




© Marcus Denker
Bytecode



>    Low level abstraction
     — Array of Integers


>    Missing extensibility
     — e.g. for tools

>    Mix of base- and meta-level code
     — Problems with synthesized code when changing code
     — Examples: AOP point-cut residues, reflection hooks



© Marcus Denker
Abstract Syntax Tree



>    Not causally connected
     — Need to call compiler


>    Not extensible
     — Fixed set of codes, no way to store meta data

>    Not persistent
     — Generated by compiler from text, never stored




© Marcus Denker
Solution: Reflective Methods


> Annotated, persistent AST
> Bytecode generated on demand and cached


    :ReflectiveMethod                                           :CompiledMethod
                     annotation               compiledMethod

                                                               #(12 13 45 38 98 128
                     annotation
                                  reflectiveMethod              84 72 42 77 22 28 59
                                                                 32 7 49 51 87 64)




             Tools                                                     VM



© Marcus Denker
Persephone



>    Implementation of Reflective Methods for Squeak
     Smalltalk

>    Smalltalk Compiler generates Reflective Methods
     — Translated to Bytecode on demand

>    Open Compiler: Plugins
     — Called before code generation
     — Transform a copy of the AST



© Marcus Denker
Requirements revisited


>    Abstraction Level OK

>    Causal Connection OK

>    Extensibility OK

>    Persistency OK

>    Size and Performance OK


© Marcus Denker
Reflective Methods: Annotations


>    Source visible annotations
     — extended Smalltalk syntax

                  (9 raisedTo: 10000) <:evaluateAtCompiletime:>

>    Source invisible annotations
     — Reflective API
     — Can reference any object

> Every node can be annotated
> Semantics: Compiler Plugins


© Marcus Denker
Example I: Instrumentation


>    Goal: Code Instrumentation
     — Similar to Javassist, but at runtime
     — Insert code before/after, replace
     — Access to runtime data (e.g. receiver of send)



    a := 1 max: 3                       a := 1 max: 3.
                                        AssignmentCounter inc.


     Original Code                      Instrumented Code




© Marcus Denker
Instrumentation using Annotations


                                                       >   On demand
                                                           code generation
                                          Annotation       — Faster!
AST
                                             after
                                                       >   Better code
                                                           — No preamble
                                                             code to access
original                                                     data on stack
                  #[10 125 55 00 80 90]
bytecode
                                                       >   Annotations are
instrumented      #[10 125 55 33 55 00 80 90 33]
                                                           metadata
bytecode                                                   — Original code
                                                             untouched


© Marcus Denker
Example II: 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
Performance


 Squeak tinyBenchmarks


              Caching scheme             Runtime

     unmodified Squeak          6.9 seconds

     Persephone, no cache      >1 hour

     Persephone, cache         6.9 seconds



© Marcus Denker
Memory




                            number of classes memory


     Squeak 3.9             2040             15.7 MB


     Persephone             2224             20 MB
     no reflective methods

     Persephone             2224             123 MB
     reflective methods


© Marcus Denker
Future Work


>    Optimize Size of AST Representation
     — Simpler AST
     — AST Compression

>    Behavioral Reflection
     — Implement Reflex model of partial behavioral reflection

>    Beyond Text
     — Store only AST (no text)
     — Build text from annotated AST


© Marcus Denker
Conclusion




> Motivated the need for Reflective Methods
> Implementation: Persephone
> Examples
     — Instrumentation framework
     — Pluggable type-system
>    Benchmarks / Memory




© Marcus Denker
Conclusion




> Motivated the need for Reflective Methods
> Implementation: Persephone
> Examples
     — Instrumentation framework
     — Pluggable type-system
>    Benchmarks / Memory

                                   Questions?
© Marcus Denker

More Related Content

Viewers also liked

Pharo Status (from PharoDays 2015)
Pharo Status (from PharoDays 2015)Pharo Status (from PharoDays 2015)
Pharo Status (from PharoDays 2015)Marcus Denker
 
Limpieza Del Terreno
Limpieza Del TerrenoLimpieza Del Terreno
Limpieza Del Terrenodaburgio
 
Laura Seeger Portfolio
Laura Seeger PortfolioLaura Seeger Portfolio
Laura Seeger PortfolioLaura Seeger
 
Talk: An Instrument whose Music is Ideas
Talk: An Instrument whose Music is IdeasTalk: An Instrument whose Music is Ideas
Talk: An Instrument whose Music is IdeasMarcus Denker
 
Pharo: Syntax in a Nutshell
Pharo: Syntax in a NutshellPharo: Syntax in a Nutshell
Pharo: Syntax in a NutshellMarcus Denker
 
Racc でおてがる構文解析
Racc でおてがる構文解析Racc でおてがる構文解析
Racc でおてがる構文解析morphine57
 
Pharo: A Dynamic Environment for Business and Research
Pharo: A Dynamic Environment for Business and ResearchPharo: A Dynamic Environment for Business and Research
Pharo: A Dynamic Environment for Business and ResearchMarcus Denker
 
Seismic Refraction Surveying
Seismic Refraction SurveyingSeismic Refraction Surveying
Seismic Refraction SurveyingAli Osman Öncel
 
Towards a flexible Pharo Compiler
Towards a flexible Pharo CompilerTowards a flexible Pharo Compiler
Towards a flexible Pharo CompilerMarcus Denker
 
Practical, Pluggable Types
Practical, Pluggable TypesPractical, Pluggable Types
Practical, Pluggable TypesMarcus Denker
 

Viewers also liked (16)

Pharo Status (from PharoDays 2015)
Pharo Status (from PharoDays 2015)Pharo Status (from PharoDays 2015)
Pharo Status (from PharoDays 2015)
 
Limpieza Del Terreno
Limpieza Del TerrenoLimpieza Del Terreno
Limpieza Del Terreno
 
Laura Seeger Portfolio
Laura Seeger PortfolioLaura Seeger Portfolio
Laura Seeger Portfolio
 
Talk: An Instrument whose Music is Ideas
Talk: An Instrument whose Music is IdeasTalk: An Instrument whose Music is Ideas
Talk: An Instrument whose Music is Ideas
 
Pharo3 at Fosdem
Pharo3 at FosdemPharo3 at Fosdem
Pharo3 at Fosdem
 
Pharo: Syntax in a Nutshell
Pharo: Syntax in a NutshellPharo: Syntax in a Nutshell
Pharo: Syntax in a Nutshell
 
Racc でおてがる構文解析
Racc でおてがる構文解析Racc でおてがる構文解析
Racc でおてがる構文解析
 
Pharo: A Dynamic Environment for Business and Research
Pharo: A Dynamic Environment for Business and ResearchPharo: A Dynamic Environment for Business and Research
Pharo: A Dynamic Environment for Business and Research
 
Seismic Refraction Surveying
Seismic Refraction SurveyingSeismic Refraction Surveying
Seismic Refraction Surveying
 
Lecture: Seaside
Lecture: SeasideLecture: Seaside
Lecture: Seaside
 
Towards a flexible Pharo Compiler
Towards a flexible Pharo CompilerTowards a flexible Pharo Compiler
Towards a flexible Pharo Compiler
 
Refactoring
RefactoringRefactoring
Refactoring
 
Practical, Pluggable Types
Practical, Pluggable TypesPractical, Pluggable Types
Practical, Pluggable Types
 
Refraction intro
Refraction introRefraction intro
Refraction intro
 
Unstuck
UnstuckUnstuck
Unstuck
 
1 reflection and refraction
1 reflection and refraction1 reflection and refraction
1 reflection and refraction
 

Similar to Sub-Method Reflection

Beyond Text - Methods as Objects
Beyond Text - Methods as ObjectsBeyond Text - Methods as Objects
Beyond Text - Methods as ObjectsMarcus Denker
 
Presentation about my Research
Presentation about my ResearchPresentation about my Research
Presentation about my ResearchMarcus Denker
 
Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionESUG
 
Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionMarcus Denker
 
The Reflectivity
The ReflectivityThe Reflectivity
The ReflectivityESUG
 
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 ReportMarcus Denker
 
Sub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral ReflectionSub-method Structural and Behavioral Reflection
Sub-method Structural and Behavioral ReflectionMarcus Denker
 
Talk: Practical, Pluggable Types
Talk: Practical, Pluggable TypesTalk: Practical, Pluggable Types
Talk: Practical, Pluggable TypesMarcus Denker
 
VMs, Interpreters, JIT
VMs, Interpreters, JITVMs, Interpreters, JIT
VMs, Interpreters, JITMarcus Denker
 
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in Containernet[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in ContainernetAndrew Wang
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...Amazon Web Services
 
Windows Malware Techniques
Windows Malware TechniquesWindows Malware Techniques
Windows Malware TechniquesLee C
 
Deep Dive on Amazon EC2 instances
Deep Dive on Amazon EC2 instancesDeep Dive on Amazon EC2 instances
Deep Dive on Amazon EC2 instancesAmazon Web Services
 

Similar to Sub-Method Reflection (20)

Reflection
ReflectionReflection
Reflection
 
Reflectivity Demo
Reflectivity DemoReflectivity Demo
Reflectivity Demo
 
Lecture: Reflection
Lecture: ReflectionLecture: Reflection
Lecture: Reflection
 
Beyond Text - Methods as Objects
Beyond Text - Methods as ObjectsBeyond Text - Methods as Objects
Beyond Text - Methods as Objects
 
Presentation about my Research
Presentation about my ResearchPresentation about my Research
Presentation about my Research
 
Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral Reflection
 
Unanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral ReflectionUnanticipated Partial Behavioral Reflection
Unanticipated Partial Behavioral Reflection
 
Demo: Reflectivity
Demo: ReflectivityDemo: Reflectivity
Demo: Reflectivity
 
The Reflectivity
The ReflectivityThe Reflectivity
The Reflectivity
 
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
 
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
 
VMs, Interpreters, JIT
VMs, Interpreters, JITVMs, Interpreters, JIT
VMs, Interpreters, JIT
 
Tos tutorial
Tos tutorialTos tutorial
Tos tutorial
 
Typesafe spark- Zalando meetup
Typesafe spark- Zalando meetupTypesafe spark- Zalando meetup
Typesafe spark- Zalando meetup
 
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in Containernet[Draft] Fast Prototyping with DPDK and eBPF in Containernet
[Draft] Fast Prototyping with DPDK and eBPF in Containernet
 
Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached Presentation
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
 
Windows Malware Techniques
Windows Malware TechniquesWindows Malware Techniques
Windows Malware Techniques
 
Deep Dive on Amazon EC2 instances
Deep Dive on Amazon EC2 instancesDeep Dive on Amazon EC2 instances
Deep Dive on Amazon EC2 instances
 

More from Marcus Denker

ConstantBlocks in Pharo11
ConstantBlocks in Pharo11ConstantBlocks in Pharo11
ConstantBlocks in Pharo11Marcus Denker
 
First Class Variables as AST Annotations
First Class Variables as AST AnnotationsFirst Class Variables as AST Annotations
First Class Variables as AST AnnotationsMarcus Denker
 
Supporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportSupporting Pharo / Getting Pharo Support
Supporting Pharo / Getting Pharo SupportMarcus Denker
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Marcus Denker
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerMarcus Denker
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksMarcus Denker
 
Improving code completion for Pharo
Improving code completion for PharoImproving code completion for Pharo
Improving code completion for PharoMarcus Denker
 
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: MetaLinksMarcus Denker
 
Lecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksLecture: Advanced Reflection. MetaLinks
Lecture: Advanced Reflection. MetaLinksMarcus Denker
 
Open-Source: An Infinite Game
Open-Source: An Infinite GameOpen-Source: An Infinite Game
Open-Source: An Infinite GameMarcus Denker
 
PharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoPharoTechTalk: Contributing to Pharo
PharoTechTalk: Contributing to PharoMarcus Denker
 
Feedback Loops in Practice
Feedback Loops in PracticeFeedback Loops in Practice
Feedback Loops in PracticeMarcus Denker
 

More from 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
 
Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"Lecture: "Advanced Reflection: MetaLinks"
Lecture: "Advanced Reflection: MetaLinks"
 
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
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinks
 
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
 

Recently uploaded

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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
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
 
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 Processorsdebabhi2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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
 
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 2024The Digital Insurer
 
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 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
🐬 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
 

Recently uploaded (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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
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
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Sub-Method Reflection

  • 1. Sub-Method Reflection Marcus Denker Stéphane Ducasse Adrian Lienhard Philippe Marschall © Marcus Denker
  • 2. Roadmap > Structural Reflection and Sub-Method Reflection > Persephone: Sub-Method Reflection for Smalltalk > Example I: Instrumentation Framework > Example II: Pluggable Type-System > Benchmarks + Memory > Future Work © Marcus Denker
  • 3. Structural Reflection > Structure modeled as objects — e.g. Classes, methods — Causally connected > Uses: — Development environments — Language extensions and experiments © Marcus Denker
  • 4. Methods and Reflection > Method are Objects — e.g in Smalltalk > No high-level model for sub-method elements — Message sends — Assignments — Variable access > Structural reflection stops at the granularity of methods © Marcus Denker
  • 5. 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
  • 6. Existing Method Representations > Existing representations for Methods — Text — Bytecode — AST © Marcus Denker
  • 7. Requirements > Causal Connection > Abstraction Level > Extensibility > Persistency > Size and Performance © Marcus Denker
  • 8. Text > Low level abstraction — String of Characters > Not causally connected — Need to call compiler © Marcus Denker
  • 9. Bytecode > Low level abstraction — Array of Integers > Missing extensibility — e.g. for tools > Mix of base- and meta-level code — Problems with synthesized code when changing code — Examples: AOP point-cut residues, reflection hooks © Marcus Denker
  • 10. Abstract Syntax Tree > Not causally connected — Need to call compiler > Not extensible — Fixed set of codes, no way to store meta data > Not persistent — Generated by compiler from text, never stored © Marcus Denker
  • 11. Solution: Reflective Methods > Annotated, persistent AST > Bytecode generated on demand and cached :ReflectiveMethod :CompiledMethod annotation compiledMethod #(12 13 45 38 98 128 annotation reflectiveMethod 84 72 42 77 22 28 59 32 7 49 51 87 64) Tools VM © Marcus Denker
  • 12. Persephone > Implementation of Reflective Methods for Squeak Smalltalk > Smalltalk Compiler generates Reflective Methods — Translated to Bytecode on demand > Open Compiler: Plugins — Called before code generation — Transform a copy of the AST © Marcus Denker
  • 13. Requirements revisited > Abstraction Level OK > Causal Connection OK > Extensibility OK > Persistency OK > Size and Performance OK © Marcus Denker
  • 14. Reflective Methods: Annotations > Source visible annotations — extended Smalltalk syntax (9 raisedTo: 10000) <:evaluateAtCompiletime:> > Source invisible annotations — Reflective API — Can reference any object > Every node can be annotated > Semantics: Compiler Plugins © Marcus Denker
  • 15. Example I: Instrumentation > Goal: Code Instrumentation — Similar to Javassist, but at runtime — Insert code before/after, replace — Access to runtime data (e.g. receiver of send) a := 1 max: 3 a := 1 max: 3. AssignmentCounter inc. Original Code Instrumented Code © Marcus Denker
  • 16. Instrumentation using Annotations > On demand code generation Annotation — Faster! AST after > Better code — No preamble code to access original data on stack #[10 125 55 00 80 90] bytecode > Annotations are instrumented #[10 125 55 33 55 00 80 90 33] metadata bytecode — Original code untouched © Marcus Denker
  • 17. Example II: 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
  • 18. Performance Squeak tinyBenchmarks Caching scheme Runtime unmodified Squeak 6.9 seconds Persephone, no cache >1 hour Persephone, cache 6.9 seconds © Marcus Denker
  • 19. Memory number of classes memory Squeak 3.9 2040 15.7 MB Persephone 2224 20 MB no reflective methods Persephone 2224 123 MB reflective methods © Marcus Denker
  • 20. Future Work > Optimize Size of AST Representation — Simpler AST — AST Compression > Behavioral Reflection — Implement Reflex model of partial behavioral reflection > Beyond Text — Store only AST (no text) — Build text from annotated AST © Marcus Denker
  • 21. Conclusion > Motivated the need for Reflective Methods > Implementation: Persephone > Examples — Instrumentation framework — Pluggable type-system > Benchmarks / Memory © Marcus Denker
  • 22. Conclusion > Motivated the need for Reflective Methods > Implementation: Persephone > Examples — Instrumentation framework — Pluggable type-system > Benchmarks / Memory Questions? © Marcus Denker