Difference between revisions of "Web"

From HaskellWiki
Jump to navigation Jump to search
m (removing redundant space)
(Add list of options for web programming)
Line 1: Line 1:
 
[[Category:Web|*]]
 
[[Category:Web|*]]
 
{{Web infobox}}
 
{{Web infobox}}
{{Stub}}
 
{{Template:Formal under construction}}
 
   
The web development community in Haskell has recently had a large boost in activity, resulting in a plethora of choices in libraries. As usual, a breadth of options is a double edged sword: you can choose the tools more to your style, but it is harder to find quality tools. [[Web/Contributing|About contributing to the web development section]]
+
The web development community in Haskell has recently had a large boost in activity, resulting in a plethora of choices in libraries. As usual, a breadth of options is a double edged sword: you can choose the tools more to your style, but it is harder to find quality tools.
   
  +
Rather than one framework to rule them all, Haskell provides several options.
Choose from the menu on the right, which remains on all web-development-related pages.
 
  +
On this page we show a non-inclusive list of options to help the Haskell web programming newbie find which libraries and frameworks work together.
 
For those new to web programming in Haskell, a good start may be to peer over [[Web/Frameworks|the currently active frameworks]]; there are many, or to read the [[Web/Literature/Practical_web_programming_in_Haskell|tutorial on simple CGI programming]], which may not be the most sophisticated approaches to web development, but it is practical and easy to get going.
 
   
 
Please join us on [[Web/Forums_and_Discussion|the mailing lists]] to discuss web development in Haskell.
 
Please join us on [[Web/Forums_and_Discussion|the mailing lists]] to discuss web development in Haskell.
  +
  +
== Option 1: Happstack ==
  +
  +
