[pypy-svn] r45303 - pypy/extradoc/talk/dyla2007

cfbolz at codespeak.net cfbolz at codespeak.net
Tue Jul 24 16:51:25 CEST 2007


Author: cfbolz
Date: Tue Jul 24 16:51:25 2007
New Revision: 45303

Modified:
   pypy/extradoc/talk/dyla2007/talk.tex
Log:
start the "problems with C" part


Modified: pypy/extradoc/talk/dyla2007/talk.tex
==============================================================================
--- pypy/extradoc/talk/dyla2007/talk.tex	(original)
+++ pypy/extradoc/talk/dyla2007/talk.tex	Tue Jul 24 16:51:25 2007
@@ -61,54 +61,133 @@
   % You might wish to add the option [pausesections]
 %\end{frame}
 
+\begin{frame}
+  \frametitle{Introduction}
+  \begin{itemize}
+  \item XXX intro, talk about scope
+  \end{itemize}
+\end{frame}
+
 
-% examples from my last beamer talk, shows the most important features
 \begin{frame}
-  \frametitle{Pyrolog}
+  \frametitle{Common Approaches to VM construction}
+  \begin{block}{
+    Using C directly (or C disguised as another language)}
+    \begin{itemize}
+    \item
+      CPython
+    \item
+      Ruby
+    \item
+      Spidermonkey (Mozilla's JavaScript VM)
+    \item
+      but also: Squeak, Scheme48
+    \end{itemize}
+  \end{block}
+  \begin{block}{
+    Building on top of an existing OO VM}
+    \begin{itemize}
+    \item
+      Jython, IronPython
+    \item
+      JRuby, IronRuby
+    \end{itemize}
+  \end{block}
+\end{frame}
 
+\begin{frame}
+  \frametitle{The Problems of C}
+  When writing a VM in C it is hard to reconcile:
   \begin{itemize}
   \item
-    Pyrolog is a Prolog interpreter written in Python –
-  \item
-    want to compile it to get interesting performance
-  \item
-    translation tool-chain part of the PyPy project
+    flexibility, maintainability
   \item
-    Python itself is too dynamic to be translatable to other languages, need a subset
+    simplicity of the VM
   \item
-    RPython (``Restricted Python'') is a subset of Python translatable to other
-    languages
-  \item
-    RPython is designed to be significantly faster than regular Python
+    performance (needs dynamic compilation techniques)
   \end{itemize}
+  \pause
+  \begin{block}{
+    Python Case}
+    \begin{itemize}
+    \item
+      \alert{CPython} is a very simple bytecode VM, performance not great
+    \item
+      \alert{Psyco} is a just-in-time-specializer, very complex, hard to
+      maintain, but good performance
+    \item
+      \alert{Stackless} is a fork of CPython adding microthreads. It was never
+      incorporated into CPython for complexity reasons
+    \end{itemize}
+  \end{block}
 \end{frame}
 
+\begin{frame}
+  \frametitle{Compilers are a bad encoding of Semantics}
+  \begin{itemize}
+  \item to reach good performance levels, dynamic compilation is often needed
+  \item a dynamic compiler needs to encoding language semantics
+  \item this encoding is often relatively obscure and hard to change
+  \end{itemize}
+  \pause
+  \begin{block}{
+    Python Case}
+    \begin{itemize}
+    \item
+      Psyco is a dynamic compiler for Python
+    \item
+      synchronizing with CPython's rapid development is a lot of effort
+    \item
+      many of CPython's new features not supported well
+    \end{itemize}
+  \end{block}
+\end{frame}
 
 \begin{frame}
-  \frametitle{The Python case}
-  CPython (the reference implementation) is a straightforward, portable VM.
+  \frametitle{Fixing of Early Design Decisions}
+  \begin{itemize}
+  \item when starting a VM in C, many decisions need to be made immediately
+  \item examples: memory management technique, threading model
+  \item the decision is manifested throughout the VM source
+  \item very hard to change later
+  \end{itemize}
+  \pause
+  \begin{block}{
+    Python Case}
+    \begin{itemize}
+    \item
+      CPython uses reference counting, increfs and decrefs everywhere
+    \item
+      CPython uses OS threads with one global lock, hard to change to
+      lightweight threads or finer locking
+    \end{itemize}
+  \end{block}
+\end{frame}
 
+\begin{frame}
+  \frametitle{Implementation Proliferation}
   \begin{itemize}
   \item
-    Pervasive decisions: reference counting, global lock \dots
+    restrictions of the original implementation lead to re-implementations,
+    forks
+  \item
+    all implementations need to be syncronized with language evolution
   \item
-    No dynamic compilation
+    lots of duplicate effort
   \end{itemize}
   \pause
   \begin{block}{
-    Extensions:}
+    Python Case}
     \begin{itemize}
     \item
-      \alert{Stackless} (unlimited recursion, coroutines, green threads)
+      several serious implementations: CPython, Stackless, Psyco, Jython,
+      IronPython, PyPy
     \item
-      \alert{Psyco} (run-time specializing compiler)
-    \item
-      \alert{Jython}, \alert{IronPython}
+      the implementations have various grades of compliance
     \end{itemize}
   \end{block}
 \end{frame}
 
-
 \begin{frame}
   \frametitle{Title}
   \begin{itemize}
@@ -117,7 +196,6 @@
 \end{frame}
 
 
-
 \end{document}
 
 



More information about the Pypy-commit mailing list