Eric Kow | 9 Apr 19:57 2009
Picon

autogenerating wxc from wxWidgets Doxygen output?

Hi everybody,

I've recently been thinking about ways we would make the wxhaskell
installation process less painful.

My desire is for the "cabal install" part of the process to be
completely painless.  Right now, the wxcore process is slow, complicated
and doesn't work for the user package database (which means you can't
just cabal install any old program that uses wxhaskell).  What I hope we
can do is to segregate all the slow and painful stuff into C land (using
standard stuff like autotools), keeping the Haskell-y bits nice and
smooth.  I think this will reduce the net pain because then people can
just think in terms of (1) installing all the backend stuff like
wxWidgets and (2) cabal install.

A second desire would be for us to get rid of our wxc code altogether
and move it to its own project?  WXC is shared by wxHaskell, wxOcaml and
wxEiffel, but we all have our own variants of the code.  There was a wxc
project, but it seems to have gone dead.  I've remarked on #wxwidgets
that it would be great if the wxWidgets team to take over the WXC
project so that it would be more actively maintained.

This is where Kevin Ollivier of wxWidgets pointed out something
interesting: in the current wxWidgets trunk, it should be possible to
automatically generate the C bindings from the Doxygen XML output.  In
fact, he has already done something similar for Python, metadata to
Python objects:

http://trac.wxwidgets.org/browser/wxWidgets/trunk/docs/doxygen/doxymlparser.py

(Continue reading)

Eric Kow | 9 Apr 20:18 2009
Picon

Re: autogenerating wxc from wxWidgets Doxygen output?

On Thu, Apr 09, 2009 at 18:57:29 +0100, Eric Kow wrote:
> This is where Kevin Ollivier of wxWidgets pointed out something
> interesting: in the current wxWidgets trunk, it should be possible to
> automatically generate the C bindings from the Doxygen XML output.  In
> fact, he has already done something similar for Python, metadata to
> Python objects:
> 
> http://trac.wxwidgets.org/browser/wxWidgets/trunk/docs/doxygen/doxymlparser.py

Following up on this, I did

  svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
  cd wxWidgets/doc/doxygen
  ./regen.sh
  python doxymlparser.py --report out/xml/classwx_button.xml

Attached is the XML file (input) and the output of this script.

Here is a small extract of the output:

  Class: wxButton
  Bases: wxControl
  Inlcudes: []
  Brief Description:

And...

  Method: SetLabel
  Return Type: void
  Params: [{u'type': u'const&', u'declname': u'label'}]
(Continue reading)

Eric Kow | 9 Apr 21:23 2009
Picon

Re: WX: linking to system libraries statically

Hi FFT,

I'm just CC'ing wxhaskell-users so they see this question.

Thanks!

On Thu, 9 Apr 2009 04:13:18 -0700, FFT wrote
> I noticed that even simple WX demos like "Layout" are linked
> dynamically against 59 libraries on Linux. This would make
> distributing the binaries a nightmare. Is there a simple way to make a
> (mostly) statically linked binary?

--

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Kevin Ollivier | 9 Apr 21:14 2009

Re: autogenerating wxc from wxWidgets Doxygen output?

Hi Eric,

On Apr 9, 2009, at 11:18 AM, Eric Kow wrote:

> On Thu, Apr 09, 2009 at 18:57:29 +0100, Eric Kow wrote:
>> This is where Kevin Ollivier of wxWidgets pointed out something
>> interesting: in the current wxWidgets trunk, it should be possible to
>> automatically generate the C bindings from the Doxygen XML output.   
>> In
>> fact, he has already done something similar for Python, metadata to
>> Python objects:
>>
>> http://trac.wxwidgets.org/browser/wxWidgets/trunk/docs/doxygen/doxymlparser.py
>
> Following up on this, I did
>
>  svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk  
> wxWidgets
>  cd wxWidgets/doc/doxygen
>  ./regen.sh
>  python doxymlparser.py --report out/xml/classwx_button.xml
>
> Attached is the XML file (input) and the output of this script.
>
> Here is a small extract of the output:
>
>  Class: wxButton
>  Bases: wxControl
>  Inlcudes: []
>  Brief Description:
(Continue reading)

Jason Dusek | 10 Apr 07:17 2009
Picon

Re: Re: WX: linking to system libraries statically

2009/04/09 FFT <fft1976 <at> gmail.com>:
> I noticed that even simple WX demos like "Layout" are linked
> dynamically against 59 libraries on Linux. This would make
> distributing the binaries a nightmare. Is there a simple way
> to make a (mostly) statically linked binary?

  I have had mixed success with `-static -optl-static` (as
  recommended in "Practical Web Programming in Haskell" page,
  for example). On Macs, it's hard to get it to work (have never
  bothered); on Linux, I remember I had to remove it on once
  occasion to get things to work across Ubuntu and Gentoo (had
  to do with differences in libc, I believe, but I did not
  retain notes).

  Maybe passing in the specific libs to the linker with `-optl`
  is the best bet?

