[C++-sig] Re: Advanced (?) compiling, freezing, translating Python

Nicodemus nicodemus at esss.com.br
Sun Jan 4 18:59:34 CET 2004


Bob Ippolito wrote:

>
> On Jan 4, 2004, at 12:32 PM, Nicodemus wrote:
>
>> Have you really looked into Pyrex? Because it seems to have what you 
>> need: Although it can generate code that takes advantage of Python's 
>> dynamism, type declaration is possible, allowing it to generate 
>> direct C code... but I have never used, so I may be wrong.
>
>
> For whatever reason he says he can't depend on Python.  I'm pretty 
> sure that Pyrex (without modifications) won't produce "plain" C code, 
> and definitely not executables.  It will always produce Python 
> modules, even if you manage to write Pyrex code that doesn't really 
> use any Python features.


You are right. I guess one could kind of "hack" Pyrex (defining a main() 
function, for instance), but that would be some serious misuse of the tool.

> Unless he's programming in some tiny embedded environment, I think his 
> specifications are pretty bogus in the first place.  The language he 
> proposes would be neat to have, but I'd rather see effort go into PyPy 
> or something; which could theoretically do what he asks someday from 
> what I understand of their bootstrapping efforts.


Yes, and they're using a modified version of Pyrex to generate the C 
code. This version probably could be used as a starting point for the 
OP, but not without further customization.

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list