SlideShare a Scribd company logo
pypy-logo
PyPy - How to not write Virtual Machines for
Dynamic Languages
Armin Rigo
Institut für Informatik
Heinrich-Heine-Universität Düsseldorf
ESUG 2007
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Scope
This talk is about:
implementing dynamic languages
(with a focus on complicated ones)
in a context of limited resources
(academic, open source, or domain-specific)
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Scope
This talk is about:
implementing dynamic languages
(with a focus on complicated ones)
in a context of limited resources
(academic, open source, or domain-specific)
Complicated = requiring a large VM
Smalltalk (etc...): typically small core VM
Python (etc...): the VM contains quite a lot
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Scope
This talk is about:
implementing dynamic languages
(with a focus on complicated ones)
in a context of limited resources
(academic, open source, or domain-specific)
Complicated = requiring a large VM
Smalltalk (etc...): typically small core VM
Python (etc...): the VM contains quite a lot
Limited resources
Only near-complete implementations are really useful
Minimize implementer’s duplication of efforts
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Our point
Our point:
Do not write virtual machines “by hand”
Instead, write interpreters in high-level languages
Meta-programming is your friend
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Common Approaches to VM construction
Using C directly (or C disguised as another language)
CPython
Ruby
Spidermonkey (Mozilla’s JavaScript VM)
but also: Squeak, Scheme48
Building on top of a general-purpose OO VM
Jython, IronPython
JRuby, IronRuby
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Implementing VMs in C
When writing a VM in C it is hard to reconcile:
flexibility, maintainability
simplicity of the VM
performance (needs dynamic compilation techniques)
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Implementing VMs in C
When writing a VM in C it is hard to reconcile:
flexibility, maintainability
simplicity of the VM
performance (needs dynamic compilation techniques)
Python Case
CPython is a very simple bytecode VM, performance not
great
Psyco is a just-in-time-specializer, very complex, hard to
maintain, but good performance
Stackless is a fork of CPython adding microthreads. It was
never incorporated into CPython for complexity reasons
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Compilers are a bad encoding of Semantics
to reach good performance levels, dynamic compilation is
often needed
a dynamic compiler needs to encode language semantics
this encoding is often obscure and hard to change
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Compilers are a bad encoding of Semantics
to reach good performance levels, dynamic compilation is
often needed
a dynamic compiler needs to encode language semantics
this encoding is often obscure and hard to change
Python Case
Psyco is a dynamic compiler for Python
synchronizing with CPython’s rapid development is a lot of
effort
many of CPython’s new features not supported well
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Fixing of Early Design Decisions
when starting a VM in C, many design decisions need to
be made upfront
examples: memory management technique, threading
model
the decision is manifested throughout the VM source
very hard to change later
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Fixing of Early Design Decisions
when starting a VM in C, many design decisions need to
be made upfront
examples: memory management technique, threading
model
the decision is manifested throughout the VM source
very hard to change later
Python Case
CPython uses reference counting, increfs and decrefs
everywhere
CPython uses OS threads with one global lock, hard to
change to lightweight threads or finer locking
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Implementation Proliferation
restrictions of the original implementation lead to
re-implementations, forks
all implementations need to be synchronized with
language evolution
lots of duplicate effort
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Implementation Proliferation
restrictions of the original implementation lead to
re-implementations, forks
all implementations need to be synchronized with
language evolution
lots of duplicate effort
Python Case
several serious implementations: CPython, Stackless,
Psyco, Jython, IronPython, PyPy
the implementations have various grades of compliance
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Implementing Languages on Top of General-Purpose
OO VMs
users wish to have easy interoperation with the
general-purpose OO VMs used by the industry (JVM, CLR)
therefore re-implementations of the language on the OO
VMs are started
even more implementation proliferation
implementing on top of an OO VM has its own set of
problems
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Implementing Languages on Top of General-Purpose
OO VMs
users wish to have easy interoperation with the
general-purpose OO VMs used by the industry (JVM, CLR)
therefore re-implementations of the language on the OO
VMs are started
even more implementation proliferation
implementing on top of an OO VM has its own set of
problems
Python Case
Jython is a Python-to-Java-bytecode compiler
IronPython is a Python-to-CLR-bytecode compiler
both are slightly incompatible with the newest CPython
version (especially Jython)
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Benefits of implementing on top of OO VMs
higher level of implementation
the VM supplies a GC and mostly a JIT
better interoperability than what the C level provides
some proponents believe that eventually one single VM
should be enough
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
The problems of OO VMs
some of the benefits of OO VMs don’t work out in practice
most immediate problem: it can be hard to map concepts
of the dynamic lang to the host OO VM
performance is often not improved, and can be very bad,
because of the semantic mismatch between the dynamic
language and the host VM
poor interoperability with everything outside the OO VM
in practice, one OO VM is not enough
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
The problems of OO VMs
some of the benefits of OO VMs don’t work out in practice
most immediate problem: it can be hard to map concepts
of the dynamic lang to the host OO VM
performance is often not improved, and can be very bad,
because of the semantic mismatch between the dynamic
language and the host VM
poor interoperability with everything outside the OO VM
in practice, one OO VM is not enough
Python Case
Jython about 5 times slower than CPython
IronPython is about as fast as CPython (but some
introspection features missing)
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
PyPy’s Approach to VM Construction
Goal: achieve flexibility, simplicity and performance together
Approach: auto-generate VMs from high-level descriptions
of the language
... using meta-programming techniques and aspects
high-level description: an interpreter written in a high-level
language
... which we translate (i.e. compile) to VMs running on top
of various targets, like C/Posix, CLR, JVM
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
PyPy
PyPy = Python interpreter written in RPython + translation
toolchain for RPython
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
PyPy
PyPy = Python interpreter written in RPython + translation
toolchain for RPython
What is RPython
RPython is a subset of Python
subset chosen in such a way that type-inference can be
performed
still a high-level language (unlike SLang or Prescheme)
...really a subset, can’t give a small example of code that
doesn’t just look like Python :-)
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Auto-generating VMs
high-level source: early design decisions not necessary
we need a custom translation toolchain to compile the
interpreter to a full VM
many aspects of the final VM are orthogonal to the
interpreter source: they are inserted during translation
translation aspect ∼= monads, with more ad-hoc control
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Auto-generating VMs
high-level source: early design decisions not necessary
we need a custom translation toolchain to compile the
interpreter to a full VM
many aspects of the final VM are orthogonal to the
interpreter source: they are inserted during translation
translation aspect ∼= monads, with more ad-hoc control
Examples
Garbage Collection strategy
Threading models (e.g. coroutines with CPS...)
non-trivial translation aspect: auto-generating a dynamic
compiler from the interpreter
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Good Points of the Approach
Simplicity:
dynamic languages can be implemented in a high level
language
separation of concerns from low-level details
a potential single-source-fits-all interpreter – less
duplication of efforts
runs everywhere with the same semantics – no outdated
implementations, no ties to any standard platform
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Good Points of the Approach
Simplicity:
dynamic languages can be implemented in a high level
language
separation of concerns from low-level details
a potential single-source-fits-all interpreter – less
duplication of efforts
runs everywhere with the same semantics – no outdated
implementations, no ties to any standard platform
PyPy
arguably the most readable Python implementation so far
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Good Points of the Approach
Flexibility at all levels:
when writing the interpreter (high-level languages rule!)
when adapting the translation toolchain as necessary
to break abstraction barriers when necessary
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Good Points of the Approach
Flexibility at all levels:
when writing the interpreter (high-level languages rule!)
when adapting the translation toolchain as necessary
to break abstraction barriers when necessary
Example
boxed integer objects, represented as tagged pointers
manual system-level RPython code
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Good Points of the Approach
Performance:
“reasonable” performance
can generate a dynamic compiler from the interpreter
(work in progress, 60x faster on very simple Python code)
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Good Points of the Approach
Performance:
“reasonable” performance
can generate a dynamic compiler from the interpreter
(work in progress, 60x faster on very simple Python code)
JIT compiler generator
almost orthogonal from the interpreter source - applicable
to many languages, follows language evolution “for free”
based on Partial Evaluation
benefits from a high-level interpreter and a tweakable
translation toolchain
generating a dynamic compiler is easier than generating a
static one!
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Open Issues / Drawbacks / Further Work
writing the translation toolchain in the first place takes lots
of effort (but it can be reused)
writing a good GC is still necessary. But: maybe we can
reuse existing good GCs (e.g. from the Jikes RVM)?
conceptually simple approach but many abstraction layers
dynamic compiler generation seems to work, but needs
more efforts. Also: can we layer it on top of the JIT of a
general purpose OO VM?
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
Conclusion / Meta-Points
high-level languages are suitable to implement dynamic
languages
doing so has many benefits
VMs shouldn’t be written by hand
PyPy’s concrete approach is not so important
diversity is good
let’s write more meta-programming toolchains!
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
pypy-logo
For more information
PyPy
http://codespeak.net/pypy/
“Sprints”
Main way we develop PyPy
They are programming camps, a few days to one week
long
We may have one in Bern soon (PyPy+Squeak) and/or in
Germany (JIT and other topics)
See also
Google for the full paper corresponding to these slides that was
submitted at Dyla’2007
Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
Ad

