Pyd: Extending Python with D

Kirk McDonald kirklin.mcNOSPAMdonald at gNOSPAMmail.com
Mon Dec 18 00:13:33 CET 2006


This is not a release announcement per se, but I just got this library 
working on Linux, so I am prepared to show it to the Python community at 
large.

http://pyd.dsource.org/

Pyd is a library for the D programming language. It is analogous to 
Boost.Python. It wraps the Python/C API with a much cleaner interface, 
allowing you to directly expose your D functions and classes to Python, 
without touching the C API. See the website for some simple examples.

It's also pretty easy to build (it uses distutils for compilation) and 
compiles lightning fast (a strength of D's), at least compared to 
Boost.Python.

D, if you're unfamiliar with it, is a systems programming language. It 
aims to be a successor to C++. It is multi-paradigm, statically-typed 
(but has many type inference features), compiles to native machine code, 
uses single inheritance plus interfaces and mixins, and is garbage 
collected. Dynamic arrays and hash tables are built-in language 
constructs. It is link-compatible with C, but doesn't bother to be 
syntax compatible (although it does use a C-style syntax). Linking 
against C libraries (like the Python/C API) is a usually simple matter 
of re-writing the header files in D.

D is designed by Walter Bright, who has been writing C and C++ compilers 
for 20 years. D will be undergoing a 1.0 release on January 1st.

There are two implementations of D: The reference implementation, 
written by Walter Bright, which is called DMD 
(http://digitalmars.com/d/), and the open-source implementation, which 
is called GDC (http://dgcc.sourceforge.net/). The former has a Windows 
bias, and the latter has a Linux bias, although both mostly work on both.

It is my opinion, and the view of several others in the D community, 
that Python and D are a perfect fit for each other. With Pyd, it is very 
easy to code rapidly in Python, and drop into D when more speed is required.

Pyd is still a relatively new library. I started development on it in 
June, and I could count the current number of users on one hand. I also 
haven't done a proper release, as I am still rapidly adding features. 
For all that, I am insterested in what people think of it. The library's 
deficiencies won't become clear until people start using it.

-Kirk McDonald
http://pyd.dsource.org/


More information about the Python-announce-list mailing list