[pypy-svn] r35166 - in pypy/extradoc/talk/warsaw2006: . src
fijal at codespeak.net
fijal at codespeak.net
Thu Nov 30 16:34:28 CET 2006
Author: fijal
Date: Thu Nov 30 16:34:26 2006
New Revision: 35166
Modified:
pypy/extradoc/talk/warsaw2006/fireworks-slides.txt
pypy/extradoc/talk/warsaw2006/src/slideshow.py
pypy/extradoc/talk/warsaw2006/src/web.py
Log:
(hopefully) final version
Modified: pypy/extradoc/talk/warsaw2006/fireworks-slides.txt
==============================================================================
--- pypy/extradoc/talk/warsaw2006/fireworks-slides.txt (original)
+++ pypy/extradoc/talk/warsaw2006/fireworks-slides.txt Thu Nov 30 16:34:26 2006
@@ -66,8 +66,6 @@
* Is build "as we need it", so no real definition
-* rctypes (like ctypes, but will change to C calls)
-
Backends & more flow graphs:
============================
@@ -77,10 +75,19 @@
* All optimisations are done on flow graphs
-* XXX: constant-folding demo
+* `example`_, and a `constant-folded one`_::
+
+ def g():
+ return 3
+
+ def f():
+ return g() + 1 * 2
* Wide range of possible things to do with it
+.. _`example`: javascript:example()
+.. _`constant-folded one`: javascript:const_fold()
+
JavaScript backend:
===================
@@ -117,10 +124,9 @@
Transparent proxy:
==================
-* Idea (proxied to app-level), altough there is interp-level version
+* Idea - proxied to app-level
-* Possible usecase - shallow copy of remote objects (altough not working
- because of lack of os.execv)::
+* Possible usecase - shallow copy of remote objects::
elem = get_remote("obj") # accessed as a name in globals
# remote type is faked here
@@ -139,13 +145,37 @@
* So called "stackless" features
-* Basically provides way of copying stack to heap and backwards
+* Available primitives: coroutines, greenlets, tasklets::
+
+ c = channel()
+
+ def f():
+ c.send(3)
+
+ def g():
+ return c.receive()
+
+ tasklet(f)()
+ assert g() == 3
+
+* It provides way of copying stack to heap and backwards
+
+Stackless goodies:
+==================
+
+* Very deep recursion
+
+* No deadlock
+
+* No race conditions (in a classic sense)
+
+* Explicit scheduling
-* pickling coroutines
+* Pickling coroutines
-* cloning coroutines
+* Cloning coroutines
-* based on graph-transform
+* All based on graph-transform
Composability:
==============
Modified: pypy/extradoc/talk/warsaw2006/src/slideshow.py
==============================================================================
--- pypy/extradoc/talk/warsaw2006/src/slideshow.py (original)
+++ pypy/extradoc/talk/warsaw2006/src/slideshow.py Thu Nov 30 16:34:26 2006
@@ -64,3 +64,10 @@
def rtype():
exported_methods.rtype_basic(comeback)
+
+def example():
+ exported_methods.example(comeback)
+
+def const_fold():
+ exported_methods.const_fold(comeback)
+
Modified: pypy/extradoc/talk/warsaw2006/src/web.py
==============================================================================
--- pypy/extradoc/talk/warsaw2006/src/web.py (original)
+++ pypy/extradoc/talk/warsaw2006/src/web.py Thu Nov 30 16:34:26 2006
@@ -15,7 +15,7 @@
commproxy.USE_MOCHIKIT = True
-FUNCTION_LIST = ['show', 'flow', 'annotate', 'rtype']
+FUNCTION_LIST = ['show', 'flow', 'annotate', 'rtype', 'const_fold', 'example']
class ExportedMethods(BasicExternal):
_render_xmlhttp = True
@@ -31,6 +31,17 @@
self.t = Translation(g)
+ def _create_t2(self):
+ if hasattr(self, 't2'):
+ return
+ def g():
+ return 3
+
+ def f():
+ return g() + 1 * 2
+
+ self.t2 = Translation(f)
+
@described(retval=None)
def flow_basic(self):
self._create_t()
@@ -49,6 +60,19 @@
self.t.rtype()
self.t.view()
+ @described(retval=None)
+ def example(self):
+ self._create_t2()
+ self.t2.annotate()
+ self.t2.rtype()
+ self.t2.view()
+
+ @described(retval=None)
+ def const_fold(self):
+ self._create_t2()
+ self.t2.backendopt()
+ self.t2.view()
+
exported_methods = ExportedMethods()
main_path = py.path.local(__file__).dirpath()
@@ -75,4 +99,4 @@
style_css.exposed = True
if __name__ == '__main__':
- server.start_server(handler=Handler, start_new=False)
+ server.start_server(server_address=('localhost', 7070), handler=Handler, start_new=False)
More information about the Pypy-commit
mailing list