Pyrex without Python (was Re: calling Pyrex results from C)

Jeff Epler jepler at unpythonic.net
Wed Jan 21 01:57:49 CET 2004


Perhaps I should take the advice given elsewhere to ask on a pyrex
mailing list, but I thought I'd try here first.

As I mentioned in another thread a few weeks ago, a current hobby is
writing code for small embedded processors, where "small" means 1k-4k
instructions and 128-1k bytes data.  C is a fine language for this as long
as you don't use FP arithmetic or much of the standard library.

I wish I could write my code in Pyrex, of course keeping to 'int8_t'
and 'int16_t' as only basic data types, but it inevitably makes Python
API calls.

How close to impossible would it be to make Pyrex emit Python-free code
if there are only 'cdefs'?  Are there any obvious gotchas in
Pyrex-generated code if 'int' is a 16-bit datatype?  Is there some
reason that large stack frames and/or calls to malloc() would be
unavoidable in Pyrex?

Jeff




More information about the Python-list mailing list