?

Log in

No account? Create an account

boost.python vs. Pyrex - Journal of Omnifarious

Nov. 21st, 2006

06:45 pm - boost.python vs. Pyrex

Previous Entry Share Next Entry

Currently CAKE uses Boost.Python to link to the parts that are in C++. I would like to drop this because even though it is very convenient and easy to use Boost in general is a big beast and I don't like having the dependency. For example, it's currently making it pretty hard to work with Python2.5.

But I don't know of any good alternatives. There's Swig, but that's pretty ugly. I used that in the past and really didn't like it much. There's also Pyrex, but it doesn't handle C++ at all.

In particular, I have a cyrptographic PRNG I've implemented in Python that C++ code needs to be able to call. This looks pretty hard to accomplish in Pyrex, though it seems the nicest of the lot in many ways.

Does anybody have any recommendations?

Current Mood: [mood icon] annoyed

Comments:

From:rosencrantz319
Date:November 22nd, 2006 06:12 am (UTC)
(Link)
(Reply) (Thread)
[User Picture]
From:omnifarious
Date:November 22nd, 2006 06:15 am (UTC)

Re: Some one should make a what is your programing lanquage called...

(Link)

*chuckle* Follow the links! :-)

Python BTW, is named after Monty Python. :-)

(Reply) (Parent) (Thread)
From:hattifattener
Date:November 22nd, 2006 07:19 am (UTC)
(Link)
You could just do it "by hand". Of the languages I've used, Python has one of the cleaner, easier-to-use C interfaces.
(Reply) (Thread)
[User Picture]
From:omnifarious' OpenID account [omnifarious.org]
Date:November 23rd, 2006 07:06 am (UTC)
(Link)

I think that will be the approach I take. It has the fewest dependencies, and I think that's an important for this particular project.

(Reply) (Parent) (Thread)
From:procyon112
Date:November 22nd, 2006 10:25 pm (UTC)
(Link)
(Reply) (Thread)
[User Picture]
From:omnifarious
Date:November 23rd, 2006 07:19 am (UTC)

Stupid thing not putting in links if I use my OpenID

(Link)

Well, most of the guts of the PRNG are in C++ actually. I use Python for the very last step of splitting up the stream of random digits into the chunks being asked for. I need to use a very specific PRNG since one of the techniques used frequently in CAKE is to seed the PRNG with a specific value and then generate a string that's used for something else. This is from some recommendations in Practical Cryptography about how to handle padding issues for RSA.

(Reply) (Parent) (Thread)