Haskell GUI on top of Xlib?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Haskell GUI on top of Xlib?

Dimitry Golubovsky-2
Do there exist Haskell graphics/UI toolkits implemented on top of the
X11 library (Xlib) without any intermediate C/C++ libraries (i. e. not
WxHaskell for example)?

I have a very low level client-side interface to the X11 protocol
implemented in pure Haskell (layout of protocol packets obtained from
Xlib header files preprocessed by HSFFIG). As of now, I can open a
display, build request packets manually and parse server responses (some
of, but this is just a matter of writing more parsers), so this is more
like a toolset for X11 protocol packets manipulations. I do not intend
to implement a full analog of Xlib in Haskell. Instead, it might be
interesting to create a "fully functional" GUI toolkit based on some
already existing high-level interface.

Any ideas will be appreciated.

Dimitry Golubovsky
Middletown, CT

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell GUI on top of Xlib?

Duncan Coutts
On Sat, 2005-11-26 at 00:17 -0500, Dimitry Golubovsky wrote:

> Do there exist Haskell graphics/UI toolkits implemented on top of the
> X11 library (Xlib) without any intermediate C/C++ libraries (i. e. not
> WxHaskell for example)?
>
> I have a very low level client-side interface to the X11 protocol
> implemented in pure Haskell (layout of protocol packets obtained from
> Xlib header files preprocessed by HSFFIG). As of now, I can open a
> display, build request packets manually and parse server responses (some
> of, but this is just a matter of writing more parsers), so this is more
> like a toolset for X11 protocol packets manipulations. I do not intend
> to implement a full analog of Xlib in Haskell. Instead, it might be
> interesting to create a "fully functional" GUI toolkit based on some
> already existing high-level interface.
>
> Any ideas will be appreciated.

Are you aware of the XCB library:
http://xcb.freedesktop.org/

It's a more modern client side X11 library. In particular they have a
good infrastructure for describing the X11 protocol packets using XML.
They use that to generate code in various languages for dealing with
those packets.

XCB is supposed to be simpler and more regular than Xlib and with less
historical cruft. It is also supposed to support multiple threads
properly (which is nearly impossible with Xlib).

Indeed they mention that Haskell would be an obvious target for this:

http://xcb.freedesktop.org/wiki/XCBToDo
(see bottom of that page: "XCB for other languages")

Duncan

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell GUI on top of Xlib?

Wolfgang Jeltsch
Am Samstag, 26. November 2005 12:08 schrieb Duncan Coutts:
> [...]

> http://xcb.freedesktop.org/wiki/XCBToDo
> (see bottom of that page: "XCB for other languages")

"A problem occurred in a Python script."

:-(

> Duncan

Best wishes,
Wolfgang
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell GUI on top of Xlib?

Dimitry Golubovsky-2
In reply to this post by Duncan Coutts
Thanks Duncan for this link: a very interesting reading.

Duncan Coutts wrote:

> Are you aware of the XCB library:
> http://xcb.freedesktop.org/
>


> Indeed they mention that Haskell would be an obvious target for this:
>
> http://xcb.freedesktop.org/wiki/XCBToDo

I haven't looked at their API closely, but it would not be a problem to
generate bindings using HSFFIG unless there are functions
taking/returning whole structures, or things like arrays of function
pointers which are not yet handled by HSFFIG reliably.

It might be worth trying to model their algorithms in Haskell though.
They send requests to server semi-lazily (i. e. when request's result is
needed, or eventually when the queue is flushed), and retrieve server
replies lazily (i. e. on demand).

But I am not ready to tell yet, would Haskell's natural laziness be
sufficient to implement that, or something involving mutable objects
needs to be built on top of the standard I/O stuff.

Dimitry Golubovsky
Middletown, CT


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell GUI on top of Xlib?

Thomas Hallgren-4
In reply to this post by Dimitry Golubovsky-2
Hi,

Dimitry Golubovsky wrote:

> Do there exist Haskell graphics/UI toolkits implemented on top of the
> X11 library (Xlib) without any intermediate C/C++ libraries (i. e. not
> WxHaskell for example)?

Fudgets is a GUI toolkit implemented in Haskell directly on top of Xlib:

    http://www.cs.chalmers.se/Fudgets/

Recent snapshots can be found at:

    http://www.cse.ogi.edu/~hallgren/untested/

--
Thomas Hallgren

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell GUI on top of Xlib?

Einar Karttunen
In reply to this post by Dimitry Golubovsky-2
On 26.11 22:00, Dimitry Golubovsky wrote:
> Thanks Duncan for this link: a very interesting reading.
>
> Duncan Coutts wrote:
>
> >Are you aware of the XCB library:
> >http://xcb.freedesktop.org/


I managed to parse the XCB XML protocol descriptions to
Haskell data structures, next I'll try to emit some
nice code from that. If it works well the end result
should be a pure Haskell X library.

- Einar Karttunen
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Haskell GUI on top of Xlib?

Dimitry Golubovsky-2
Einar,

Are you talking about packet handling level only (i. e. same as I have
now), or do you also have any of their transport algorithms (lazy
request sending/response retrieval) implemented?

Einar Karttunen wrote:
> I managed to parse the XCB XML protocol descriptions to
> Haskell data structures, next I'll try to emit some
> nice code from that. If it works well the end result
> should be a pure Haskell X library.


Dimitry

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe