PyInline was Re: probs w/ building python extensions on free Microsoft.NET SDK

Paul Prescod paulp at ActiveState.com
Tue Aug 7 16:35:47 EDT 2001


Alex wrote:
> 
> To me, it seems like the biggest advantage to Inline is that it writes
> the wrapper code for you automatically.  I can't see a big advantage to
> having, say, C code stored in a .py file.  What does it get you?

I think that the advantage is conceptual simplicity. With inline, you
can "rewrite" a function in C without worrying about compilers, build
systems, distutils etc. 

> Having mixed languages in the one file is not a big advantage, I'd have
> thought pyperl would suffice for the perl inteface, and maybe a simple
> wrapper around SWIG would suffice for the C interface.

If you think it is simple, go to it! Surely the "difficulty" of
embedding C code into Python isn't the only thing stopping you.
Obviously that is trivial. The thing that takes effort is making the
whole thing seamless. You pick up a book on C, you rewrite a Python
function in C and everything just works. You're an instant extension
programmer. You don't have to write an interface file. You don't have to
write a makefile. You don't have to write the tedious per-module
boilerplate that takes up 90% of a simple extension module, etc.

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook




More information about the Python-list mailing list