More Related Content

What's hot (20)

Os Worthington
Os WorthingtonOs Worthington
Os Worthington
oscon2007
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To Symbian
Mark Wilcox
 
FunScript: Why bother?
FunScript: Why bother?FunScript: Why bother?
FunScript: Why bother?
Alfonso Garcia-Caro
 
Jit builder status and directions 2018 03-28
Jit builder status and directions 2018 03-28Jit builder status and directions 2018 03-28
Jit builder status and directions 2018 03-28
Mark Stoodley
 
Automating boring and repetitive UbuCon Asia video and subtitle stuffs
Automating boring and repetitive UbuCon Asia video and subtitle stuffsAutomating boring and repetitive UbuCon Asia video and subtitle stuffs
Automating boring and repetitive UbuCon Asia video and subtitle stuffs
Youngbin Han
 
How to integrate python into a scala stack
How to integrate python into a scala stackHow to integrate python into a scala stack
How to integrate python into a scala stack
Fliptop
 
Mixing Python and Java
Mixing Python and JavaMixing Python and Java
Mixing Python and Java
Andreas Schreiber
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
eShikshak
 
Python overview
Python overviewPython overview
Python overview
Haroon Karim
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Emertxe Information Technologies Pvt Ltd
 
Python Flavors
Python FlavorsPython Flavors
Python Flavors
Geison Goes
 
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM
Tobias Lindaaker
 
