denker - pharo: present and future - 2009-07-14
DESCRIPTION
This set of slides was used by Marcus Denker for his CHOOSE SIGBeer given on July 14, 2009 in Bern: http://choose.s-i.ch/events/2009-07-14-denkerTRANSCRIPT
![Page 1: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/1.jpg)
Past and Future
![Page 2: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/2.jpg)
What?
A progressive, open-source Smalltalk platform for professional use.
![Page 3: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/3.jpg)
What?
A flexible environment to support the research of new language concepts.
![Page 4: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/4.jpg)
What?
Pharo = Language + IDE
Pure Object-Oriented Language
Dynamically Typed
![Page 5: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/5.jpg)
HistoryBased on Squeak Smalltalk
+ Major Cleanups (MVC, eToys)+ New UI Look / TrueType+ Tools+ Block Closures+ Lots of bugfixes and small improvements
![Page 6: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/6.jpg)
699 Bug-reports closed
377 Updates
Release Planned: August 2009
![Page 7: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/7.jpg)
![Page 8: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/8.jpg)
![Page 9: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/9.jpg)
Getting Started
(if needed)
![Page 10: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/10.jpg)
Pier
![Page 11: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/11.jpg)
Pier
![Page 12: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/12.jpg)
Smalltalk with OO-Database
Pharo is the IDE
![Page 13: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/13.jpg)
Future
![Page 14: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/14.jpg)
...cleaner
![Page 15: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/15.jpg)
...smaller
![Page 16: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/16.jpg)
...faster
![Page 17: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/17.jpg)
(of course)
![Page 18: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/18.jpg)
Enable Evolution
![Page 19: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/19.jpg)
Enable Experiments
![Page 20: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/20.jpg)
Examples
- Compiler
- Slots
- JIT and AOStA
![Page 21: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/21.jpg)
Old Compiler
- From 1976- Not OO- Hard to understand. Hard to change
We need a better Compiler!
![Page 22: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/22.jpg)
New Compiler- Originally by Anthony Hannan
- Based on Visitors- Reusable and Pluggable Backend (IRBuilder)- Uses RB AST- SmaCC Parser
Easier to understand. Easier to change
![Page 23: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/23.jpg)
New Compiler
code AST ASTScanner/ Parser
SemanticAnalysis BytecodeCode
Generation
AST IRBuildIR BytecodeBytecode
Generation
ASTTranslatorIRBuilder
IRTranslatorBytecodeBuilder
Code generation in detail
![Page 24: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/24.jpg)
Plans...- New BlockClosure Format
- Plugin architecture: Parser, Checker, CodeGen
- Use RB Parser (Faster, Error messages)
![Page 25: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/25.jpg)
Examples
- Compiler
- Slots
- JIT and AOStA
![Page 26: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/26.jpg)
Instance Vars
- Not objects - Change behavior?- Change memory layout?
Instance state should be more powerful!
![Page 27: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/27.jpg)
Slots
- Are objects- Allow custom subclasses- Change behavior and memory layout
Without Performance penalty!
![Page 28: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/28.jpg)
MopObject subclass: #SlotExample slots: '{AutoAccessorSlot named: #hello}' classVariableNames: '' poolDictionaries: '' category: 'SlotExamples'
Auto-Accessor
Create accessor-methods at compile-time
![Page 29: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/29.jpg)
MopObject subclass: #SlotExample slots: '{ActiveSlot named: #hello
action: [Beeper beep]}' classVariableNames: '' poolDictionaries: '' category: 'SlotExamples'
Active Slot
Evaluate block on read
![Page 30: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/30.jpg)
MopObject subclass: #SlotExample slots: '{SparseSlot named: #a.
SparseSlot named: #b.SparseSlot named: #c}'
classVariableNames: '' poolDictionaries: '' category: 'SlotExamples'
Sparse Slot
Store values in one Dictionary
![Page 31: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/31.jpg)
MopObject subclass: #SlotExample slots: '{IVarSlot named: #a} classVariableNames: '' poolDictionaries: '' category: 'SlotExamples'
iVar Slot
Normal instance Variable
![Page 32: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/32.jpg)
MopObject subclass: #SlotExample slots: '{AutoAccessorSlot named: #hello}' classVariableNames: '' poolDictionaries: '' category: 'SlotExamples'
Auto-Accessor
Create accessor-methods at compiled-time
![Page 33: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/33.jpg)
Slot subclass: #AutoAccessorSlot instanceVariableNames: '' ....
postCreationAction self generateGetter. self generateSetter.
generateGetter class compile: (String streamContents: [:stream |stream nextPutAll: self name; crtab; nextPutAll: '^', self name asString])
![Page 34: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/34.jpg)
MopObject subclass: #SlotExample slots: '{ActiveSlot named: #hello
action: [Beeper beep]}' classVariableNames: '' poolDictionaries: '' category: 'SlotExamples'
Active Slot
Evaluate block on read
![Page 35: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/35.jpg)
AutoAccessorSlot subclass: #ActiveSlot instanceVariableNames: 'action' ....
emitReadUsing: methodBuilder methodBuilder pushLiteral: action; send: #value. super emitReadUsing: methodBuilder
Active Slot
![Page 36: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/36.jpg)
Status
- First Prototype
- Integration with ClassBuilder - Compatibility with iVars- Explore different designs
![Page 37: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/37.jpg)
Examples
- Compiler
- Slots
- JIT and AOStA
![Page 38: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/38.jpg)
VM
- Virtual Machine uses Interpreter
- JIT Compiler under development (Eliot Miranda)
How to optimize even more?
![Page 39: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/39.jpg)
AOStA- Provide API for accessing runtime data
- PIC: Polymorphic Inline Cache
Record class per send instruction
- Hotness Counter
Where do we spend time?
![Page 40: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/40.jpg)
AOStA
BC 2SSA
SSA 2BC
OPT
Optimize SSA-Form(Static Single Assignment)
PIC
BC BCSSA SSA
![Page 41: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/41.jpg)
AOStA
- Use PIC-Data for specialization
- Inline often-called methods
- Special Bytecode for primitive types (Floats)
![Page 42: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/42.jpg)
AOStA
- Bytecode-to-Bytecode optimization
- Purely realized in Smaltalk
- Accessible in the image. Reflection?
![Page 43: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/43.jpg)
More...- Improve Tools
- Real Modules
- Reflection
- .......
![Page 44: Denker - Pharo: Present and Future - 2009-07-14](https://reader033.vdocuments.net/reader033/viewer/2022052900/555a4b88d8b42ad56a8b47d5/html5/thumbnails/44.jpg)
Join Us!
Goal: learning and having fun
http://pharo-project.org