[Haskell-cafe] web musing

Jason Dagit dagit at codersbase.com
Fri Jun 5 12:12:26 EDT 2009

On Fri, Jun 5, 2009 at 8:18 AM, Conor McBride <conor at strictlypositive.org>wrote:

> Comrades
> I'm in a perplexing situation and I'd like to appeal to the
> sages.
> I've never written anything other than static HTML in my life,
> and I'd like to make a wee web service: I've heard some
> abbreviations, but I don't really know what they mean.
> I've got a function (possibly the identity, possibly const "",
> who knows?)
>  assistant :: String -> String
> and I want to make a webpage with an edit box and a submit
> button. If I press the submit button with the edit box
> containing string s, I'd like the page to reload with the
> edit box reset to (assistant s).
> Will I need to ask systems support to let me install some
> haskelly sort of web server? Looks likely, I suppose.
> In general, what's an easy way to put a web front end on
> functionality implemented in Haskell?

Several of us cobbled together a web service version of lambdabot at one
point.  We used fast cgi plus apache on the unix side.  In the program we
used the fastcgi haskell bindings (I forget which package), and excuted
lambdabot as a subprocess and communicated over pipes, I think.  Then on the
web page side there was a bit of ajax that executed the cgi request and
spliced the value into the webpage.  It no longer works due to changes in
lambdabot, but all lambdabot knew was that it was running as a normal unix
process.  In a simpler world the code that used the cgi bindings could
directly import your assistant function.

I can try to dig up the sources if you want to see the code.  It was pretty
slick.  And I'd say the bottom line is, you just need (fast) cgi bindings
and you're good on any host where cgi is supported.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090605/1cf63caa/attachment.html

More information about the Haskell-Cafe mailing list