Jython: Integrating Python and Java
Jython: Integrating Python and JavaJython: Integrating Python and Java
Jython: Integrating Python and Java
Charles Anderson
 
Raspberry using Python Session 3
Raspberry using Python Session 3Raspberry using Python Session 3
Raspberry using Python Session 3
Mohamed Abd Ela'al
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
Visuality
 
IL2CPP: Debugging and Profiling
IL2CPP: Debugging and ProfilingIL2CPP: Debugging and Profiling
IL2CPP: Debugging and Profiling
joncham
 
Community Tech Days C# 4.0
Community Tech Days C# 4.0Community Tech Days C# 4.0
Community Tech Days C# 4.0
SANKARSAN BOSE
 
Why Python?
Why Python?Why Python?
Why Python?
Adam Pah
 
PyPy 1.2: snakes never crawled so fast
PyPy 1.2: snakes never crawled so fastPyPy 1.2: snakes never crawled so fast
PyPy 1.2: snakes never crawled so fast
PyCon Italia
 
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Introduction to Python GUI development with Delphi for Python - Part 1:   Del...Introduction to Python GUI development with Delphi for Python - Part 1:   Del...
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Embarcadero Technologies
 
Os Worthington
Os WorthingtonOs Worthington
Os Worthington
oscon2007
 
Porting To Symbian
Porting To SymbianPorting To Symbian
Porting To Symbian
Mark Wilcox
 
Jit builder status and directions 2018 03-28
Jit builder status and directions 2018 03-28Jit builder status and directions 2018 03-28
Jit builder status and directions 2018 03-28
Mark Stoodley
 
Automating boring and repetitive UbuCon Asia video and subtitle stuffs
Automating boring and repetitive UbuCon Asia video and subtitle stuffsAutomating boring and repetitive UbuCon Asia video and subtitle stuffs
Automating boring and repetitive UbuCon Asia video and subtitle stuffs
Youngbin Han
 
How to integrate python into a scala stack
How to integrate python into a scala stackHow to integrate python into a scala stack
How to integrate python into a scala stack
Fliptop
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
eShikshak
 
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM
Tobias Lindaaker
 
Jython: Integrating Python and Java
Jython: Integrating Python and JavaJython: Integrating Python and Java
Jython: Integrating Python and Java
Charles Anderson
 
Raspberry using Python Session 3
Raspberry using Python Session 3Raspberry using Python Session 3
Raspberry using Python Session 3
Mohamed Abd Ela'al
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
Visuality
 
IL2CPP: Debugging and Profiling
IL2CPP: Debugging and ProfilingIL2CPP: Debugging and Profiling
IL2CPP: Debugging and Profiling
joncham
 
Community Tech Days C# 4.0
Community Tech Days C# 4.0Community Tech Days C# 4.0
Community Tech Days C# 4.0
SANKARSAN BOSE
 
Why Python?
Why Python?Why Python?
Why Python?
Adam Pah
 
PyPy 1.2: snakes never crawled so fast
PyPy 1.2: snakes never crawled so fastPyPy 1.2: snakes never crawled so fast
PyPy 1.2: snakes never crawled so fast
PyCon Italia
 
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Introduction to Python GUI development with Delphi for Python - Part 1:   Del...Introduction to Python GUI development with Delphi for Python - Part 1:   Del...
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Embarcadero Technologies
 

Similar to PyPy (20)

Onivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureOnivim: Modal Editing from the Future
Onivim: Modal Editing from the Future
Bryan Phelps
 
You don't need plugin, Long live plugins
You don't need plugin, Long live pluginsYou don't need plugin, Long live plugins
You don't need plugin, Long live plugins
Jae-yeol Lee
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
Learnbay Datascience
 
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Amanda Lam
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE
Pavan Kalyan
 
Working with NIM - By Jordan Hrycaj
Working with NIM - By Jordan HrycajWorking with NIM - By Jordan Hrycaj
Working with NIM - By Jordan Hrycaj
camsec
 
How to build your own programming language
How to build your own programming language  How to build your own programming language
How to build your own programming language
Kamal Mustafa
 
Ruby'izing iOS development
Ruby'izing iOS developmentRuby'izing iOS development
Ruby'izing iOS development
toamitkumar
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
Biswajeet Dasmajumdar
 
Возможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSВозможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OS
Cisco Russia
 
Single sourcing using Rich Ajax Platform
Single sourcing using Rich Ajax PlatformSingle sourcing using Rich Ajax Platform
Single sourcing using Rich Ajax Platform
Ankur Sharma
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)
Ivo Jansch
 
invokedynamic: Evolution of a Language Feature
invokedynamic: Evolution of a Language Featureinvokedynamic: Evolution of a Language Feature
invokedynamic: Evolution of a Language Feature
DanHeidinga
 
Building CLIs with Ruby
Building CLIs with RubyBuilding CLIs with Ruby
Building CLIs with Ruby
drizzlo
 
Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015
Boey Pak Cheong
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?
Charlie Gracie
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?
Charlie Gracie
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
Ahmed Abdou
 
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
adunne
 
Onivim: Modal Editing from the Future
Onivim: Modal Editing from the FutureOnivim: Modal Editing from the Future
Onivim: Modal Editing from the Future
Bryan Phelps
 
You don't need plugin, Long live plugins
You don't need plugin, Long live pluginsYou don't need plugin, Long live plugins
You don't need plugin, Long live plugins
Jae-yeol Lee
 
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Introduction to Application Development in Python and Gtk+ / Hildon @ Maemo 5
Amanda Lam
 
COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE COMPUTER LANGUAGES AND THERE DIFFERENCE
COMPUTER LANGUAGES AND THERE DIFFERENCE
Pavan Kalyan
 
Working with NIM - By Jordan Hrycaj
Working with NIM - By Jordan HrycajWorking with NIM - By Jordan Hrycaj
Working with NIM - By Jordan Hrycaj
camsec
 
How to build your own programming language
How to build your own programming language  How to build your own programming language
How to build your own programming language
Kamal Mustafa
 
Ruby'izing iOS development
Ruby'izing iOS developmentRuby'izing iOS development
Ruby'izing iOS development
toamitkumar
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
Возможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OSВозможности интерпретатора Python в NX-OS
Возможности интерпретатора Python в NX-OS
Cisco Russia
 
Single sourcing using Rich Ajax Platform
Single sourcing using Rich Ajax PlatformSingle sourcing using Rich Ajax Platform
Single sourcing using Rich Ajax Platform
Ankur Sharma
 
Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)Dynamic Languages In The Enterprise (4developers march 2009)
Dynamic Languages In The Enterprise (4developers march 2009)
Ivo Jansch
 
invokedynamic: Evolution of a Language Feature
invokedynamic: Evolution of a Language Featureinvokedynamic: Evolution of a Language Feature
invokedynamic: Evolution of a Language Feature
DanHeidinga
 
Building CLIs with Ruby
Building CLIs with RubyBuilding CLIs with Ruby
Building CLIs with Ruby
drizzlo
 
Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015Concurrency and Python - PyCon MY 2015
Concurrency and Python - PyCon MY 2015
Boey Pak Cheong
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?
Charlie Gracie
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?
Charlie Gracie
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
Ahmed Abdou
 
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
Living in a Multi-lingual World: Internationalization in Web and Desktop Appl...
adunne
 
Ad

More from ESUG (20)

Words words words... Automatic detection of word repetition
Words words words... Automatic detection of word repetitionWords words words... Automatic detection of word repetition
Words words words... Automatic detection of word repetition
ESUG
 
ShowUs: Compiling with inlining Druid + Opal = DrOpal
ShowUs: Compiling with inlining Druid + Opal = DrOpalShowUs: Compiling with inlining Druid + Opal = DrOpal
ShowUs: Compiling with inlining Druid + Opal = DrOpal
ESUG
 
