Hi Kent,
> I thought I could mention the module we have created for inlining C/C+
> + code
> in Python.
>
> You can use it like this:
>
> from instant import inline
>
> add_func = inline("double add(double a, double b){ return a+b; }")
>
> print "The sum of 3 and 4.5 is ", add_func(3, 4.5)
>
>
> We combine this with the code-generation utilites in GiNaC/Swinginac
> to make sort of "Just-in-time compilation"
> of finite element python code. This is why I was curious about C code
> generation in sympy.
>
> It is a very small module created on top of SWIG. You can find it at
> www.fenics.org/instant.
Thanks for sharing this. One problem with SWIG is that the final
bingings are very bloated - there is the .so module and then there is
a python module on top of that. And classes are emulated in that
python module. Cython, on the other hand, creates just one nice C
file, which you compile to .so and that's it. So it's much faster and
very easy to debug - you just look into the generated C file to see
what's really happening (it's very readable).
Is there some example of your finite element code? I'd like to look at
that how you use instant in there.
Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---