Personal tools

Web/Comparison of Happstack, Snap and Yesod

From HaskellWiki

< Web(Difference between revisions)
Jump to: navigation, search
m (Happstack: fixed link to happstack.com, added link to hackage-server mirror on hub.darcs.net)
m (Stub of a feature overview grid)
Line 163: Line 163:
 
sys 0m21.809s</pre>
 
sys 0m21.809s</pre>
 
Installs with no problems as the guide suggests.
 
Installs with no problems as the guide suggests.
  +
  +
  +
== Features ==
  +
  +
{| class="wikitable"
  +
|-
  +
! &nbsp; !! Happstack !! Snap !! Yesod
  +
|-
  +
! Version Control
  +
| [http://hub.darcs.net/stepcut/happstack darcs]
  +
| [https://github.com/snapframework git]
  +
| [https://github.com/yesodweb git]
  +
|-
  +
! Routing Combinators
  +
| [http://www.happstack.com/docs/crashcourse/RouteFilters.html#route_filters yes]
  +
| yes
  +
| ?
  +
|-
  +
! Type-safe Routing
  +
| [http://www.happstack.com/docs/crashcourse/WebRoutes.html#web-routes web-routes] fully supported
  +
| no special support, but [https://github.com/stepcut/snap-web-routes-demo can integrate web-routes manually]
  +
| [http://www.yesodweb.com/book/routing-and-handlers template-haskell DSL]
  +
|-
  +
! Logic-free Templating
  +
| [http://www.happstack.com/docs/crashcourse/Templates.html#helloheist heist] supported
  +
| [http://snapframework.com/docs/tutorials/heist heist] fully supported and preferred
  +
| no special support
  +
|-
  +
! Embedded Templating
  +
| [http://www.happstack.com/docs/crashcourse/Templates.html#hello-hsp hsp] and [http://www.happstack.com/docs/crashcourse/Templates.html#helloblaze blaze-html] fully supported
  +
| can use blaze-html in heist splices, but discouraged
  +
| [http://www.yesodweb.com/book/shakespearean-templates hamlet] fully supported
  +
|-
  +
! JavaScript
  +
| jmacro
  +
| fay
  +
| julius
  +
|-
  +
! Form Processing
  +
| reform
  +
| digestive-functors
  +
| yesod-form
  +
|-
  +
! Authentication
  +
|-
  +
! Authorization
  +
|-
  +
! External Databases
  +
|-
  +
! Internal Databases
  +
|-
  +
! Sessions
  +
|-
  +
! Scaffolding
  +
|}

Revision as of 15:16, 8 October 2012

Note: Work in progress. I will outline planned sections in headings momentarily.

There is no existing complete comparison of Happstack, Snap and Yesod. Such a thing helps people to choose and feel they've made a well-founded decision.

Contents

1 The home page

I'll start with the web sites at first impression.

2 Maintainers

Next, the main maintainers of the projects is handy to know:

3 Communities

4 Documentation

There is roughly the same set of documentation for each, varying in side and detail, with a quickstart for each, more complete tutorials, and haddock API documentation.

5 Use Cases

It's interesting to know who is using these frameworks.

5.1 Happstack

5.2 Snap

  • hpaste ­— the Haskell pastebin.
  • Darcs Den — a place to share your darcs projects and collaborate with others.
  • housetab.org — a webapp for sharing expenses (source code here)
  • JCU — a web-based Prolog environment.
  • snap-pastie another pastebin.
  • snapframework.com the Snap home page.
  • Silk — a new way to create and consume content.
  • Karamaan Group — uses Snap for an internal company intranet.

5.3 Yesod

6 Repositories and Installation

I am running Ubuntu 10.04.

6.1 Happstack

Installed from the happstack package from Hackage, or can be retrieved via the patch-tag Darcs repository. Info from the Download page.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3
$ cabal --version
cabal-install version 0.10.2
using version 1.10.2.0 of the Cabal library 
$ cabal-dev install happstack
…
Registering happstack-6.0.5...

real    2m13.240s
user    1m38.886s
sys 0m7.588s

Installs fine in GHC 6.12.3 in a couple of minutes.

6.2 Snap

The web site Download page advises to install the snap package from Hackage:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3
$ cabal --version
cabal-install version 0.10.2
using version 1.10.2.0 of the Cabal library 
$ cabal-dev install snap
…
Registering snap-0.7...

real    5m1.105s
user    4m24.369s
sys 0m15.389s

Installs fine in GHC 6.12.3 in a couple of minutes.

6.3 Yesod

The web site advises to install the yesod package from Hackage.

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3
$ cabal --version
cabal-install version 0.10.2
using version 1.10.2.0 of the Cabal library 
$ time cabal-dev install yesod
Resolving dependencies...
cabal: cannot configure conduit-0.0.1.1. It requires base >=4.3 &&
<5 For the dependency on base >=4.3 && <5 there are these
packages: base-4.3.0.0, base-4.3.1.0, base-4.4.0.0 and
base-4.4.1.0. However none of them are available.

This was anticipated in the documentation, (“If you want to install yesod painlessly, get ghc >= 7.” from the install help wiki page. ) so the behaviour is expected.

chris@cn-done:~/yesod$ export PATH=/opt/ghc/7.0.4/bin/:$PATH
chris@cn-done:~/yesod$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.4
chris@cn-done:~/yesod$ cabal install Cabal cabal-install
--bindir=/opt/ghc/7.0.4/bin
…
Linking dist/build/cabal/cabal ...
Installing executable(s) in /opt/ghc/7.0.4/bin
chris@cn-done:~/yesod$ cabal --version
cabal-install version 0.10.2
using version 1.10.2.0 of the Cabal library 

So I'm now on 7.0.4 with the latest cabal installed for 7.0.4. Proceeding should work:

$ time cabal-dev install yesod
…
Registering yesod-0.9.4.1...

real    8m55.781s
user    7m2.446s
sys 0m21.809s

Installs with no problems as the guide suggests.


7 Features

  Happstack Snap Yesod
Version Control darcs git git
Routing Combinators yes yes  ?
Type-safe Routing web-routes fully supported no special support, but can integrate web-routes manually template-haskell DSL
Logic-free Templating heist supported heist fully supported and preferred no special support
Embedded Templating hsp and blaze-html fully supported can use blaze-html in heist splices, but discouraged hamlet fully supported
JavaScript jmacro fay julius
Form Processing reform digestive-functors yesod-form
Authentication
Authorization
External Databases
Internal Databases
Sessions
Scaffolding