All Unkept
Posted in: Haskell, Web development  —  20 August 2007

Haskell Blog Rewrite - Session 6

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 §

§ On 20 August 2007, Shae Erisson wrote:
238 The HAppS repos that will be released soon include a simple blog as a demo app, maybe that would be more fun?

§ On 20 August 2007, Doug L. wrote:
239 Seems like a weblog model is a fairly simple structure, that can (and often is) built directly on files in a filesystem. What made you fixate so strongly on using a database system, that it killed the whole project?

§ On 20 August 2007, luke wrote:
240 Doug: Some of my motivations for the rewrite are here:
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).

§ On 20 August 2007, Christian Vest Hansen wrote:
241 What a shame, Luke.

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.

§ On 21 August 2007, luke wrote:
243 Update from redditers: It looks like I'm wrong about HDBC and ODBC not being useful, but it might depend on what libraries are installed on my host. I'm also stuck with the same linking problem from my attempts.

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.


§ On 21 August 2007, Friedrich wrote:
245 Well you just learned one thing. Application development depends on a lot of things. Obviously database connectivity is not an area where Haskell is used that much. Now that means that it is used elsewhere. It does not mean of course one can not use Haskell with Databases, but it's probably not very rewarding to provide a nice library for that in the Haskell community. And it's of course a problem of effort and payments. Would you have paid for a decent DB library?

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

§ On 21 August 2007, Vagmi wrote:
246 Why dont you try Common Lisp. There are tons of libraries built on CLSQL. There are also projects like Lisp on Lines (similar to RoR) that might pique your interest.

§ On 21 August 2007, pierre wrote:
247 Why don't you consider SQLite? I think it's ideal solution for not-so-loaded blog. Also, it has great support in HDBC and doesn't require additional server software.

§ On 24 August 2007, luke wrote:
256 pierre: Hmm, that sounds like a pretty good idea. The number of writes per day is very low for my application, so database locking etc shouldn't be a problem.

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.

§ On 8 September 2007, Mike wrote:
262 Hi Luke,
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?

§ On 14 July 2008, luke wrote:
327 Update: http://lukeplant.me.uk/blog.php?id=1107301689

Add comment

Format:

  • Javascript has to be on to get past my spam protection, and cookies, and there is a delay, sorry for any inconvenience!
  • I reserve the right to moderate comments.