Web Authoring System Haskell (WASH)
WASH is a family of embedded domain specific languages (EDSL) for
programming Web applications. Each language is embedded in the
functional language
Haskell, which means that it is
implemented as a combinator library.
Currently, WASH has the following components
-
wash2hs, a preprocessor for including
literal XHTML fragments in the style of Haskell Server Pages
(HSP)
See here
for an explanation of the syntax.
-
WASH/CGI for server-side web scripting
-
WASH/HTML for dynamic generation of HTML and XHTML
-
WASH/Mail for email processing
-
WSP, a server supporting Wash Server Pages
-
WASH/DB, a transactional interface to
SQL databases
-
DBconnect, a simple interface to
PostgreSQL (deprecated)
which are described in more detail below.
WASH/CGI is an EDSL for server-side Web scripting with Sessions,
Compositional Forms, and Graphics. It features
- one program can implement entire sessions;
- the specification of an input field and the collection of the input from
this widget are tied together so that mismatches are not possible; the
external name of an input field does not matter;
- input fields are first-class entities; they may be typed and grouped to
compound input fields (compositionality); each group may be bound to a
callback action;
- first-class images as active input fields where each pixel of the image
can result in a different action;
- no explicit URLs need to be constructed in the script, except references
to external pages;
- compiled scripts are "relocatable"; they can be moved in the
directory hierarchy or to another server without change (provided
that it can execute at all on the other machine);
-
support for persistency through transactional variables. See
the
WASH.CGI.Transaction
module.
Resources
Installation (WASH AND GO)
(tested with GHC-6.6).
- Download the current release
- Create a new directory, say, build and untar the
file into it.
-
Follow the instructions in file INSTALL.
-
Check the online documentation.
WARNING: the graphics part has not been updated for a long time
and is likely to have problems
If you want graphics (module CGIGraphics) and you have
the same setup as my machine
(not that unlikely), all you have to do is create two directories
/tmp/REGISTRY and /tmp/Images. If the graphics
part still does not work, then consider the following hints.
An extended version of Simon Marlow's webserver (hws) that runs
WASH modules as servlets. WASH modules are compiled
transparently and dynamically loaded into the running
server. Each servlet runs in one of three modes: LogOnly (using
a log to reconstruct the current state like WASH's CGI
implementation), StateIDOnly (running a thread for each session
and continuing in the same thread with each form submission),
LogAndState (use a thread for efficiency and keep the log
for robustness).
Prerequisites
- WASH (from version 2.6)
-
hs-plugins (from version 0.9.10)
Installing
- Download the current pre-release
- WSP
(version 0.1.6 of 20060413)
- Create a new directory, say, build and untar the
file into it.
-
Type make.
- Edit myconfig.conf.
- Start the server using hws-dynamic -f
./myconfig.conf.
- Configure the server through the web configuration
interface at http://localhost:8080/console.
- Example scripts for uploading into the server may be found
in the subdirectory scripts.
- main module CGICounter, main symbol mainCGI
- main module HelloWorld, main symbol mainCGI
WASHDB provides an API for accessing a relational database using
a transactional interface (inspired by Software Transactional
Memory). It relies on HDBC to provide database connectivity. It
is currently tested only with HDBC's PostgreSQL binding. See the
Reservation programs in the main directory for example
uses.
Installing
- Download the current pre-release
- WASH/DB
(version 0.2 of 20060608)
- TRANS/DB
(version 0.3.2 of 20060830) transactional database access
for Haskell, required by WASH/DB
- First for TRANS/DB and then for WASH/DB:
- Create a new directory, say, build and untar the
file into it.
-
Type make to build the library and the example programs.
- Type make install to install both (you may have
to edit the Makefile for the location of your CGI
directory).
- It's not integrated with WSP, yet. But it might work,
anyway. Please let me know.
WASH/HTML is an EDSL for generating dynamic HTML
documents. WASH/HTML combines flexibility and safety in a unique
way. On the one hand, the potential for generation and
parameterization of documents is virtually unlimited due to the
underlying functional programming language Haskell, which provides
programming and abstraction facilities. On the other hand, the
library guarantees well-formed and valid HTML,
even with higher-order templates.
These programs have been tested with Hugs98 using the Jan2001
beta release, compiled with setting NUM_INSTS
to
10000
(in src/prelude.h).
WASHMail is a collection of modules for
reading and processing Email. It is bundled with WashNGo.
DBconnect is a collection of modules for using PostgreSql
from Haskell programs. It is bundled with WashNGo.
Installation of DBCONNECT requires a number of
prerequisites.
If all this is properly installed, then the configure script
of WashNGo will find everything automatically.
Peter Thiemann
Last modified: Wed Aug 30 17:57:11 CEST 2006