Source code generation using Python
Roger Binns
rogerb at rogerbinns.com
Sun Dec 7 15:30:01 EST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
ats wrote:
> I want to generate 3 different versions of a C++ source code,
> basically injecting different flavours of inline assembler depending
> on target compiler/CPU.
Are you aware that there are also packages that let you generate and
call C code from Python on the fly? I find it most productive to write
my code in all Python first and to also develop a comprehensive test
suite. Then profile and replace selected portions with lower level C
code with the tests being able to confirm your code is correct.
Here are some packages that take an alternate approach:
http://www.cs.tut.fi/~ask/cinpy/
http://code.google.com/p/shedskin/
http://pyinline.sourceforge.net/
http://scipy.org/Weave
http://mdevan.nfshost.com/llvm-py/
I like LLVM the most.
Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkk8MkUACgkQmOOfHg372QRhsgCcCUzWHAHmjC1490yYba7c9Xrt
DxMAnj/Ur2GoJkQgMrx65hYEqPwKLdVV
=CvGB
-----END PGP SIGNATURE-----
More information about the Python-list
mailing list