On 01/25/2012 11:41 AM, bls wrote:
On 01/25/2012 09:07 AM, Trass3r wrote:
Whats.necessary to use D in order to create C++ bindings ?

github.com/jacob-carlborg/dstep

Quote "
DStep is a tool for converting C and Objective-C headers to D modules.
"
Well THAT'S nitty gritty :)

C++ as well ? How ? And maybe the most imp[ortant point when ?

Don't get me wrong Jacob. In case that dstep is working perfect for C++
hallelujah.

(I am nevertheless convinced that porting from XML output has several
advantages. Multi pass code generation.

Bjoern
---------------------------------------------------------------------
Slightly Off Topic DWT (Keinfarbton) f.i. was born on a idea of mine.
Frank and I have discussed the idea of using Java2XML (ANTLR based) to
generate D code )

I'm going to be rather straight forward on my opinion and, possibly, my ignorance. I think C (or any language with no symbol mangling) is an ideal language to create a library which is usable globally in almost any language. I think C++ libraries are an ideal language to create a library which is going to be used only within the C++ community because of it's ill symbol mangling system. There is no "right" way to work with C++ in D and although there are ways to interface with C++, I do not think that is the ideal situation.

That being said, libraries like wxWidgets are very large and have been acquired over several years of hardwork by a very large group. I do not think that a GUI toolkit library should have to bother with networking, sound, and so on. Also given the "standard" library D has, I think the GUI library D can provide should use Phobos extensively rather than its own mechanisms.

I think the ideal situation is to have a native D library. Creating binds to a C++ library is only a temporary solution and is not ideal both in implementation and in usage.

I do not mind using a C library in D because of how straight forward it is. But simply mentioning C++ in D seems to add unneeded complexity which should be avoided. I think the answer to a question such as "What's the alternative to Qt in D?" should not be "Qt bindings" but maybe a library which imitates the implementation and/or interface of Qt UI widgets in native D.

Another problem this causes is the seemingly unneccessary time needed to develop such libraries. I kinda regret saying this but using a C library in an OOP wrapper can be optimal and easy to work with. Perhaps adding to GTK+ as a C library for functionality that we want would be more ideal than trying to mess with C++.

I personally think the SIMD feature is much more important than trying to mess with C++.

Reply via email to