Weaving the Web with Haskell
For the past week or so, I've been wrestling with various bits of Haskell libraries trying to get an XML parser running under Windows. Each time I think I've resolved a problem, another pops up to take its place. So I felt it was a good time to stand back and review my goals and approach. Background I believe that Haskell has a number of characteristics that make it eminently suitable for prototyping and deploying a range of web technologies. My own interest is in the Semantic Web area, but I think Haskell could also be usefully applied to Web Services and other web applications, and (as a language) potentially stands up well against the likes of Java and Python. The Web is spawning a host of little (and not-so-little) languages, and Haskell seems to have the right features to handle these in a clean, principled fashion. This is my working premise. Contemporary web applications are largely based on XML and HTTP. So a prerequisite for widespread use of any language for Web applications is good XML and HTTP support. Given the right libraries, Haskell could make handling these aspects very straightforward. But there seems to be a lack. Requirements Ideally, I think that the following requirements should be satisfied: - full XML parser supporting all features of the current XML core and namespace specifications. - full HTTP support, including content negotiation, redirection, read/write, GET, HEAD, PUT, POST, etc. - available across all Haskell compilers on all platforms Practically, I think the following would be enough to make a big difference, and this is what I'm currently looking for: - XML support, not necessary validating, but accepting full XML syntax and supporting including internal entity definitions and substitution and XML namespaces. - capability to access the representation of a Web Resource using HTTP GET - supported uniformly by GHC and Hugs, on Linux and Windows platforms. Where I am I have been trying to use the HXML toolbox, because I understand it's the only XML parser for Haskell that supports XML namespaces. Unfortunately, it seems to be rather dependent on older versions of GHC (unless I'm missing something), which is making it more problematic to adopt than I had hoped. Other packages, such as HaXml, seem to be more portable but as far as I'm aware are missing key functionality (notably XML namespace support). Looking forward I shall plug away for a little while with HXML toolbox -- currently I'm stuck for an MD5 library module -- and it may be that, with a little help, I'll win through: if I get it running with Hugs under Windows, I'll consider that to be significant progress. But maybe I'm missing a trick: is there other software I should be considering to satisfy my goals? Constructive suggestions would be welcome. I'm anticipating that as the library infrastructure project settles, we'll see some effort to move more of this kind of support code into a common and generally usable function library. I hope I shall be able to contribute to such an outcome. I suggest that the XML and HTTP support I've mentioned would be a key enabler to allow Haskell to be more widely used for real-world projects as well as academic research into language design issues (which currently seems to be its strongest developer community interest). #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
Graham Klyne <gk@ninebynine.org> writes:
I have been trying to use the HXML toolbox, because I understand it's the only XML parser for Haskell that supports XML namespaces. Unfortunately, it seems to be rather dependent on older versions of GHC (unless I'm missing something), which is making it more problematic to adopt than I had hoped.
I may misunderstand you, but I successfully compiled the HXML Toolbox 3.01 with GHC-6.2 on Linux. It did need some tweaking, but nothing serious: if my memory serves me right the forkProcess function changed and the MD5 library was missing. I understand that you have a POpen replacement for Windows, so the rest should be easy... Feri.
At 19:23 28/01/04 +0100, Ferenc Wagner wrote:
Graham Klyne <gk@ninebynine.org> writes:
I have been trying to use the HXML toolbox, because I understand it's the only XML parser for Haskell that supports XML namespaces. Unfortunately, it seems to be rather dependent on older versions of GHC (unless I'm missing something), which is making it more problematic to adopt than I had hoped.
I may misunderstand you, but I successfully compiled the HXML Toolbox 3.01 with GHC-6.2 on Linux.
You understood me well.
It did need some tweaking, but nothing serious: if my memory serves me right the forkProcess function changed and the MD5 library was missing.
It's the "tweaking" that bogs me down... and in this case, it was the missing MD5 library that was holding me up (though I have since found a version of HTTP and compatible MD5 modules). I don't have time to dig into the inner workings of all the code I wish to use. I hope my comments come over as constructive rather than whingeing, but it seems that there are some configuration management difficulties with interdependent library code. I hope the library infrastructure project will help here, by providing a uniform structure into which modules can be slotted (and version-managed).
I understand that you have a POpen replacement for Windows, so the rest should be easy...
Well, for some value of "easy" ;-) I do now have a version of HXML Toolbox 3.01 that compiles the HUnitExample module using Hugs under Windows, and passes most (all but about 10) of the test cases. #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
Hi, Graham. As a Haskell newbie and a lurker on this list for about a month, I've e-watched your efforts with a great deal of interest. I came to Haskell for I believe exactly the same reason you're describing - please correct me if I'm misunderstanding - because I believe a robust, lazy, pure FP language has potentially kick*ss properties as a scripting language for Semantic Web applications based on distributed metadata. I'm nowhere near where you are with Haskell - even with some rusty bits of Lisp and Prolog in my background, I'm keeping plenty occupied just getting through the 'Gentle Intro' in the slices of time I can steal from other priorities. However, I'll continue to put what I can into this because the goal is so compelling and exciting. So, consider this a thank-you for your efforts and a big +1 for what you've expressed in terms of both the potential and the challenges in front of Haskell as an (especially Semantic) Web programming language. All the best, Michael Brian Orr
-----Original Message----- From: haskell-bounces@haskell.org [mailto:haskell-bounces@haskell.org] On Behalf Of Graham Klyne Sent: Wednesday, January 28, 2004 4:37 AM To: Haskell Mailing List Subject: [Haskell] Weaving the Web with Haskell
For the past week or so, I've been wrestling with various bits of Haskell libraries trying to get an XML parser running under Windows. Each time I think I've resolved a problem, another pops up to take its place. So I felt it was a good time to stand back and review my goals and approach.
Background
I believe that Haskell has a number of characteristics that make it eminently suitable for prototyping and deploying a range of web technologies. My own interest is in the Semantic Web area,
----( SNIP )------------------
HaXml doesn't explicitly handle namespaces, but they appear in the attribute name. I've used HaXml on Windows (actually, a subset of the modules) to implement a simple template engine that relies on an XML namespace to call functions in Haskell. So, for example <p hal:someFun="a b c"/> is converted into <p>output from some function called with the arguments a b and c</p> Andrew Graham Klyne said: [...]
hoped. Other packages, such as HaXml, seem to be more portable but as far as I'm aware are missing key functionality (notably XML namespace support). [...] -- personal web site: http://www.acooke.org/andrew personal mail list: http://www.acooke.org/andrew/compute.html
participants (5)
-
andrew cooke -
Ferenc Wagner -
Graham Klyne -
Graham Klyne -
Michael Brian Orr