[pypy-svn] r54772 - pypy/extradoc/talk/s3-2008
cfbolz at codespeak.net
cfbolz at codespeak.net
Fri May 16 08:55:52 CEST 2008
Author: cfbolz
Date: Fri May 16 08:55:49 2008
New Revision: 54772
Modified:
pypy/extradoc/talk/s3-2008/objmodel.pdf
pypy/extradoc/talk/s3-2008/speed.pdf
pypy/extradoc/talk/s3-2008/talk.tex
Log:
accumulated changes
Modified: pypy/extradoc/talk/s3-2008/objmodel.pdf
==============================================================================
Binary files. No diff available.
Modified: pypy/extradoc/talk/s3-2008/speed.pdf
==============================================================================
Binary files. No diff available.
Modified: pypy/extradoc/talk/s3-2008/talk.tex
==============================================================================
--- pypy/extradoc/talk/s3-2008/talk.tex (original)
+++ pypy/extradoc/talk/s3-2008/talk.tex Fri May 16 08:55:49 2008
@@ -43,7 +43,7 @@
\and%
\vskip-2mm
\inst{3}%
- ETH Zurich, Switzerland
+ ETH Zürich, Switzerland
}
@@ -81,9 +81,9 @@
\begin{frame}
\frametitle{Scope}
- This talk is about: XXX
+ This talk is about:
\begin{itemize}
- \item writing a Squeak implementation
+ \item writing a Squeak implementation (called "SPy") in Python
\item with eight people
\item in five days
\item using PyPy
@@ -91,14 +91,14 @@
\end{frame}
\begin{frame}
- \frametitle{What is PyPy}
+ \frametitle{What is PyPy?}
\begin{itemize}
\item started as a Python implementation in Python
+ \item Open Source project, MIT license
\item developed into a general environment for implementing dynamic languages
\item supports the language developer with a lot of infrastructure
- \item Open Source project, MIT license
\item most important goal: abstracting over low-level details
- \item don't fix decisions about low-level details
+ \item don't fix decisions about low-level details early
\end{itemize}
\end{frame}
@@ -106,19 +106,18 @@
\frametitle{PyPy's Approach to VM Construction}
\begin{itemize}
\item implement an interpreter for the dynamic language in RPython
- \item translate this interpreter to a low-level language
- \item translating inserts low-level details
+ \item translate this interpreter to a low-level language with PyPy toolchain
\item a variety of target environment: C, LLVM, JVM, .NET
+ %\item translating inserts left-out low-level details
% XXX write about model-driven development?
\end{itemize}
\pause
\begin{block} {What is RPython?}
\begin{itemize}
\item a more static subset of Python
- \item static enough to enable type inference
- \item still rather expressive: exceptions, inheritance, dynamic dispatch
- \item analysis starts after importing of interpreter
- \item enables compile-time metaprogramming
+ \item static enough to allow type inference
+ \item still rather expressive: exceptions, single inheritance, dynamic dispatch, interesting builtin types, garbage collection
+ %\item translations starts after importing of interpreter
\end{itemize}
\end{block}
\end{frame}
@@ -126,11 +125,12 @@
\begin{frame}
\begin{block} {Translation Aspects}
\begin{itemize}
- \item many aspects of the final VM are orthogonal to language semantics
+ \item many low-level details of the final VM are orthogonal to language semantics
\item examples: GC strategy, threading model, many object details
- \item non-trivial translation aspect: auto-generating a dynamic compiler
- \item those shouldn't manifest in the interpreter source
+ \item those shouldn't be visible in the interpreter source
\item they are inserted during translation
+ \pause
+ \item non-trivial translation aspect: auto-generating a dynamic compiler
\end{itemize}
\end{block}
\pause
@@ -147,9 +147,9 @@
\frametitle{The SPy VM}
\begin{itemize}
\item really simple, straight-forward Squeak interpreter in RPython
- \item essentially free of low-level details, no GC
- \item written in the course of five days
- \item sprint-driven development
+ \item goal is to fully support loading and running Squeak images
+ \item source code essentially free of low-level details, no GC
+ \item written during a five-day sprint in October in Bern
\end{itemize}
\pause
\begin{block} {Status}
@@ -162,9 +162,9 @@
\end{block}
\end{frame}
-\begin{frame}
+\begin{frame}[plain]
\frametitle{SPy Object Model}
- \includegraphics[height=5cm]{objmodel}
+ \includegraphics[height=7.5cm]{objmodel}
\end{frame}
\begin{frame}
@@ -173,16 +173,17 @@
\begin{itemize}
\item classes are just objects: can't really say which objects are used as classes
\item any object with the right instance fields can be used as a class
- \item cryptic bitfields in the class which the VM needs to decode all the time
+ \item cryptic (bit)fields in the class which the VM needs to decode all the time
\end{itemize}
\pause
- \begin{block}{Shadows}
+ \begin{block}{Approach}
\begin{itemize}
- \item approach: potentially attach a \emph{shadow} to every object
+ \item potentially attach a \emph{shadow} to every object
\item the shadow caches VM-internal information
\item when the object is changed, the shadow is invalidated
- \item so far only used for classes, later contexts, methods
+ \item so far only used for classes, probably more later
\item conceptual cleanliness and nicer VM implementation
+ \item still allows to expose low-level view to user code
\end{itemize}
\end{block}
\end{frame}
@@ -190,17 +191,18 @@
\begin{frame}
\frametitle{Tagged Pointers}
\begin{itemize}
- \item Squeak implements integers as tagged pointers
+ \item Squeak implements small integers as tagged pointers
\item doing that is orthogonal to language semantics
\item in PyPy implemented as a translation aspect
- \item one class with exactly one int field can be implemented with a flag
+ \item one class with exactly one int field can optionally be implemented
+ with tagged pointers
\item when enabled, all method calls check for tag first
- \item usually changing such a decision would be a major effort
+ \item usually changing such an implementation choice would be a major effort
\end{itemize}
\pause
- \begin{block}{Results}
+ \begin{block}{Results of Tagging}
\begin{itemize}
- \item small slowdown
+ \item small slowdown due to need to check for flag
\item memory advantage not measured
\item really easy to do
\end{itemize}
@@ -214,7 +216,7 @@
\item failure signaled by an exception
\item automatic popping from the stack and unwrapping of arguments
\item automatic pushing of the result
- \item using a custom decorator \texttt{expose\_primitive}
+ \item using a custom function decorator \texttt{expose\_primitive}
\item compile-time metaprogramming
\end{itemize}
\end{frame}
@@ -231,31 +233,34 @@
]
-def make_func(code, op):
+def make_primitive(prim_num, op):
- @expose_primitive(code, unwrap_spec=[int, int])
- def func(interp, v1, v2):
+ @expose_primitive(prim_num, unwrap_spec=[int, int])
+ def primitive(interp, v1, v2):
res = op(v1, v2)
w_res = utility.wrap_bool(res)
return w_res
-for (code, op) in bool_ops:
- make_func(code, op)
+for (prim_num, op) in bool_ops:
+ make_primitive(prim_num, op)
\end{verbatim}
}
-\begin{frame}
- \frametitle{Image Loading}
- \begin{itemize}
- \item manual decoding of Squeak images by reading Squeak object format
- \item image writing could be done in the same way later
- \item not really a reason to directly use a memory dump
- \item (hard anyway, on object-oriented platforms)
- \end{itemize}
-\end{frame}
+
+%\begin{frame}
+% \frametitle{Image Loading}
+% \begin{itemize}
+% \item manual decoding of Squeak images by reading Squeak object format
+% \item image writing could be done in the same way later
+% \item not really possible to directly use a memory dump
+% \item not really necessary either
+% \item (hard anyway, on object-oriented platforms)
+% \end{itemize}
+%\end{frame}
\frame[plain]{
\frametitle{Performance (tiny Benchmark)}
+ \centering
\includegraphics[height=8cm]{speed}
}
@@ -272,10 +277,16 @@
{\bf Bad Points of the Approach:}
\begin{itemize}
\item not really fast (yet)
- \item XXX XXX
+ \item RPython isn't Python
+ \item toolchain needs quite some effort (but only once)
\end{itemize}
\end{frame}
+%<arigato> we could mention that we have many abstraction layers and levels in the translation toolchain,
+%<arigato> which is generally good and useful but makes things more complex
+%<arigato> that would be how I'd compare with cola
+%<arigato> of course the question "how do you compare with cola" will be asked, so we need to be ready for it
+
\begin{frame}
\frametitle{Outlook}
\begin{itemize}
@@ -285,6 +296,12 @@
\item JIT (see next slide)
\item lessons learned for a "SqueaSquea"?
\end{itemize}
+ \begin{block}{
+ Join the Sprint!}
+ \bigskip
+ \hskip 1cm Saturday - Thursday, C-Base Berlin
+ \bigskip
+ \end{block}
\end{frame}
\begin{frame}
@@ -295,7 +312,6 @@
languages, follows language evolution ``for free''
\item based on Partial Evaluation techniques
\item benefits from a high-level interpreter
- \item generating a dynamic compiler is easier than generating a static one!
\item shares ideas with tracing JITs
\end{itemize}
\pause
@@ -309,10 +325,19 @@
\begin{frame}
\frametitle{Questions?}
+ Outlook:
+ \begin{itemize}
+ \item do graphical builtins, to actually start the full environment
+ \item Squeak-specific optimizations:
+ \item method-cache (should be easy with shadows)
+ \item JIT (automatic generation of dynamic compilers)
+ \item lessons learned for a "SqueaSquea"?
+ \end{itemize}
+ \bigskip
\begin{block}{
- PyPy}
+ Join the Sprint!}
\bigskip
- \hskip 1cm \url{http://codespeak.net/pypy/}
+ \hskip 1cm Saturday - Thursday, C-Base Berlin
\bigskip
\end{block}
\end{frame}
More information about the Pypy-commit
mailing list