Show us your Prokject #esug2024: "Gregg Shorthand"
Show us your Prokject #esug2024: "Gregg Shorthand"Show us your Prokject #esug2024: "Gregg Shorthand"
Show us your Prokject #esug2024: "Gregg Shorthand"
ESUG
 
Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"
Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"
Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"
ESUG
 
Pharo GitLab Example: This is a simple Pharo Smalltalk pipeline example
Pharo GitLab Example: This is a simple Pharo Smalltalk pipeline examplePharo GitLab Example: This is a simple Pharo Smalltalk pipeline example
Pharo GitLab Example: This is a simple Pharo Smalltalk pipeline example
ESUG
 
Show us your Project @ ESUG2024: Security cards
Show us your Project @ ESUG2024: Security cardsShow us your Project @ ESUG2024: Security cards
Show us your Project @ ESUG2024: Security cards
ESUG
 
Phausto: fast and accessible DSP programming for sound and music creation in ...
Phausto: fast and accessible DSP programming for sound and music creation in ...Phausto: fast and accessible DSP programming for sound and music creation in ...
Phausto: fast and accessible DSP programming for sound and music creation in ...
ESUG
 
Modest-Pharo: Unit Test Generation Based on Traces and Metamodels
Modest-Pharo: Unit Test Generation Based on Traces and MetamodelsModest-Pharo: Unit Test Generation Based on Traces and Metamodels
Modest-Pharo: Unit Test Generation Based on Traces and Metamodels
ESUG
 
GLOSS - A GLSP1 Model Server on the Smalltalk Platform
GLOSS - A GLSP1 Model Server on the Smalltalk PlatformGLOSS - A GLSP1 Model Server on the Smalltalk Platform
GLOSS - A GLSP1 Model Server on the Smalltalk Platform
ESUG
 
Smalltalk JIT Compilation: LLVM Experimentation
Smalltalk JIT Compilation: LLVM ExperimentationSmalltalk JIT Compilation: LLVM Experimentation
Smalltalk JIT Compilation: LLVM Experimentation
ESUG
 
Towards resilience against highly dynamic challenges for Wireless Sensor Netw...
Towards resilience against highly dynamic challenges for Wireless Sensor Netw...Towards resilience against highly dynamic challenges for Wireless Sensor Netw...
Towards resilience against highly dynamic challenges for Wireless Sensor Netw...
ESUG
 
SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...
SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...
SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...
ESUG
 
Pyramidion : a framework for Domain-Specific Editor
Pyramidion : a framework for Domain-Specific EditorPyramidion : a framework for Domain-Specific Editor
Pyramidion : a framework for Domain-Specific Editor
ESUG
 
Intentional Benchmarking of Dynamic Languages
Intentional Benchmarking of Dynamic LanguagesIntentional Benchmarking of Dynamic Languages
Intentional Benchmarking of Dynamic Languages
ESUG
 
MethodProxies: A Safe and Fast Message-Passing Control Library
MethodProxies: A Safe and Fast Message-Passing Control LibraryMethodProxies: A Safe and Fast Message-Passing Control Library
MethodProxies: A Safe and Fast Message-Passing Control Library
ESUG
 
Runtime Type Collection and its usage in Code Transpiling
Runtime Type Collection and its usage in Code TranspilingRuntime Type Collection and its usage in Code Transpiling
Runtime Type Collection and its usage in Code Transpiling
ESUG
 
Inlined Code Generation for Smalltalk. From IWST2024
Inlined Code Generation for Smalltalk. From IWST2024Inlined Code Generation for Smalltalk. From IWST2024
Inlined Code Generation for Smalltalk. From IWST2024
ESUG
 
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
ESUG
 
gt4llm: Software Development with LLMs in Glamorous Toolkit
gt4llm: Software Development with LLMs in Glamorous Toolkitgt4llm: Software Development with LLMs in Glamorous Toolkit
gt4llm: Software Development with LLMs in Glamorous Toolkit
ESUG
 
Attack chains construction: Towards detecting and preventing Pharo vulnerabil...
Attack chains construction: Towards detecting and preventing Pharo vulnerabil...Attack chains construction: Towards detecting and preventing Pharo vulnerabil...
Attack chains construction: Towards detecting and preventing Pharo vulnerabil...
ESUG
 
Words words words... Automatic detection of word repetition
Words words words... Automatic detection of word repetitionWords words words... Automatic detection of word repetition
Words words words... Automatic detection of word repetition
ESUG
 
ShowUs: Compiling with inlining Druid + Opal = DrOpal
ShowUs: Compiling with inlining Druid + Opal = DrOpalShowUs: Compiling with inlining Druid + Opal = DrOpal
ShowUs: Compiling with inlining Druid + Opal = DrOpal
ESUG
 
