[pypy-svn] r44732 - in pypy/extradoc/talk/ep2007: . rpython-demo
antocuni at codespeak.net
antocuni at codespeak.net
Wed Jul 4 21:13:16 CEST 2007
Author: antocuni
Date: Wed Jul 4 21:13:15 2007
New Revision: 44732
Added:
pypy/extradoc/talk/ep2007/rpython-demo/
pypy/extradoc/talk/ep2007/rpython-demo/carbonpython.py (contents, props changed)
pypy/extradoc/talk/ep2007/rpython-demo/demo.txt (contents, props changed)
pypy/extradoc/talk/ep2007/rpython-demo/func.py (contents, props changed)
Modified:
pypy/extradoc/talk/ep2007/rpython.txt
Log:
some slides about gencli/carbonpython and the demo
Added: pypy/extradoc/talk/ep2007/rpython-demo/carbonpython.py
==============================================================================
--- (empty file)
+++ pypy/extradoc/talk/ep2007/rpython-demo/carbonpython.py Wed Jul 4 21:13:15 2007
@@ -0,0 +1,13 @@
+import sys
+
+if sys.platform == 'cli':
+ # on IronPython, export does nothing
+ def export(*args, **kwds):
+ if len(args) == 1 and isinstance(args[0], type(export)):
+ return args[0]
+ else:
+ return lambda fn: fn
+else:
+ # import carbonpython's export
+ from pypy.translator.cli.carbonpython import export
+
Added: pypy/extradoc/talk/ep2007/rpython-demo/demo.txt
==============================================================================
--- (empty file)
+++ pypy/extradoc/talk/ep2007/rpython-demo/demo.txt Wed Jul 4 21:13:15 2007
@@ -0,0 +1,39 @@
+# CarbonPython live demo
+
+$ cat func.py
+from carbonpython import export
+import time
+
+ at export(int)
+def fn(N):
+ t1 = time.clock()
+ z = 0
+ for index in xrange(N):
+ x = 2.34+index
+ y = 3.45+index
+ z = (x*x)+(y*y)+index
+ t2 = time.clock()
+ print t2-t1, 'seconds'
+ return z
+
+$ carbonpython.py func.py mylib.dll
+...
+
+$ ipy
+IronPython 1.0 (1.0) on .NET 2.0.50727.42
+Copyright (c) Microsoft Corporation. All rights reserved.
+>>> import clr
+>>> clr.AddReferenceToFile('mylib.dll')
+>>>
+>>> import func
+>>> import mylib
+>>>
+>>> N = 10**7
+>>> print func.fn(N)
+7.770177 seconds
+2.000000858e+014
+>>> print mylib.fn(N)
+0.25608 seconds
+2.000000858e+014
+>>> 7.770177 / 0.25608
+30.3427717901
Added: pypy/extradoc/talk/ep2007/rpython-demo/func.py
==============================================================================
--- (empty file)
+++ pypy/extradoc/talk/ep2007/rpython-demo/func.py Wed Jul 4 21:13:15 2007
@@ -0,0 +1,14 @@
+from carbonpython import export
+import time
+
+ at export(int)
+def fn(N):
+ t1 = time.clock()
+ z = 0
+ for index in xrange(N):
+ x = 2.34+index
+ y = 3.45+index
+ z = (x*x)+(y*y)+index
+ t2 = time.clock()
+ print t2-t1, 'seconds'
+ return z
Modified: pypy/extradoc/talk/ep2007/rpython.txt
==============================================================================
--- pypy/extradoc/talk/ep2007/rpython.txt (original)
+++ pypy/extradoc/talk/ep2007/rpython.txt Wed Jul 4 21:13:15 2007
@@ -3,7 +3,7 @@
RPython: need for speed aka C and C# considered harmful
=======================================================
-:Authors: Antonio Cuni (xxx), Maciej Fijalkowski (merlinux GmbH)
+:Authors: Antonio Cuni (DISI), Maciej Fijalkowski (merlinux GmbH)
:Place: Europython 2007
:Date: XXX
@@ -108,12 +108,40 @@
The CLI backend
---------------
-XXX anto, feel free to fill
+* Produces assemblies for .NET (both Mono and CLR)
+
+* (Experimental) access to .NET libraries
+
+* As fast as C#
+
+* From 4 to 100 times faster than IronPython
+
+CarbonPython
+------------
+
+* **Highly** experimental
+
+* RPython --> .NET DLL
+
+* DLLs can be imported by C#, IronPython, ...
+
+* CarbonPython + IronPython = SteelPython :-)
+
+* Explicit definition of multiple entrypoints
+
+* Live demo
+
The JVM backend
---------------
-XXX anto, feel free to fill
+* Produces classes for the JVM
+
+* Shares a lot of code with the CLI backend
+
+* Not as mature as gencli
+
+
The JS backend
--------------
More information about the Pypy-commit
mailing list