[http://happstack.com/index.html Happstack] is a complete web framework. It contains an integrated HTTP server, a storage engine called macid, several templating options, and so on. Go look at the [http://happstack.com/index.html Happstack Home Page] for more information.
  +
  +
== Option 2: Snap + WAI + Yesod ==
  +
  +
[http://docs.yesodweb.com/book/wai/ WAI] and Hack are interfaces between web applications and HTTP servers. In this option, you code the applications that make up your website so that each application implements the WAI interface. So you might have a forum application, a blog application, and a wiki which each implement the WAI interface. Hack is another interface which is simpler to use that WAI but is not quite as powerful. Information about WAI and Hack can be found on Hackage: [http://hackage.haskell.org/package/wai WAI], [http://hackage.haskell.org/package/hack Hack].
  +
  +
[http://docs.yesodweb.com/ Yesod] is a collection of libraries which help you build applications which implement the WAI interface. This includes things like templating, a data persistence layer, building forms, and so on.
  +
A number of reusable web applications that implement the WAI interface can be found on hackage (''TODO: insert list'')
  +
  +
You would then use the [http://snapframework.com/ Snap] web server to combine together all the different WAI and Hack web applications, plus a library like [http://hackage.haskell.org/package/web-routes-quasi web-routes-quasi] or something similar to route URLs to the various applications.
  +
  +
== Option 3: (Fast)CGI + WAI + Yesod ==
  +
  +
This option is similar to Option 2 except we use a webserver like [http://nginx.org/ nginx], [http://www.lighttpd.net/ lighttpd], or [http://www.apache.org/ Apache]. These servers would communicate with your web applications using CGI or FastCGI. See [http://hackage.haskell.org/package/wai-handler-fastcgi wai-handler-fastcgi] for a library which connects FastCGI with the WAI interface. A [http://www.google.co.uk/search?hl=en&as_sitesearch=hackage.haskell.org%2Fpackage&as_q=wai-handler search] for wai-handler shows the various options available. See the [http://docs.yesodweb.com/book/deploying/ deployment] chapter of the Yesod book to see how to configure the various servers and FastCGI to host WAI applications.
  +
  +
== Option 4: Turbinado ==
  +
  +
''TODO: Explain about Turbinado since I don't know anything about it right now''
  +
  +
== Option 5: Salvia ==
  +
  +
''TODO: Explain about Salvia''
  +
  +
== Option 6: Snap + custom code + libraries ==
  +
  +
In this option, you would write your website to directly use the [http://snapframework.com/ Snap] server. Instead of using an interface like WAI, you would receive requests and generate responses directly to the snap server. Look through the [http://snapframework.com/docs Snap documentation] to get started using this option.
  +
There are a plethora of libraries to help you:
  +
  +
* Snap's templating library called [http://snapframework.com/docs/tutorials/heist Heist], some other [[Web/Libraries/Templating|templating library]] or the [http://hackage.haskell.org/package/blaze-html Blaze HTML combinator library].
  +
* Some [[Web/Databases_and_Persistence|database Access or Persistence]] library.
  +
* The [[Formlets]] library for coding forms.
  +
* See [[Web/Libraries|Libraries]] for a list of some other helpful libraries.
  +
  +
== Option 7: (Fast)CGI + custom code + libraries ==
  +
  +
This is very similar to the previous option, but using CGI or FastCGI to talk to another web server. See this [[Web/Literature/Practical_web_programming_in_Haskell|tutorial on simple CGI programming]] for a simple example.
  +
  +
== Option 8 ==
  +
  +
Something not listed on this page. There are several web frameworks or libraries in various stages of development like [http://github.com/larrytheliquid/Lemmachine#readme Lemmachine], [http://haskell.on-a-horse.org/ Haskell on a Horse], [http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mohws mohws], [http://hackage.haskell.org/package/loli loli], plus probably others which are not listed.

Revision as of 20:40, 8 October 2010

Haskell Web Development

Software:
Servers - Libraries - Frameworks
Deploy - Cloud
Interfaces to frameworks
Databases and Persistence
Testing and Verification
Content Management

Community & Research:
Forums and Discussion
Literature (research, talks and blogs)
Existing Haskell web applications
Ongoing projects and ideas

The web development community in Haskell has recently had a large boost in activity, resulting in a plethora of choices in libraries. As usual, a breadth of options is a double edged sword: you can choose the tools more to your style, but it is harder to find quality tools.

Rather than one framework to rule them all, Haskell provides several options. On this page we show a non-inclusive list of options to help the Haskell web programming newbie find which libraries and frameworks work together.

Please join us on the mailing lists to discuss web development in Haskell.

Option 1: Happstack

Happstack is a complete web framework. It contains an integrated HTTP server, a storage engine called macid, several templating options, and so on. Go look at the Happstack Home Page for more information.

Option 2: Snap + WAI + Yesod

WAI and Hack are interfaces between web applications and HTTP servers. In this option, you code the applications that make up your website so that each application implements the WAI interface. So you might have a forum application, a blog application, and a wiki which each implement the WAI interface. Hack is another interface which is simpler to use that WAI but is not quite as powerful. Information about WAI and Hack can be found on Hackage: WAI, Hack.

Yesod is a collection of libraries which help you build applications which implement the WAI interface. This includes things like templating, a data persistence layer, building forms, and so on. A number of reusable web applications that implement the WAI interface can be found on hackage (TODO: insert list)

You would then use the Snap web server to combine together all the different WAI and Hack web applications, plus a library like web-routes-quasi or something similar to route URLs to the various applications.

Option 3: (Fast)CGI + WAI + Yesod

This option is similar to Option 2 except we use a webserver like nginx, lighttpd, or Apache. These servers would communicate with your web applications using CGI or FastCGI. See wai-handler-fastcgi for a library which connects FastCGI with the WAI interface. A search for wai-handler shows the various options available. See the deployment chapter of the Yesod book to see how to configure the various servers and FastCGI to host WAI applications.

Option 4: Turbinado

TODO: Explain about Turbinado since I don't know anything about it right now

Option 5: Salvia

TODO: Explain about Salvia

Option 6: Snap + custom code + libraries

In this option, you would write your website to directly use the Snap server. Instead of using an interface like WAI, you would receive requests and generate responses directly to the snap server. Look through the Snap documentation to get started using this option. There are a plethora of libraries to help you:

Option 7: (Fast)CGI + custom code + libraries

This is very similar to the previous option, but using CGI or FastCGI to talk to another web server. See this tutorial on simple CGI programming for a simple example.

Option 8

Something not listed on this page. There are several web frameworks or libraries in various stages of development like Lemmachine, Haskell on a Horse, mohws, loli, plus probably others which are not listed.