[pypy-dev] Using PyPy as a compiler

Hart's Antler bhartsho at yahoo.com
Sun Feb 6 14:31:37 CET 2005


Hi Holger,

I tried pyrexc in pypy/tool but i get the same error as with the normal pyrexc:
bash-2.05b# dist-pypy/pypy/tool/pyrexc test.pyx 
/root/imp/test.pyx:5:17: Declarator should be empty
/root/imp/test.pyx:5:17: Expected '>'

The pyrex generated code looks like this:
def hi():
  return hi__2ad67a3c()
cdef object hi__2ad67a3c():
  # untyped variables: v0 v13 v21 v3 v7
  v3 = <Function sys_stdout>()
  v7 = <Function print_item_to>('hello world', v3)
  v13 = <Function sys_stdout>()
  v21 = <Function print_newline_to>(v13)
  v0 = None
  return v0


which was generated from a function that looks like this:
def hi(): return 'hello world'

Cheers,
-brett

--- holger krekel <hpk at trillke.net> wrote:

> Hi Brett, 
> 
> On Sun, Feb 06, 2005 at 00:46 -0800, Hart's Antler wrote:
> > Hi, i am new to PyPy, i'm hoping someone can help me get started.
> > 
> > I want to use translator to turn some python code into a pyx files so that i can compile them
> and
> > later load them as modules in my program.  I did a simple test and i was able to get some
> pyrex
> > code from the translator, but when i saved that to a pyx file and called 'pyrexc mymodule.pyx'
> on
> > it there were errors.  I noticed there is a Pyrex folder (a Pyrex fork?) in the PyPy project,
> but
> > i'm not what to use in there to convert mymodule.pyx to a .c file so gcc can compile it.
> 
> The control flow at the lower level really likes jumping around 
> and thus we are using a slightly modified version of Pyrex which 
> supports GOTOs or rather generic "CINLINE" statement IIRC :-)   
> 
> You might try to use pypy/tool/pyrexc mymodule.pyx  which uses
> our modified versions of Pyrex. 
> 
> > btw, is todays current version in svn working?  I get alot of errors when calling
> > translator.view(), i'm doing the test.is_perfect_number tutorial.
> 
> ... 
> 
> > py.__impl__.process.cmdexec.ExecutionFailed: ExecutionFailed: 127  dot -Tplain
> > /tmp/usession-4/graph.dot>/tmp/usession-4/graph.plain
> > /bin/sh: line 1: dot: command not found
> 
> You need to install graphviz (available on most distributions) which 
> comes with the 'dot' commandline tool. Then this should nicely work. 
> 
> have fun, 
> 
>     holger
> 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail



More information about the Pypy-dev mailing list