|
Sat
14
May '05
|
After playing with WordPress a little bit, I am now slightly exposed to PHP. Generating HTML code with PHP does not seem to be fun, from my point of view, as a researcher in the area of meta programming. The text based approach is so ugly, clumsy and error prone. The generated code is basically not readable to human being. It is also very hard to get different modules to work together well.
Anyway, this is an ugly approach. It would be nice to have a functional HTML library based on AST. And of course, the first thing that comes to my mind is writing Haskell data type definitions, smart constructors and a pretty printer. Thus we can probably write a blogging platform using Haskell :). But I am not sure yet how to interact with databases. I currently have no knowledge in database. We probably will end up with heavy use of IO monad.
For now, there are some pointers I might want to refer to later:
- A Prettier Printer by Phil Wadler.
- HaXML. Since HTML is an application of XML, we certainly want to generalize. HTML might need some tolerence in validity though.
- HXML. This looks like a drop-in replacement of HaXML.
I need more information on:
- How to run a Haskell program as a CGI.
- How to interact with MySQL or other databases.
- Interaction with the system and
IOin Haskell.