hi there,

say I have a set of C++ libraries for which python bindings have already been 
generated (with Reflex [1])
using these bindings is quite easy but then users complain that their code is 
slower than in C++ (d'oh!)

so I was playing with the idea to use python+reflex introspections 
capabilities to automatically generate a cython module out of some python 
code:

##
def do_silly_stuff():
  import ROOT
  h = ROOT.THistogram(...)
  for i in xrange(100):
   h.Fill(ROOT.TRandom())
  return h

(ROOT is the python module which gives access to these C++ libraries.)

my goal is to bypass the python wrapper and call directly into either the C++ 
function/method or its C-stub equivalent.

I see 2 ways:
 - automatically generate a .pyx/.pxd file containing the definition of the 
wrapped classes and stuff
 - tab into the cython parser to help him recognise that ROOT.THistogram is a 
C++ statement and that there is no need to go through the python C-api or any 
other mambo-jumbo...

any advice on how to achieve that ? (which way is simpler and faster to be 
done, code to start with,...)

cheers,
sebastien.

[1] http://root.cern.ch/drupal/content/reflex
-- 
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to