[pypy-svn] r35113 - in pypy/extradoc/talk/warsaw2006: . src
fijal at codespeak.net
fijal at codespeak.net
Wed Nov 29 12:55:36 CET 2006
Author: fijal
Date: Wed Nov 29 12:55:33 2006
New Revision: 35113
Modified:
pypy/extradoc/talk/warsaw2006/confrest.py
pypy/extradoc/talk/warsaw2006/fireworks-slides.txt
pypy/extradoc/talk/warsaw2006/src/slideshow.py
pypy/extradoc/talk/warsaw2006/src/web.py
pypy/extradoc/talk/warsaw2006/style.css
Log:
Next version of my talk
Modified: pypy/extradoc/talk/warsaw2006/confrest.py
==============================================================================
--- pypy/extradoc/talk/warsaw2006/confrest.py (original)
+++ pypy/extradoc/talk/warsaw2006/confrest.py Wed Nov 29 12:55:33 2006
@@ -11,6 +11,10 @@
stylesheet = 'style.css'
encoding = 'latin1'
prefix_title = "PyPy "
- logo = ''
+ logo = html.div(
+ html.a(
+ html.img(alt="PyPy", id="pyimg",
+ src="http://codespeak.net/pypy/img/py-web1.png",
+ height=110, width=149)))
Page = PyPyFireworksPage
Modified: pypy/extradoc/talk/warsaw2006/fireworks-slides.txt
==============================================================================
--- pypy/extradoc/talk/warsaw2006/fireworks-slides.txt (original)
+++ pypy/extradoc/talk/warsaw2006/fireworks-slides.txt Wed Nov 29 12:55:33 2006
@@ -26,16 +26,16 @@
Compiler toolchain:
===================
-* (picture)
-
* eats RPython
* C considered harmfull
+* is kind-of-stable right now
+
Flow graphs & annotation:
=========================
-* We create flow graph out of RPython code::
+* We create flow graph out of RPython code `flow`_::
def g(x):
return 1
@@ -43,17 +43,17 @@
def f(x):
return g(x) + 3
-.. raw:: html
-
- <a href="javascript:flow()">Show</a>
+* We `annotate`_ variables encountered
-* We annotate variables encountered
+* It must be "static-enough" to perform such operation
-* "static-enough"
+* We `RType`_ (creating low-level types)
-* (picture)
+* Source generation
-* (demo)
+.. _`flow`: javascript:flow()
+.. _`annotate`: javascript:annotate()
+.. _`RType`: javascript:rtype()
RPython:
========
@@ -66,32 +66,54 @@
* Is build "as we need it", so no real definition
-* rctypes
+* rctypes (like ctypes, but will change to C calls)
-* (examples)
+Backends & more flow graphs:
+============================
-Multiple backends:
-==================
+* LLtype-based: C, LLVM,
-* Actually: C, LLVM, CLI, JVM, JavaScript, (CL and Squek in some state).
+* OOtype-based: CLI, JVM, JavaScript, (CL and Squek in some state).
-* PyPy the way you like it.
+* All optimisations are done on flow graphs
-JavaScript backend (1/2):
-=========================
+* XXX: constant-folding demo
+
+* Wide range of possible things to do with it
+
+JavaScript backend:
+===================
* Co-funded by Google Summer of Code *and* Summer of PyPy.
* Mochikit: Makes JavaScript suck less...
-JavaScript backend (2/2):
-=========================
+JavaScript backend:
+===================
+
+* pypy.js: makes JavaScript suck less by not using it::
+
+ def f(x):
+ return dom.get_document().getElementById(x)
+
+* Unittest in python run in browser::
+
+ def test_f():
+ assert isinstance(f("id"), dom.Element)
+
+* Python semantics (not only syntax)::
+
+ try:
+ {'a':3}['b']
+ except KeyError:
+ # will arrive here
-* pypy.js: makes JavaScript suck less by not using it
+JavaScript example one (console):
+=================================
-* Unittest in python run in browser
+JavaScript example two (Bub'n'Bros):
+====================================
-* AJAX by method calls.
Transparent proxy:
==================
Modified: pypy/extradoc/talk/warsaw2006/src/slideshow.py
==============================================================================
--- pypy/extradoc/talk/warsaw2006/src/slideshow.py (original)
+++ pypy/extradoc/talk/warsaw2006/src/slideshow.py Wed Nov 29 12:55:33 2006
@@ -23,6 +23,9 @@
content = dom.get_document().getElementById("contentspace")
for child in content.childNodes[:]:
content.removeChild(child)
+ content.style.position = "absolute"
+ content.style.top = "0px"
+ content.style.left = "170px"
def show(self, num):
content = dom.get_document().getElementById("contentspace")
@@ -48,10 +51,16 @@
page.delete_nodes()
page.show(0)
dom.get_document().onkeypress = keydown
- createLoggingPane(True)
+ #createLoggingPane(True)
def comeback(msg):
pass
def flow():
exported_methods.flow_basic(comeback)
+
+def annotate():
+ exported_methods.annotate_basic(comeback)
+
+def rtype():
+ exported_methods.rtype_basic(comeback)
Modified: pypy/extradoc/talk/warsaw2006/src/web.py
==============================================================================
--- pypy/extradoc/talk/warsaw2006/src/web.py (original)
+++ pypy/extradoc/talk/warsaw2006/src/web.py Wed Nov 29 12:55:33 2006
@@ -4,19 +4,18 @@
"""
import py
-from py.__.test.rsession import web
+from pypy.translator.js.examples import server
from pypy.rpython.ootypesystem.bltregistry import MethodDesc, BasicExternal,\
described
-from pypy.translator.js.main import rpython2javascript, Options
from pypy.translator.js import commproxy
-from pypy.translator.js import json
+from pypy.translator.js.main import rpython2javascript
from pypy.translator.interactive import Translation
commproxy.USE_MOCHIKIT = True
-FUNCTION_LIST = ['show', 'flow']
+FUNCTION_LIST = ['show', 'flow', 'annotate', 'rtype']
class ExportedMethods(BasicExternal):
_render_xmlhttp = True
@@ -30,36 +29,50 @@
def g(x):
return f(x) + 3
- self.t = Translation(f)
+ self.t = Translation(g)
@described(retval=None)
def flow_basic(self):
self._create_t()
self.t.view()
- return json.write(None)
+
+ @described(retval=None)
+ def annotate_basic(self):
+ self._create_t()
+ self.t.annotate([int])
+ self.t.view()
+
+ @described(retval=None)
+ def rtype_basic(self):
+ self._create_t()
+ self.t.annotate([int])
+ self.t.rtype()
+ self.t.view()
exported_methods = ExportedMethods()
main_path = py.path.local(__file__).dirpath()
-class Handler(web.TestHandler):
+class Handler(server.TestHandler):
exported_methods = exported_methods
- def run_(self):
- self.run_index()
-
- def run_index(self):
- data_name = main_path.dirpath().join("fireworks-slides.html")
- data = data_name.open().read()
- self.serve_data("text/html", data)
+ def index(self):
+ return main_path.dirpath().join("fireworks-slides.html").open().read()
+ index.exposed = True
- def run_jssource_js(self):
+ def jssource_js(self):
import slideshow
javascript_source = rpython2javascript(slideshow,
FUNCTION_LIST)
- self.serve_data("text/javascript", javascript_source)
+ return "text/javascript", javascript_source
+ jssource_js.exposed = True
- def run_MochiKit_js(self):
- self.serve_data("text/javascript", main_path.join("MochiKit.js").open().read())
+ def MochiKit_js(self):
+ return "text/javascript", main_path.join("MochiKit.js").open().read()
+ MochiKit_js.exposed = True
+
+ def style_css(self):
+ return "text/css", main_path.dirpath().join("style.css").open().read()
+ style_css.exposed = True
if __name__ == '__main__':
- web.start_server(handler=Handler, start_new=False)
+ server.start_server(handler=Handler, start_new=False)
Modified: pypy/extradoc/talk/warsaw2006/style.css
==============================================================================
--- pypy/extradoc/talk/warsaw2006/style.css (original)
+++ pypy/extradoc/talk/warsaw2006/style.css Wed Nov 29 12:55:33 2006
@@ -1,14 +1,18 @@
body {
- background-color: #FFE;
+ background-color: #FFF;
color: #530;
font-family: Trebuchet MS, Verdana;
font-size: 1.4em;
}
-#metaspace, #docinfoline {
+#metaspace {
display: none;
}
.section {
height: 700px;
}
+
+li {
+ min-height: 50px;
+}
\ No newline at end of file
More information about the Pypy-commit
mailing list