too early for D2 and too late for D1

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Apr 17 12:05:16 PDT 2011


I'm not defending other languages, I'm recommending them. I'm also
recommending D when its appropriate. But nobody is forced to use just
one programming language. I use at least half a dozen languages
throughout my average week; C, C++, Python, Delphi (rarely), D, AHK,
batch (hehe, ok that one doesn't count :p), some ASM which I'm just
playing around with for now, and probably other languages.

Gour doesn't have to quit D, he can use some time-out for a while and
see what Python has to offer. In the meantime the D ecosystem will
likely grow.

Now, these arguments aside, onto the technical side of things. You
could build a GUI in Python and then link to D via callback functions.
It shouldn't be a problem with either Python's ctypes or Cython,
whichever might be easier to use. Python+Qt has been stable for a long
while now, so it's really not a bad choice as a GUI language. And it
has good documentation and books to learn from, and plenty of example
code too.

I'm not sure what that would do to performance (linking Python with
D), but then again I don't know what type of desktop app Gour is
building. On the other hand, I've seen Python being used in a realtime
app that is linked with C++. For example Ableton Live (a fairly
popular music sequencer) uses the Boost C++ Python binding for a big
part of their application. They use it to interface with various MIDI
and sequencing hardware, and various hardware manufacturers develop
their own Ableton-specific Python scripts that add support to their
special hardware so it works nicely in Ableton Live. I believe they
might also be using Python to run their GUI, but I can't be sure since
I've only heard that offhand from some people commenting about it.

Now, there's a Python binding project for D1, PyD, with exception
support and various other nice things. I don't know whether anyone
will work on a D2 version. But from looking at its source it doesn't
look *too* complicated. In fact there's a good part of that code seems
to be implementation of common functions which were missing in D1
Phobos, but are here in Phobos2. So maybe it wouldn't be too hard to
port that to D2 some day. But I don't know the details.


More information about the Digitalmars-d mailing list