Michael Geary wrote:
> You may be thinking of Pyrex, a Python dialect that compiles to C
> and lets you mix C and Python data types:
>
>Pyrex
>
> Pyrex is really quite nifty, especially for writing C extensions to
> Python and for wrapping existing C libraries. You can still code
> in Python or close to it, and let Pyrex write all the boilerplate C
> code for you. For performance critical algorithms, if you're using
> C types the generated code should be as fast as any other C code.
Phil Tomson wrote:
Kind of like Rubyinline
rubyinline | software projects | by ryan davis
Not really. RubyInline more closely resembles (surprise!) PyInline:
http://pyinline.sourceforge.net/
These are both ports of the Perl Inline module:
http://inline.perl.org/
Each of these lets you write C code inline in a quoted string, with
automatic hookups so you can call a C method from Python/Ruby/Perl.
Or C-Generator CGenerator
That one is interesting, and seems to be more ambitious: a mix of Ruby and
C.
Pyrex is different from any of those: you don't write any C code at all, but
do everything in Python (or near-Python) code which Pyrex compiles into C.
The Python code can use native C types, in which case it compiles into very
efficient C code.
> Psyco, OTOH, works with standard Python code. It's essentially
> a Just In Time compiler for Python:
>
>Psyco - Introduction
From what I've heard, though, it doesn't let you do certian things
that would be allowable in standard Python.
Yes, they have a few things listed on their bug page:
http://psyco.sourceforge.net/psycoguide/bugs.html#bugs
But the restrictions are pretty minor.
The nice thing about Psyco is that it doesn't require a C compiler at all,
unlike all the other solutions mentioned above.
Don't get me wrong, I like Ruby a lot. It seems to fit the way I think and
my taste in computer languages better than Python. So I'm glad to see that
Ruby is picking up these kinds of modules too.
-Mike