January 25, 2012
> I'm trying to reimplement the code as a separate tool in D using the Clang C bindings. So far it's not working out that well, there's not much documentation available.

Are the C bindings complete? I imagine they don't get that much attention.
January 25, 2012
The Json parsing I've initially attempted was a mistake. I've assumed the XML parsing would be harder than necessary, but I ended up fighting wxPhp's arbitrary Json output (arrays holding objects of different types.. which is no good for D, or my sanity).

Yesterday I've started working on xml parsing instead (using Vladimir Panteelev's xml library) and now I have a full script that parses wx doxygen files in pretty much the same way as the wxPhp script (although the syntax is much nicer to work with).

I'm now in the process of testing the entire output to verify that I've parsed the xml files correctly and loaded all the info in the same way as wxPhp's xml script (basically I'm going to do some printf diffs).

Once that is done I can begin working on porting the source_maker script (obviously I can skip the Json part altogether since I have the structures in memory already).
January 25, 2012
> Whats.necessary to use D in order to create C++ bindings ?

I forgot SWIG.
January 25, 2012
On 01/25/2012 12:44 PM, bls wrote:
> On 01/25/2012 10:01 AM, Zachary Lund wrote:
>> 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++.
>
> Thanks for the feedback.
> well, I think we have very different views.
>
> Unfortunately I am not a student anymore instead I am a unhappy tax payer.
> To fulfill my Job I need GUI,RIA(WEB), Database and XML(SOAP) support.
> To say the least. So pretty much everything D is not able to deliver
> atm. We are buying 3 party add ons in a few kilo bucks region and
> unfortunately we have to work with a Tool chain which is far away from
> being perfect.
> In other words the D language is already offering more than we
> need,could be an option, but the library situation is a disaster.
>
> wxWidgets. Do you really care about wrapped vs native library ?
> Do you think that the D community will ever be able to create a
> wxWidgets comparable native D lib. while not being able to spend some
> time in creating a binding generator ? I would be glad to have such
> bindings !
>
> My 2 cents.

You misunderstood or did not read my entire post. I claimed messing with C++ was not productive. I did not claim we couldn't or shouldn't wrap over a library and even suggested we use a modified version of GTK+ for such a thing.

I said writing a native D library was ideal. I did not say it was the most effecient method. I think working into playing with C++ libraries is asking for trouble and more man-time that it's worth. You seem to indicate that I meant otherwise.
January 26, 2012
On Wed, 25 Jan 2012 22:38:58 +0100
Andrej Mitrovic <andrej.mitrovich@gmail.com> wrote:

Hello Andrej,

> Yesterday I've started working on xml parsing instead (using Vladimir Panteelev's xml library) and now I have a full script that parses wx doxygen files in pretty much the same way as the wxPhp script (although the syntax is much nicer to work with).

You're my hero!!!

> I'm now in the process of testing the entire output to verify that I've parsed the xml files correctly and loaded all the info in the same way as wxPhp's xml script (basically I'm going to do some printf diffs).

I am swamped with some other work with these days, but when you'll have something to share, I'd like to help by, at least, some testing.

> Once that is done I can begin working on porting the source_maker script (obviously I can skip the Json part altogether since I have the structures in memory already).

Thanks to you, it looks as D community could get nice bindings to do real GUI programming, thank you very much.


Sincerely,
Gour


-- 
As fire is covered by smoke, as a mirror is covered by dust, or as the embryo is covered by the womb, the living entity is similarly covered by different degrees of this lust.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


January 26, 2012
On 2012-01-25 22:38, Trass3r wrote:
>> I'm trying to reimplement the code as a separate tool in D using the
>> Clang C bindings. So far it's not working out that well, there's not
>> much documentation available.
>
> Are the C bindings complete? I imagine they don't get that much attention.

It depends on what complete means. If you mean that you can do all the things you can do with the C++ API, then no. If you mean it's complete enough to implement this project, then I don't know. I think at least parts of the C bindings are added when someone needs it.

-- 
/Jacob Carlborg
January 26, 2012
>> Are the Clang C bindings complete? I imagine they don't get that much attention.
>
> It depends on what complete means. If you mean that you can do all the things you can do with the C++ API, then no. If you mean it's complete enough to implement this project, then I don't know. I think at least parts of the C bindings are added when someone needs it.

Well I know from the llvm bindings that they aren't complete and it's not hard to guess they don't pay that much attention to them.

Is it easy to use them? From what I've seen the llvm bindings don't quite follow the naming scheme of the C++ counterpart which makes it harder to find the appropriate functions.
January 26, 2012
On 2012-01-26 13:24, Trass3r wrote:
>>> Are the Clang C bindings complete? I imagine they don't get that much
>>> attention.
>>
>> It depends on what complete means. If you mean that you can do all the
>> things you can do with the C++ API, then no. If you mean it's complete
>> enough to implement this project, then I don't know. I think at least
>> parts of the C bindings are added when someone needs it.
>
> Well I know from the llvm bindings that they aren't complete and it's
> not hard to guess they don't pay that much attention to them.

I think they pay quite much attention to the bindings. I mean Apple uses it in Xcode  (at least I think it's the C bindings and not the C++ code) and the C bindings are much more API stable compared to the C++.

> Is it easy to use them? From what I've seen the llvm bindings don't
> quite follow the naming scheme of the C++ counterpart which makes it
> harder to find the appropriate functions.

It seems fairly straightforward, I've just started to use the bindings.
I'm not sure how the LLVM bindings work but these bindings for Clang are more of a C library built on top of the C++ code than actual bindings. You don't even link with the same library. Instead of linking to libclangSema, libclangAST and so on you just link to libclang.

-- 
/Jacob Carlborg
January 26, 2012
On 01/25/2012 01:38 PM, Andrej Mitrovic wrote:
> The Json parsing I've initially attempted was a mistake. I've assumed
> the XML parsing would be harder than necessary, but I ended up
> fighting wxPhp's arbitrary Json output (arrays holding objects of
> different types.. which is no good for D, or my sanity).
>
> Yesterday I've started working on xml parsing instead (using Vladimir
> Panteelev's xml library) and now I have a full script that parses wx
> doxygen files in pretty much the same way as the wxPhp script
> (although the syntax is much nicer to work with).
>
> I'm now in the process of testing the entire output to verify that
> I've parsed the xml files correctly and loaded all the info in the
> same way as wxPhp's xml script (basically I'm going to do some printf
> diffs).
>
> Once that is done I can begin working on porting the source_maker
> script (obviously I can skip the Json part altogether since I have the
> structures in memory already).

Andrej,
I can't await your SUCCESS message. For me your upcoming code is the most important stuff since years.
A few questions : where do I find Vladimir Panteelev's XML library ? Does this library support XPATH ?

Maybe it's too early but what do you think about replacing wxEvent with a D solution ?

I think about something similar to DGUI's event framework.  Same is valid for the wxWidgets sizer framework.

Enough now... Just want to say: Thanks man !
January 26, 2012
Sorry for my ignorance but why should one use DStep instead of htod in order to port plain vanilla C headers ? I have to admit that I haven't tried DStep yet.
Did you try DStep on libxml2, respective libxslt ?

TIA,
Bjoern