--
Jason Dusek

 |...Practical Web Programming in Haskell...|
  http://www.haskell.org/haskellwiki/Practical_web_programming_in_Haskell#Compiling_and_running_web_applications
Mads Lindstrøm | 10 Apr 12:19 2009
Picon

Re: autogenerating wxc from wxWidgets Doxygen output?

Hi

Eric Kow wrote:
> I'm vaguely aware that our copy of wxc has some information which helps
> us keep track of the wxWidgets class hierarchy.  Presumably the same
> information could be autogenerated as well?  This sort of thing has been
> suggested before (people have mentioned SWIG).
> 

It seems that the SWIG team is in the process of making a C++ -> C
binding, see:

http://www.nabble.com/C%2B%2B-to-C-td22947590.html

It is still in development and I do not know if it is (will become)
usable for us.

Greetings,

Mads Lindstrøm

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
(Continue reading)

Mads Lindstrøm | 10 Apr 18:44 2009
Picon

Re: autogenerating wxc from wxWidgets Doxygen output?

Hi

Eric Kow wrote:

> On Thu, Apr 09, 2009 at 18:57:29 +0100, Eric Kow wrote:
> > This is where Kevin Ollivier of wxWidgets pointed out something
> > interesting: in the current wxWidgets trunk, it should be possible to
> > automatically generate the C bindings from the Doxygen XML output.  In
> > fact, he has already done something similar for Python, metadata to
> > Python objects:
> > 
> > http://trac.wxwidgets.org/browser/wxWidgets/trunk/docs/doxygen/doxymlparser.py
> 
> Following up on this, I did
> 
>   svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
>   cd wxWidgets/doc/doxygen
>   ./regen.sh
>   python doxymlparser.py --report out/xml/classwx_button.xml
>  
> Attached is the XML file (input) and the output of this script.
> 

I had a quick look at the output and it seems to have some shortcomings.

The output has only one constructor, whereas the input XML has two. Many
of the return types also seems missing. Eg. 

Method: GetLabel
Return Type: 
(Continue reading)

Eric Y. Kow | 11 Apr 00:51 2009
Picon

Re: autogenerating wxc from wxWidgets?Doxygen output?

Thanks, Kevin!

I'm just forwarding to wxhaskell-users in case Mads has a reply :-)

I'll note that in the body of my message, I only cut and paste a small
extract of the output.  Maybe this is what Mads was referring to?

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
From: Kevin Ollivier <kevino@...>
Subject: Re: [wxhaskell-users] autogenerating wxc from wxWidgets?Doxygen output?
Date: 2009-04-10 22:46:38 GMT

Hi Eric,

The return type bug should be fixed now if you update your script. However, I see both wxButton::wxButton constructors (one that takes no params, and one that takes several) in your output. Do you not see them?

Thanks,

Kevin

On Apr 10, 2009, at 2:01 PM, Eric Y. Kow wrote:

Hi Kevin,

Thought you might be interested in the attached reply

--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

Mads Lindstrøm | 11 Apr 01:57 2009
Picon

Re: autogenerating wxc from wxWidgets Doxygen output?

Hi

Eric Kow wrote:

> This is where Kevin Ollivier of wxWidgets pointed out something
> interesting: in the current wxWidgets trunk, it should be possible to
> automatically generate the C bindings from the Doxygen XML output.  In
> fact, he has already done something similar for Python, metadata to
> Python objects:

....

> 
> Now that wxHaskell 0.11 has been released with wxWidgets 2.8 support, is
> it time to take this back-end stuff more seriously?  It sounds like what
> one of us could do is hack up a quick XSLT sheet or something similar to
> produce the C bindings.  Maybe a HaXml program as a prototype?

I have never done any XSLT programming before (have done some XPath
though), but still thought I would give it a try. I have attached the
XSL program and the output.

The XSLT program is nowhere near finished, just a beginning to see if it
is a path worth pursuing. And to get feedback...

Besides the overly verbose syntax, I did not feel like XSLT were a good
match for the task. It was hard to factor out common patterns - aka. the
composability of XSLT seems poor. But this may just be my lack of
experience with XSLT. If I could have done something smarter I am all
ears.
(Continue reading)

Eric Y. Kow | 11 Apr 02:01 2009
Picon

Re: autogenerating wxc from wxWidgets Doxygen output?

On Sat, Apr 11, 2009 at 01:57:30 +0200, Mads Lindstrøm wrote:
> Besides the overly verbose syntax, I did not feel like XSLT were a good
> match for the task.

I realise you weren't talking about the syntax, but in case it plays a
role in this, there is always PXSL, which has significantly dampened my
dislike of all things XML
  http://community.moertel.com/pxsl/

PXSL also has some XSLT shortcuts which are handy...

> It was hard to factor out common patterns - aka. the
> composability of XSLT seems poor. But this may just be my lack of
> experience with XSLT. If I could have done something smarter I am all
> ears.

--

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
(Continue reading)


Gmane