Pyd vs. Boost.Python

(This page is still being filled out, mostly because I am still adding features to Pyd. I am open to suggestions for additions to this page.)

Boost.Python is a C++ library which fills much the same role that Pyd does for D. The two libraries are far from identical, however. Pyd has a number of advantages over Boost.Python, and Boost.Python has a few features that Pyd lacks. Here are some of the differences.

Advantages of Pyd

Pyd builds faster than Boost.Python. C++, especially when using the Boost libraries, is notorious for long compilation times (sometimes in the range of hours). D, on the other hand, is gaining a reputation for very fast compilation times. Pyd builds extremely quickly (usually in mere seconds).

Pyd runs faster than Boost.Python. I have yet to directly compare the runtime performance of Pyd and Boost.Python, but Pyd manages to do most of the work involved with exposing functions at compile-time. I am confident that Pyd has a reduced runtime overhead compared to Boost.Python.

Pyd directly supports default arguments. Pyd operates on function aliases rather than function pointers. Therefore, it can call a function and take advantage of its default arguments directly, without generating a set of wrapper functions like Boost.Python has to.

Pyd can do more automatically than Boost.Python can. Pyd can automatically derive the names of functions and classes, can automatically detect how many default arguments a function has, and can automatically wrap all of the operator overloads in a class.

Advantages of Boost.Python

Boost.Python supports function overloading better than Pyd. You can wrap multiple C++ functions under the same name with Boost.Python. Pyd does not support this, as it operates on a slightly lower level than Boost.Python. (Python does not directly support this, so Pyd doesn't, either.) Pyd must expose different function overloads as different Python functions, with different names.

Pyd cannot support default member function arguments. This is a limitation of D. D does not directly support pointers-to-member-functions, preferring the more general concept of delegates. This means that there is no way to directly call an alias of a member function in D.