Personal tools

Web

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Added persistent)
(Added Yesod.)
Line 66: Line 66:
   
 
[http://docs.yesodweb.com/persistent/ Documentation]. [http://docs.yesodweb.com/persistent/synopsis.html Sample]. Dependencies: Hamlet and web-routes-quasi (only for convenience instances).
 
[http://docs.yesodweb.com/persistent/ Documentation]. [http://docs.yesodweb.com/persistent/synopsis.html Sample]. Dependencies: Hamlet and web-routes-quasi (only for convenience instances).
  +
  +
=== Frameworks ===
  +
  +
==== Yesod ====
  +
  +
Current version [http://hackage.haskell.org/package/yesod Yesod 0.3.0]. Released: June 22, 2010.
  +
  +
Yesod is designed for RESTful, type-safe, performant web apps. By leveraging quasi-quotation for the more boilerplate tasks, we get concise web apps with high levels of type safety. Its Hamlet templates are compile-time checked for correctness, and the controller (web-routes-quasi) uses type-safe URLs to make certain you are only generating valid URLs. It loosely follows Model/View/Controller principles.
  +
  +
[http://docs.yesodweb.com/yesod/ Documentation]. [http://docs.yesodweb.com/yesod/helloworld.html Hello world sample]. Dependencies: Persistent (model), Hamlet (view), web-routes-quasi (controller), clientsession, authenticate.
   
 
== Old Content ==
 
== Old Content ==

Revision as of 07:32, 23 June 2010


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.

This document is meant to be an up-to-date listing of different libraries available to perform various tasks related to web development. We want to strike a balance here between enough information to make an informed decision, while keeping a good signal-to-noise ratio. As such, for editors, please try to include the following information on each library:

  • Name
  • Most recent version, and release date
  • Link to the code (either Hackage, or elsewhere if not on Hackage)
  • A short summary of what the library does. In particular, what makes this library different than others
  • Links to more documentation. If there are lots of links, consider creating a separate Wiki page for those links, so as not to clutter this page.
  • Links to sample code. Both short snippets and full-scale applications are welcome. Again, create a separate Wiki page as necessary.
  • Dependencies on other packages. For example, a web framework should list its choice of templating system, server, etc.

Contents

1 Libraries

1.1 Interfaces

Interfaces provide an abstraction between servers and applications, allowing different servers to be swapped easily.

1.1.1 Hack

Current version: Hack 2009.10.30. Released: October 30, 2009.

Hack is a simple interface for applications. Based on Ruby's Rack, it presents a very low barrier to entry. Unlike WAI, it uses lazy bytestrings for request and response bodies, making it easier to use for some. Many backends are available, for numerous backends; simply search hackage for "hack-handler-".

Samples: None.

Dependencies: None.

1.1.2 WAI (Web Application Interface)

Current version: WAI 0.1.0. Released: May 21, 2010.

The WAI is designed to be a type-safe and performant interface. Type safety is achieved by having data types such as RequestHeader, ResponseHeader, HttpVersion, as opposed to simply using Strings or ByteStrings. Performance is achieved by using an enumerator interface, allowing constant-space response construction without needing lazy I/O. Backends available are currently a simple server, CGI and FastCGI. There is also a Snap Framework backend in the works, waiting on some API changes in Snap.

Samples: Basic sample application

Dependencies: None

1.2 Servers

TODO: Information on Happstack, Snap, others.

1.3 Templating

1.3.1 Hamlet

Current version: Hamlet 0.3.1. Released: June 21, 2010

Hamlet's main goal is to provide you with fully type-safe templates. It uses Haskell's quasi-quoting facilities so that everything is checked at compile time. Unlike using an HTML combinator library, it uses a more intuitive syntax for defining your templates: a Haml-inspired syntax to be precise. It also has support for type-safe URLs, and achieves very high performance by being based on BlazeHtml and performing compile-time optmizations.

Documentation. Sample. Dependencies: BlazeHtml.

1.3.2 TODO

HStringTemplate, HSP, Heist

1.4 Persistence

1.4.1 Persistent

Current version Persistent 0.0.0. Released: June 22, 2010.

Persistent is a high-level, non-relational, type-safe persistence layer for Haskell. Its design allows it to be used on both SQL and non-SQL backends. Heavy usage of type families allows strong type guarantees, while usage of template haskell removes the need for boilerplate coding.

Documentation. Sample. Dependencies: Hamlet and web-routes-quasi (only for convenience instances).

1.5 Frameworks

1.5.1 Yesod

Current version Yesod 0.3.0. Released: June 22, 2010.

Yesod is designed for RESTful, type-safe, performant web apps. By leveraging quasi-quotation for the more boilerplate tasks, we get concise web apps with high levels of type safety. Its Hamlet templates are compile-time checked for correctness, and the controller (web-routes-quasi) uses type-safe URLs to make certain you are only generating valid URLs. It loosely follows Model/View/Controller principles.

Documentation. Hello world sample. Dependencies: Persistent (model), Hamlet (view), web-routes-quasi (controller), clientsession, authenticate.

2 Old Content

2.1 Wiki pages


2.2 External links