Personal tools

Web/Comparison of Happstack, Snap and Yesod

From HaskellWiki

< Web(Difference between revisions)
Jump to: navigation, search
(Yesod: Added a bunch of use cases.)
m (Don't put "snap" in a yesod link -- better for scanning)
 
(37 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Still fixing the formatting broken stuff from conversion to wiki from markdown. I will outline planned sections in headings momentarily.
+
'''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.
 
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.
Line 7: Line 7:
 
I'll start with the web sites at first impression.
 
I'll start with the web sites at first impression.
   
* [http://happstack.com/index.html Happstack's web site] is simple and clean.
+
* [http://happstack.com/ Happstack's web site] is simple and clean.
 
* [http://snapframework.com/ Snap's web site] is pretty and professionally designed.
 
* [http://snapframework.com/ Snap's web site] is pretty and professionally designed.
 
* [http://www.yesodweb.com/ Yesod's web site] is okay, good links.
 
* [http://www.yesodweb.com/ Yesod's web site] is okay, good links.
Line 15: Line 15:
 
Next, the main maintainers of the projects is handy to know:
 
Next, the main maintainers of the projects is handy to know:
   
* Happstack — There is no link on the homepage about maintainers, but I garnered [http://www.n-heptane.com/ Jeremy Shaw], (Figured out from [http://www.haskellers.com/user/52 here], “Maintainer of Happstack, the Haskell web application framework: <http://www.happstack.com/>”) aka stepcut. I can't tell if there are any more maintainers, [http://patch-tag.com/r/mae/happstack/snapshots/all/history the darcs history] doesn't show any major contributors. A list of contributors, I suppose, can be seen [http://patch-tag.com/r/mae/happstack/home on the patch-tag homepage], I'm not going to bother trying to convert usernames to real names. (Lemmih, Saizan, alexjacobson, creighton, mightybyte, stepcut, tphyahoo.)
+
* Happstack — Happstack is currently maintained by [http://www.n-heptane.com/ Jeremy Shaw (aka stepcut)] with financial support from [http://seereason.com seereason.com]. Significant past (and present) contributors and maintainers include Alex Jacobson, Lemmih, Matthew Elder, Andrea Vezzosi (Saizan), Thomas Hartman, Gracjan Polak, Antoine Latter, Joachim Fasting, Facundo Domínguez, Caylee Hogg, Einar Karttunen, Shae Erisson (shapr), Ian Lynagh, and others.
 
* Snap — Many are listed as ‘contributors’ on [http://snapframework.com/about the about page], but [http://gregorycollins.net/ Gregory Collins] and [http://softwaresimply.blogspot.com/ Doug Beardsley] are certainly maintainers, the rest I'm not sure, may be just contributors; ([http://rfrn.org/~shu Shu-yu Guo], [http://james-sanders.com/ James Sanders], Carl Howells, Shane O'Brien, [http://github.com/ozataman Ozgun Ataman], [http://github.com/cdsmith Chris Smith], [https://github.com/norm2782 Jurriën Stutterheim].) the site doesn't distinguish.
 
* Snap — Many are listed as ‘contributors’ on [http://snapframework.com/about the about page], but [http://gregorycollins.net/ Gregory Collins] and [http://softwaresimply.blogspot.com/ Doug Beardsley] are certainly maintainers, the rest I'm not sure, may be just contributors; ([http://rfrn.org/~shu Shu-yu Guo], [http://james-sanders.com/ James Sanders], Carl Howells, Shane O'Brien, [http://github.com/ozataman Ozgun Ataman], [http://github.com/cdsmith Chris Smith], [https://github.com/norm2782 Jurriën Stutterheim].) the site doesn't distinguish.
 
* Yesod — [http://www.snoyman.com/ Michael Snoyman], [http://blog.gregweber.info/ Greg Weber], (Garnered from [http://www.yesodweb.com/page/contributors the contributors page], via Community.) there are other contributors listed, some of which might be maintainers. (Felipe Lessa, [http://pbrisbin.com/ Patrick Brisbin], [https://github.com/luite Luite Stegeman], [http://konn.x0.com/ Hiromi ISHII], [http://www.mew.org/~kazu/ Kazu Yamamoto]. See the page for past contributors.)
 
* Yesod — [http://www.snoyman.com/ Michael Snoyman], [http://blog.gregweber.info/ Greg Weber], (Garnered from [http://www.yesodweb.com/page/contributors the contributors page], via Community.) there are other contributors listed, some of which might be maintainers. (Felipe Lessa, [http://pbrisbin.com/ Patrick Brisbin], [https://github.com/luite Luite Stegeman], [http://konn.x0.com/ Hiromi ISHII], [http://www.mew.org/~kazu/ Kazu Yamamoto]. See the page for past contributors.)
Line 21: Line 21:
 
== Communities ==
 
== Communities ==
   
* Happstack — Garnered from [http://happstack.com/community the Community page], [http://groups.google.com/group/HAppS the HappS mailing list], #happs on Freenode IRC, [http://happstack.com/irc-logs/ with IRC logs], [http://code.google.com/p/happstack/issues/list Google Code] for issue tracking, [http://code.google.com/p/happstack/w/list a wiki], [http://www.twitter.com/happstack Twitter], a [http://www.facebook.com/happstack Facebook group].
+
* Happstack — Garnered from [http://happstack.com/community the Community page], [http://groups.google.com/group/HAppS the HappS mailing list], #happs on Freenode IRC, [http://happstack.com/irc-logs/ with IRC logs], [http://code.google.com/p/happstack/issues/list Google Code] for issue tracking, [http://code.google.com/p/happstack/w/list a wiki], [http://www.twitter.com/happstack Twitter], a [http://www.facebook.com/happstack Facebook group], and the [http://stackoverflow.com/questions/tagged/happstack happstack tag on StackOverflow].
 
* Snap — Garnered from the [http://snapframework.com/about About page], [http://mailman-mail5.webfaction.com/listinfo/snap the Snap mailing list] #snapframework on Freenode IRC, [https://github.com/snapframework/snap-core/issues Github] for issue tracking.
 
* Snap — Garnered from the [http://snapframework.com/about About page], [http://mailman-mail5.webfaction.com/listinfo/snap the Snap mailing list] #snapframework on Freenode IRC, [https://github.com/snapframework/snap-core/issues Github] for issue tracking.
 
* Yesod — Garnered from the [http://www.yesodweb.com/page/community Community Resources], [http://stackoverflow.com/questions/tagged/yesod StackOverflow], a [http://groups.google.com/group/yesodweb?pli=1 Google Group], [http://www.haskell.org/mailman/listinfo/web-devel the web-devel mailing list], (Which, due to the large proportion of Yesod-related questions, has essentially become ‘yesod-devel’.) #yesod on Freenode IRC, [https://github.com/yesodweb/yesod/issues Github] for issue tracking, a [http://www.yesodweb.com/wiki wiki] for posting documentation.
 
* Yesod — Garnered from the [http://www.yesodweb.com/page/community Community Resources], [http://stackoverflow.com/questions/tagged/yesod StackOverflow], a [http://groups.google.com/group/yesodweb?pli=1 Google Group], [http://www.haskell.org/mailman/listinfo/web-devel the web-devel mailing list], (Which, due to the large proportion of Yesod-related questions, has essentially become ‘yesod-devel’.) #yesod on Freenode IRC, [https://github.com/yesodweb/yesod/issues Github] for issue tracking, a [http://www.yesodweb.com/wiki wiki] for posting documentation.
Line 31: Line 31:
 
* Happstack — [http://happstack.com/docs/happstack-lite/happstack-lite.html A small tutorial] covering writing a simple program, a larger [http://happstack.com/docs/crashcourse/index.html crash course] cover routing, templating, request handling, static files and database state, and examples. And [http://happstack.com/docs/6.0.0/index.html haddock docs.]
 
* Happstack — [http://happstack.com/docs/happstack-lite/happstack-lite.html A small tutorial] covering writing a simple program, a larger [http://happstack.com/docs/crashcourse/index.html crash course] cover routing, templating, request handling, static files and database state, and examples. And [http://happstack.com/docs/6.0.0/index.html haddock docs.]
 
* Snap — [http://snapframework.com/docs/quickstart A simple quickstart guide], a [http://snapframework.com/docs/tutorials/snap-api slightly larger tutorial similar to happstack's], a [http://snapframework.com/docs/tutorials/snaplets-tutorial tutorial on snaplets (Snap's means of extension)], a tutorial on [http://snapframework.com/docs/tutorials/heist/ heist (Snap's templating)] and [http://hackage.haskell.org/packages/archive/snap/0.7/doc/html/Snap.html haddock docs].
 
* Snap — [http://snapframework.com/docs/quickstart A simple quickstart guide], a [http://snapframework.com/docs/tutorials/snap-api slightly larger tutorial similar to happstack's], a [http://snapframework.com/docs/tutorials/snaplets-tutorial tutorial on snaplets (Snap's means of extension)], a tutorial on [http://snapframework.com/docs/tutorials/heist/ heist (Snap's templating)] and [http://hackage.haskell.org/packages/archive/snap/0.7/doc/html/Snap.html haddock docs].
* Yesod — a [http://www.yesodweb.com/page/five-minutes simple quickstart guide similar to Snap's], [http://www.yesodweb.com/page/screencasts screencasts], an online [http://www.yesodweb.com/book book] similar to Happstack's crash course, covering templates, widgets, routing, forms, sessions, databases, deployment, authentication, scaffolding, internationalisation, and examples. And [http://www.yesodweb.com/wiki/API%20Documentation haddock docs].
+
* Yesod — a [http://www.yesodweb.com/page/five-minutes simple quickstart guide] similar to Snap's, [http://www.yesodweb.com/page/screencasts screencasts], an online [http://www.yesodweb.com/book book] similar to Happstack's crash course, covering templates, widgets, routing, forms, sessions, databases, deployment, authentication, scaffolding, internationalisation, and examples. And [http://www.yesodweb.com/wiki/API%20Documentation haddock docs].
   
 
== Use Cases ==
 
== Use Cases ==
Line 39: Line 39:
 
=== Happstack ===
 
=== Happstack ===
   
* [http://cogracenotes.wordpress.com/2010/08/08/hackage-on-sparky/ Matt Gruen] used Happstack to create Hackage 2.0.
+
* [http://cogracenotes.wordpress.com/2010/08/08/hackage-on-sparky/ Matt Gruen] used Happstack to create [http://hub.darcs.net/simon/hackage-server Hackage 2.0].
* [http://happstack.com/index.html The Happstack homepage] is written with Happstack.
+
* [http://happstack.com/ The Happstack homepage] is written with Happstack.
 
* [http://www.creativeprompts.com/ Creative Prompts] — A site for exchanging story ideas -- which was developed but never got around to promoting.
 
* [http://www.creativeprompts.com/ Creative Prompts] — A site for exchanging story ideas -- which was developed but never got around to promoting.
 
* [http://www.seereason.com See Reason] — A site which allows you to construct and prove arguments using first order logic. This site is in public beta.
 
* [http://www.seereason.com See Reason] — A site which allows you to construct and prove arguments using first order logic. This site is in public beta.
 
* [http://src.seereason.com/examples/happstack-imageboard/ A (4chan clone) image board] (not running anywhere).
 
* [http://src.seereason.com/examples/happstack-imageboard/ A (4chan clone) image board] (not running anywhere).
 
* [https://github.com/jgm/gitit Gitit] is a Happstack wiki app.
 
* [https://github.com/jgm/gitit Gitit] is a Happstack wiki app.
  +
* [http://patch-tag.com/r/tphyahoo/patch-tag-public/home Patch-Tag] provides hosting for Darcs repositories and Gitit wikis.
  +
* [http://npaste.de/ npaste.de] Happstack + PostgreSQL pastebin with [https://github.com/mcmaniac/npaste.de src on github]
  +
* [http://substack.net/ Personal site of James Halliday] with [https://github.com/substack/slackstack src on github]
  +
* [https://github.com/rostayob/reskell reskell] a hacker news clone
  +
* [http://noscrolls.com/ noscolls.com] a website for tracking CrossFit workout results
  +
* [http://www.silkapp.com/ Silk] — a new way to create and consume content. (runs a mixture of Ruby, Happstack, and Snap)
  +
* [http://www.atikteam.com/ AtikTeam] - an online software for project management and teamwork.
   
 
=== Snap ===
 
=== Snap ===
Line 52: Line 59:
 
* [http://housetab.org/ housetab.org] — a webapp for sharing expenses (source code here)
 
* [http://housetab.org/ housetab.org] — a webapp for sharing expenses (source code here)
 
* [https://github.com/norm2782/JCU JCU] — a web-based Prolog environment.
 
* [https://github.com/norm2782/JCU JCU] — a web-based Prolog environment.
* [https://github.com/Palmik/snap-pastie snap-pastie] — is a simple pastebin website that uses some of the most recent, bleeding-edge Snap development.
+
* [https://github.com/Palmik/snap-pastie snap-pastie] another pastebin.
 
* [http://snapframework.com snapframework.com] the Snap home page.
 
* [http://snapframework.com snapframework.com] the Snap home page.
 
* [http://www.silkapp.com/ Silk] — a new way to create and consume content.
 
* [http://www.silkapp.com/ Silk] — a new way to create and consume content.
  +
* [http://www.karamaan.com Karamaan Group] — uses Snap for an internal company intranet.
   
 
=== Yesod ===
 
=== Yesod ===
Line 66: Line 74:
 
* [http://www.urbanlisting.co.za/ Urban Listings] — A free listing website for the South African property market.
 
* [http://www.urbanlisting.co.za/ Urban Listings] — A free listing website for the South African property market.
 
* [http://luach.snoyman.com/ Luach] — English and Hebrew anniversary reminders.
 
* [http://luach.snoyman.com/ Luach] — English and Hebrew anniversary reminders.
  +
* [http://haskell.org/hoogle/ Hoogle] — Uses some of the Yesod stack, mostly Wai/Warp.
 
* [http://www.haskellers.com/ Haskellers] — Professional network of Haskell programmers.
 
* [http://www.haskellers.com/ Haskellers] — Professional network of Haskell programmers.
 
* [http://packdeps.haskellers.com/ packdeps] — Track outdated Hackage dependencies.
 
* [http://packdeps.haskellers.com/ packdeps] — Track outdated Hackage dependencies.
 
* [http://hackage.haskell.org/package/yackage yackage] — A personal Hackage serving for testing new packages.
 
* [http://hackage.haskell.org/package/yackage yackage] — A personal Hackage serving for testing new packages.
* [https://github.com/cutsea110/Kestrel Kestrel] — A Wiki clone. This site has been published as a home customized to a university department (<a href="http://soubun.seitoku.ac.jp">Seitoku University Junior College</a>).
+
* [https://github.com/cutsea110/Kestrel Kestrel] — A Wiki clone. This site has been published as a home customized to a university department ([http://soubun.seitoku.ac.jp Seitoku University Junior College]).
 
* [http://pirates.dyndns-free.com/ Buccaneer Battle] — A multi-player game in the browser: as the captain of a pirate ship, try to sink your opponent!
 
* [http://pirates.dyndns-free.com/ Buccaneer Battle] — A multi-player game in the browser: as the captain of a pirate ship, try to sink your opponent!
 
* [http://pbrisbin.com/ Personal site of Patrick Brisbin] — might be of interest for those wanting to create a blog.
 
* [http://pbrisbin.com/ Personal site of Patrick Brisbin] — might be of interest for those wanting to create a blog.
Line 81: Line 90:
 
=== Happstack ===
 
=== Happstack ===
   
Installed from the <tt>happstack</tt> package from Hackage, or can be retrieved via [http://patch-tag.com/r/mae/happstack the patch-tag Darcs repository.] Info from [http://happstack.com/download the Download page].
+
Installed from the <tt>happstack</tt> package from Hackage, or can be retrieved via [http://hub.darcs.net/stepcut/happstack the hub.darcs.net repository.] Info from [http://happstack.com/download the Download page].
   
 
<pre>$ ghc --version
 
<pre>$ ghc --version
Line 154: 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 ==
  +
  +
This is an overview of features ''as supported directly by code in published packages''. When a feature is listed as "no special support" for a framework, it usually means you could somewhat trivially add the support yourself by integrating existing packages into the framework.
  +
  +
{| 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]
  +
|-
  +
! Server
  +
| lazy IO (being rewritten with pipes)
  +
| enumerator
  +
| conduit
  +
|-
  +
! Code Reloading
  +
| plugins
  +
| hint
  +
| yes
  +
|-
  +
! Scaffolding
  +
| not maintained
  +
| three templates
  +
| one template, interactive options
  +
|-
  +
! Extensibility
  +
| monad transformers
  +
| snaplets
  +
| subsites
  +
|-
  +
! Configuration
  +
| records
  +
| configurator
  +
| type classes, yaml
  +
|-
  +
! Routing Combinators
  +
| [http://www.happstack.com/docs/crashcourse/RouteFilters.html#route_filters yes]
  +
| yes
  +
| yes, with yesod-pure
  +
|-
  +
! 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
  +
| fay
  +
| julius, fay
  +
|-
  +
! Form Processing
  +
| reform
  +
| digestive-functors
  +
| yesod-form
  +
|-
  +
! Client Sessions
  +
| <hask>SafeCopy a => a</hask>
  +
| <hask>HashMap Text Text</hask>
  +
| <hask>Map Text ByteString</hask>
  +
|-
  +
! Authentication
  +
|-
  +
! Authorization
  +
|-
  +
! External Databases
  +
| no special support (unless you count acid-state's "remote" backend)
  +
| several snaplets
  +
| persistent
  +
|-
  +
! Internal Databases
  +
| acid-state (via documentation and happstack-foundation)
  +
| snaplet-acid-state, snaplet-sqlite-simple
  +
| persistent-sqlite
  +
|}

Latest revision as of 11:13, 5 February 2013

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

[edit] 1 The home page

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

[edit] 2 Maintainers

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

[edit] 3 Communities

[edit] 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.

[edit] 5 Use Cases

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

[edit] 5.1 Happstack

[edit] 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.

[edit] 5.3 Yesod

[edit] 6 Repositories and Installation

I am running Ubuntu 10.04.

[edit] 6.1 Happstack

Installed from the happstack package from Hackage, or can be retrieved via the hub.darcs.net 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.

[edit] 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.

[edit] 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.


[edit] 7 Features

This is an overview of features as supported directly by code in published packages. When a feature is listed as "no special support" for a framework, it usually means you could somewhat trivially add the support yourself by integrating existing packages into the framework.

  Happstack Snap Yesod
Version Control darcs git git
Server lazy IO (being rewritten with pipes) enumerator conduit
Code Reloading plugins hint yes
Scaffolding not maintained three templates one template, interactive options
Extensibility monad transformers snaplets subsites
Configuration records configurator type classes, yaml
Routing Combinators yes yes yes, with yesod-pure
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 fay julius, fay
Form Processing reform digestive-functors yesod-form
Client Sessions
SafeCopy a => a
HashMap Text Text
Map Text ByteString
Authentication
Authorization
External Databases no special support (unless you count acid-state's "remote" backend) several snaplets persistent
Internal Databases acid-state (via documentation and happstack-foundation) snaplet-acid-state, snaplet-sqlite-simple persistent-sqlite