I'm giving up!
Here is what happened:
- I concluded that HaskellDB is, in fact, dead, or so barely alive that it won't be working well enough for my purposes any time soon.
- So I looked at Takusen, another high level DB library, instead. However, it doesn't seem to have a backend that will cope with MySQL.
- So I gave up on high level libraries, and investigated just using HSQL and HDBC. HDBC requires ODBC for accessing MySQL, which isn't ideal, and ODBC requires machine level configuration of connections, AFAIK, which I can't do on my budget host. So I tried HSQL instead, which I already had got to work.
- I got as far as cobbling together a binary that would do some database stuff and return a web page with the result, printing any exceptions if they occurred. It worked completely on my local box, but when I built it with the static flags, I got a bunch of ominous warnings (e.g. "warning: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking"). Sure enough, when I uploaded it to my host, I couldn't get anything out of it. My budget host couldn't actually show me the real error message or error logs, so I'm just going to presume I've been scuppered by the linking problem.
But although this project has been killed by a logistical problem, I'm actually fairly glad. I wasn't enjoying it much, mainly because half the libraries are in such a poor state. Once you know how to use them, they are great, but documentation is very patchy, and the project pages are all neglected. The best was HDBC, because at least that had a Wiki which encourages additions. Still, the only documentation it had was API documentation (really not good for getting started with, and it is usually really patchy anyway), and links to some programs that use the library.
I guess I've been spoilt by Django -- picking it up was rewarding and fun from the beginning. Since I was doing this Haskell project just for fun, the fun-killers were project-killers. I think this is a problem in general with Haskell -- until you get a critical mass of developers who have worked on these things and are still working on them, writing tutorials, hanging out on IRC for the sake of the newbies etc, things are just not going to take off. And the problem is that none of these things are particularly fun either, especially if you are an expert Haskell coder -- I imagine it is much more satisfying to be off writing Soduko solvers in Haskell's type system than getting hs-plugins to work with GHC 6.6 on Linux, or whatever.
Well, that concludes this little project. I didn't succeed, and unfortunately I didn't have much fun either. The former was caused by the latter.
Comments §
http://lukeplant.me.uk/blog.php?id=1107301667
I also do have some features that are made much easier with a relational data store -- including RSS feeds and categories etc. Removing these features is not an option, and it wouldn't be much fun to produce a less functional bit of software as the result of a rewrite.
Shae: I may be getting a new web host, in which case that might be an option. It would completely change the scope of my original project.
Maybe I was just being too ambitious with developing against a set of requirements that are not playing to Haskell's strengths. But I do think that if Haskell is going to be more popular as a general purpose programming language, it needs to be playing the same game as the other languages, and able to compete on their territory (web apps, SQL databases).
I've been silently following this series hoping you'd figure out the database connectivety problem so that I wouldn't have to :P
I've seen HAppS mentioned in various places aswell, but haven't taken a peek. If it has database connectivety like django or RoR, then thats awsome, though I fear it'll probably need some kind of driver, like HSQL.
Also, Happs seem to suffer even more in the documentation department. And AFAIK, it doesn't do external databases, but effectively has its own built in implementation. This is great until you decide you don't want to use Happs anymore.
I guess the answer would be "why should I?" I can use C, Java, C#, Smalltalk, Ruby, Python, Perl etc they do provide that for me for free....
Regards
Friedrich
I'm struggling to get HDBC-sqlite3 to work, though, even on my local box, and I can't get it to compile to a completely static binary either. If I make some progress, I may resurrect this project.
If you do resurrect this project, and succeed using *any* database solution, please ping me!
I've learned a lot of Haskell this year, and I love the logical expressive power (being a logician/mathematician by training) but the main thing I've learned (being a programmer by trade) is that only a dozen or so people are working on improving the Haskell library and toolset ecosystem, which is an order-of-magnitude too small for Haskell to be useful to anyone who is trying to *build a real-world application* and not simply demo a conceptually amazing in Haskell.
I often think to myself, should I go in for a Masters/PhD program, and earn my thesis by writing some basic ompatibility libraries and usability tools? Is that how progress will come?