Show us your Prokject #esug2024: "Gregg Shorthand"
Show us your Prokject #esug2024: "Gregg Shorthand"Show us your Prokject #esug2024: "Gregg Shorthand"
Show us your Prokject #esug2024: "Gregg Shorthand"
ESUG
 
Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"
Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"
Slides from ShowUs #esug2024: "QuickTalk: Multicultural Microwiki"
ESUG
 
Pharo GitLab Example: This is a simple Pharo Smalltalk pipeline example
Pharo GitLab Example: This is a simple Pharo Smalltalk pipeline examplePharo GitLab Example: This is a simple Pharo Smalltalk pipeline example
Pharo GitLab Example: This is a simple Pharo Smalltalk pipeline example
ESUG
 
Show us your Project @ ESUG2024: Security cards
Show us your Project @ ESUG2024: Security cardsShow us your Project @ ESUG2024: Security cards
Show us your Project @ ESUG2024: Security cards
ESUG
 
Phausto: fast and accessible DSP programming for sound and music creation in ...
Phausto: fast and accessible DSP programming for sound and music creation in ...Phausto: fast and accessible DSP programming for sound and music creation in ...
Phausto: fast and accessible DSP programming for sound and music creation in ...
ESUG
 
Modest-Pharo: Unit Test Generation Based on Traces and Metamodels
Modest-Pharo: Unit Test Generation Based on Traces and MetamodelsModest-Pharo: Unit Test Generation Based on Traces and Metamodels
Modest-Pharo: Unit Test Generation Based on Traces and Metamodels
ESUG
 
GLOSS - A GLSP1 Model Server on the Smalltalk Platform
GLOSS - A GLSP1 Model Server on the Smalltalk PlatformGLOSS - A GLSP1 Model Server on the Smalltalk Platform
GLOSS - A GLSP1 Model Server on the Smalltalk Platform
ESUG
 
Smalltalk JIT Compilation: LLVM Experimentation
Smalltalk JIT Compilation: LLVM ExperimentationSmalltalk JIT Compilation: LLVM Experimentation
Smalltalk JIT Compilation: LLVM Experimentation
ESUG
 
Towards resilience against highly dynamic challenges for Wireless Sensor Netw...
Towards resilience against highly dynamic challenges for Wireless Sensor Netw...Towards resilience against highly dynamic challenges for Wireless Sensor Netw...
Towards resilience against highly dynamic challenges for Wireless Sensor Netw...
ESUG
 
SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...
SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...
SoSAF: A Pharo-Based Framework for Enhancing System-Of-Systems Dependencies A...
ESUG
 
Pyramidion : a framework for Domain-Specific Editor
Pyramidion : a framework for Domain-Specific EditorPyramidion : a framework for Domain-Specific Editor
Pyramidion : a framework for Domain-Specific Editor
ESUG
 
Intentional Benchmarking of Dynamic Languages
Intentional Benchmarking of Dynamic LanguagesIntentional Benchmarking of Dynamic Languages
Intentional Benchmarking of Dynamic Languages
ESUG
 
MethodProxies: A Safe and Fast Message-Passing Control Library
MethodProxies: A Safe and Fast Message-Passing Control LibraryMethodProxies: A Safe and Fast Message-Passing Control Library
MethodProxies: A Safe and Fast Message-Passing Control Library
ESUG
 
Runtime Type Collection and its usage in Code Transpiling
Runtime Type Collection and its usage in Code TranspilingRuntime Type Collection and its usage in Code Transpiling
Runtime Type Collection and its usage in Code Transpiling
ESUG
 
Inlined Code Generation for Smalltalk. From IWST2024
Inlined Code Generation for Smalltalk. From IWST2024Inlined Code Generation for Smalltalk. From IWST2024
Inlined Code Generation for Smalltalk. From IWST2024
ESUG
 
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
Redesigning FFI calls in Pharo: Exploiting the baseline JIT for more performa...
ESUG
 
gt4llm: Software Development with LLMs in Glamorous Toolkit
gt4llm: Software Development with LLMs in Glamorous Toolkitgt4llm: Software Development with LLMs in Glamorous Toolkit
gt4llm: Software Development with LLMs in Glamorous Toolkit
ESUG
 
Attack chains construction: Towards detecting and preventing Pharo vulnerabil...
Attack chains construction: Towards detecting and preventing Pharo vulnerabil...Attack chains construction: Towards detecting and preventing Pharo vulnerabil...
Attack chains construction: Towards detecting and preventing Pharo vulnerabil...
ESUG
 
Ad

Recently uploaded (20)

How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 

PyPy

  • 1. pypy-logo PyPy - How to not write Virtual Machines for Dynamic Languages Armin Rigo Institut für Informatik Heinrich-Heine-Universität Düsseldorf ESUG 2007 Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 2. pypy-logo Scope This talk is about: implementing dynamic languages (with a focus on complicated ones) in a context of limited resources (academic, open source, or domain-specific) Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 3. pypy-logo Scope This talk is about: implementing dynamic languages (with a focus on complicated ones) in a context of limited resources (academic, open source, or domain-specific) Complicated = requiring a large VM Smalltalk (etc...): typically small core VM Python (etc...): the VM contains quite a lot Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 4. pypy-logo Scope This talk is about: implementing dynamic languages (with a focus on complicated ones) in a context of limited resources (academic, open source, or domain-specific) Complicated = requiring a large VM Smalltalk (etc...): typically small core VM Python (etc...): the VM contains quite a lot Limited resources Only near-complete implementations are really useful Minimize implementer’s duplication of efforts Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 5. pypy-logo Our point Our point: Do not write virtual machines “by hand” Instead, write interpreters in high-level languages Meta-programming is your friend Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 6. pypy-logo Common Approaches to VM construction Using C directly (or C disguised as another language) CPython Ruby Spidermonkey (Mozilla’s JavaScript VM) but also: Squeak, Scheme48 Building on top of a general-purpose OO VM Jython, IronPython JRuby, IronRuby Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 7. pypy-logo Implementing VMs in C When writing a VM in C it is hard to reconcile: flexibility, maintainability simplicity of the VM performance (needs dynamic compilation techniques) Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 8. pypy-logo Implementing VMs in C When writing a VM in C it is hard to reconcile: flexibility, maintainability simplicity of the VM performance (needs dynamic compilation techniques) Python Case CPython is a very simple bytecode VM, performance not great Psyco is a just-in-time-specializer, very complex, hard to maintain, but good performance Stackless is a fork of CPython adding microthreads. It was never incorporated into CPython for complexity reasons Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 9. pypy-logo Compilers are a bad encoding of Semantics to reach good performance levels, dynamic compilation is often needed a dynamic compiler needs to encode language semantics this encoding is often obscure and hard to change Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 10. pypy-logo Compilers are a bad encoding of Semantics to reach good performance levels, dynamic compilation is often needed a dynamic compiler needs to encode language semantics this encoding is often obscure and hard to change Python Case Psyco is a dynamic compiler for Python synchronizing with CPython’s rapid development is a lot of effort many of CPython’s new features not supported well Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 11. pypy-logo Fixing of Early Design Decisions when starting a VM in C, many design decisions need to be made upfront examples: memory management technique, threading model the decision is manifested throughout the VM source very hard to change later Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 12. pypy-logo Fixing of Early Design Decisions when starting a VM in C, many design decisions need to be made upfront examples: memory management technique, threading model the decision is manifested throughout the VM source very hard to change later Python Case CPython uses reference counting, increfs and decrefs everywhere CPython uses OS threads with one global lock, hard to change to lightweight threads or finer locking Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 13. pypy-logo Implementation Proliferation restrictions of the original implementation lead to re-implementations, forks all implementations need to be synchronized with language evolution lots of duplicate effort Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 14. pypy-logo Implementation Proliferation restrictions of the original implementation lead to re-implementations, forks all implementations need to be synchronized with language evolution lots of duplicate effort Python Case several serious implementations: CPython, Stackless, Psyco, Jython, IronPython, PyPy the implementations have various grades of compliance Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 15. pypy-logo Implementing Languages on Top of General-Purpose OO VMs users wish to have easy interoperation with the general-purpose OO VMs used by the industry (JVM, CLR) therefore re-implementations of the language on the OO VMs are started even more implementation proliferation implementing on top of an OO VM has its own set of problems Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 16. pypy-logo Implementing Languages on Top of General-Purpose OO VMs users wish to have easy interoperation with the general-purpose OO VMs used by the industry (JVM, CLR) therefore re-implementations of the language on the OO VMs are started even more implementation proliferation implementing on top of an OO VM has its own set of problems Python Case Jython is a Python-to-Java-bytecode compiler IronPython is a Python-to-CLR-bytecode compiler both are slightly incompatible with the newest CPython version (especially Jython) Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 17. pypy-logo Benefits of implementing on top of OO VMs higher level of implementation the VM supplies a GC and mostly a JIT better interoperability than what the C level provides some proponents believe that eventually one single VM should be enough Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 18. pypy-logo The problems of OO VMs some of the benefits of OO VMs don’t work out in practice most immediate problem: it can be hard to map concepts of the dynamic lang to the host OO VM performance is often not improved, and can be very bad, because of the semantic mismatch between the dynamic language and the host VM poor interoperability with everything outside the OO VM in practice, one OO VM is not enough Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 19. pypy-logo The problems of OO VMs some of the benefits of OO VMs don’t work out in practice most immediate problem: it can be hard to map concepts of the dynamic lang to the host OO VM performance is often not improved, and can be very bad, because of the semantic mismatch between the dynamic language and the host VM poor interoperability with everything outside the OO VM in practice, one OO VM is not enough Python Case Jython about 5 times slower than CPython IronPython is about as fast as CPython (but some introspection features missing) Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 20. pypy-logo PyPy’s Approach to VM Construction Goal: achieve flexibility, simplicity and performance together Approach: auto-generate VMs from high-level descriptions of the language ... using meta-programming techniques and aspects high-level description: an interpreter written in a high-level language ... which we translate (i.e. compile) to VMs running on top of various targets, like C/Posix, CLR, JVM Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 21. pypy-logo PyPy PyPy = Python interpreter written in RPython + translation toolchain for RPython Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 22. pypy-logo PyPy PyPy = Python interpreter written in RPython + translation toolchain for RPython What is RPython RPython is a subset of Python subset chosen in such a way that type-inference can be performed still a high-level language (unlike SLang or Prescheme) ...really a subset, can’t give a small example of code that doesn’t just look like Python :-) Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 23. pypy-logo Auto-generating VMs high-level source: early design decisions not necessary we need a custom translation toolchain to compile the interpreter to a full VM many aspects of the final VM are orthogonal to the interpreter source: they are inserted during translation translation aspect ∼= monads, with more ad-hoc control Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 24. pypy-logo Auto-generating VMs high-level source: early design decisions not necessary we need a custom translation toolchain to compile the interpreter to a full VM many aspects of the final VM are orthogonal to the interpreter source: they are inserted during translation translation aspect ∼= monads, with more ad-hoc control Examples Garbage Collection strategy Threading models (e.g. coroutines with CPS...) non-trivial translation aspect: auto-generating a dynamic compiler from the interpreter Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 25. pypy-logo Good Points of the Approach Simplicity: dynamic languages can be implemented in a high level language separation of concerns from low-level details a potential single-source-fits-all interpreter – less duplication of efforts runs everywhere with the same semantics – no outdated implementations, no ties to any standard platform Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 26. pypy-logo Good Points of the Approach Simplicity: dynamic languages can be implemented in a high level language separation of concerns from low-level details a potential single-source-fits-all interpreter – less duplication of efforts runs everywhere with the same semantics – no outdated implementations, no ties to any standard platform PyPy arguably the most readable Python implementation so far Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 27. pypy-logo Good Points of the Approach Flexibility at all levels: when writing the interpreter (high-level languages rule!) when adapting the translation toolchain as necessary to break abstraction barriers when necessary Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 28. pypy-logo Good Points of the Approach Flexibility at all levels: when writing the interpreter (high-level languages rule!) when adapting the translation toolchain as necessary to break abstraction barriers when necessary Example boxed integer objects, represented as tagged pointers manual system-level RPython code Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 29. pypy-logo Good Points of the Approach Performance: “reasonable” performance can generate a dynamic compiler from the interpreter (work in progress, 60x faster on very simple Python code) Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 30. pypy-logo Good Points of the Approach Performance: “reasonable” performance can generate a dynamic compiler from the interpreter (work in progress, 60x faster on very simple Python code) JIT compiler generator almost orthogonal from the interpreter source - applicable to many languages, follows language evolution “for free” based on Partial Evaluation benefits from a high-level interpreter and a tweakable translation toolchain generating a dynamic compiler is easier than generating a static one! Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 31. pypy-logo Open Issues / Drawbacks / Further Work writing the translation toolchain in the first place takes lots of effort (but it can be reused) writing a good GC is still necessary. But: maybe we can reuse existing good GCs (e.g. from the Jikes RVM)? conceptually simple approach but many abstraction layers dynamic compiler generation seems to work, but needs more efforts. Also: can we layer it on top of the JIT of a general purpose OO VM? Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 32. pypy-logo Conclusion / Meta-Points high-level languages are suitable to implement dynamic languages doing so has many benefits VMs shouldn’t be written by hand PyPy’s concrete approach is not so important diversity is good let’s write more meta-programming toolchains! Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages
  • 33. pypy-logo For more information PyPy http://codespeak.net/pypy/ “Sprints” Main way we develop PyPy They are programming camps, a few days to one week long We may have one in Bern soon (PyPy+Squeak) and/or in Germany (JIT and other topics) See also Google for the full paper corresponding to these slides that was submitted at Dyla’2007 Armin Rigo PyPy - How to not write Virtual Machines for Dynamic Languages