tip TWiki Tip of the Day
SmiliesPlugin emoticons
Smilies are common in e mail messages and bulletin board posts. They are used to convey an emotion, such ... Read on Read more

Compare Web Frameworks

Main

Compare Haskell-based Web-Frameworks

For Advanced Functional Programming (AFP), by DerekdeRie, TomTervoort, RenzeDroog

Introduction

The first information given by DoaitseSwierstra: "There are several Haskell libraries available for building web-based systems, such as Wash, Happstack and Yesod. Make Consumentngids-like comparison, by implementing a small web-based system in the various frameworks. An running example might be the current submit-system."

We will start the project by looking at the given three implementations (Wash, Happstack and Yesod) and look at some other options (Hackage DB: web library's). These library's should give us a stable base to start with. We will expand our research to other library's at a later point. Our starting idea is to design a simple website with multiple (but simple) pages, which we will implement by using the different library's. This simple website should give enough information about the library's. For example: the performance, the simplicity and the quantity of (usefull) functions.

To start with this first stage, we will need to look at a few different sub-topics:

  • [DONE] Look for candidate library's at the Hackage DB (+ give a short introduction to their specifications)
  • [DONE] Think of what we would need on the webpages (simple "Hello World"-page, form, CSS-based page(?), jQuery photo gallery(?))
  • [DONE] Create a planning on which we will base our research
  • [DONE] Implement it in all the library's which we will use
  • [DONE] Dig deep into the used library's and give their specific aspects (uniqueness), strengths and weaknesses
  • [BUSY] Finalising the comparison and write the paper (=create a wiki for it)
  • Later: Ask for different opinions at Haskell Cafe about our website, implementations, comparison and/or the library's

Helpfull links: AFP home site

-- RenzeDroog - 11 Jan 2011

Candidate library's

  • (?) Compliant Haskell XHTML is a very simple tool to create W3C? correct (X)HTML. It hasn't got any deep functions, so it can only produce (X)HTML and hasn't got any knowledge about JavaScript? , databases or something like that.
  • Hack isn't very big, but could be a library to start with. It is said to be a "Haskell Webserver Interface".
  • Hawk is a quite large library to create a full web application. But it's documentation isn't what it should have been.
  • Happstack is a well-documented Web Framework which allows you to do all the work from scratch, but also gives you functions which do a lot of work for you.
  • Haskell Server Pages (HSP) is a big library which contains a lot of functionalities. I didn't dig deep into the library, so I couldn't tell if the functionalities are what we're searching for, but a fast look at the Google Groups gave me enough information to say that it is indeed something which could be thé library which we are searching for.
  • Haskoon is based on Happstack, so I assume it's only a expansion for Happstack. But it still looks like a good candidate.
  • Kibro looks like a small library which has just enough functionalities to call it a Web Framework.
  • RedHandlers is a monadic approach for creating a Web Framework. They mostly target at HTTP requests.
  • Salvia is a modular web application framework, created by a MSc student of the UU.
  • Snap is far from completely finished, but it's stable enough to use it in our research. They plan on releasing a new version in January, but I don't think we could wait on that.
  • Wash is developed quite a few years ago. There is a maintainer, but the stable version is from 2006. The original programmer stopped working on Wash, so that is a real disadvantage, because someones original ideas are difficult to continue working on.
  • Yesod is a very large library with (I think and assume) every funcionality which you could want.

Some other (special) library's are:

  • Bamboo is a extension of Hack and it allows you to create a blog and post on it and things like that.
  • Blog literately is a tool to markup your Haskell-blog posts. It could as well markup blog posts containing only Haskell code as blog posts containing Haskell code and a plain text.
  • Fckeditor is a common used WYSIWYG application on the internet. This implementation of Fckeditor is, of course, written in Haskell.
  • Orchid is a Wiki library, but it's documentation is bad. I couldn't find any more information about it, nor did I find any source code or type declerations which could give me any idea about the library. A demo can be found here, but I didn't took a look at it (yet).

-- RenzeDroog - 23 Nov 2010

Planning

Done:

Future work:

Doesn't work at all three of us

-- RenzeDroog - 11 Jan 2011

Scheme

Library's Main.DerekdeRie (Mac) Main.TomTervoort (Ubuntu) Main.TomTervoort (Windows) Main.RenzeDroog (Windows)
CHXHTML _ ? C C
Hack x x x x
Hawk _ _ C C
Happstack _ x x x
HSP x ? x x
Haskoon x x C C
Kibro _ ? C C
RedHandlers? _ x C C
Salvia _ x C C
Wash x x ? x
Yesod A x x x
Snap B _ C C

Legend

  • x = works fine
  • ? = don't know if it works
  • _ = doesn't work
  • C = doesn't work because he complains about MinGW? +MSys/CygWin, and they complain about a C compiler which doesn't work, but it is impossible to get it to work
  • A = the package Applicative errors when Formlets should be imported
  • B = the package ByteString? errors when it should be imported

-- RenzeDroog - 20 Dec 2010

Approach

Our approach to this programming task is creating a website in all the Frameworks and compare the results afterwards. We are also going to compare the easyness of installing the library's on the different Operating Systems, because getting it to work should be as easy as implementing a website. This second point is already done, but not yet documentated.

So, our main point is creating a small website which consits of these four pages:

  • Home: a static homepage with CSS, simple images and a table. These 4 functions are easy to use in plain HTML, but for example: a table could be significant less work with an list of lists in Haskell, however: you lose a lot clearness then.
  • Contact: a contact form which will send yourself an e-mail with an (optional) file which you can upload. Of course, in a working system you would not send the e-mail to yourself, but that is just for seeing the website working.
  • Photo Gallery: nowadays, almost every website has some kind of photo gallery. This is particulary useful in a website with high quality photos, where it is awkward to work with resized images. If you use a photo gallery based on for instance jQuery, you can also have a big version of the photo, which will not be loaded instantly (so the user doesn't notice the difference when he's just browsing).
  • Haskell: we thought of a functionality which is especially of use when you create a website within a Haskell Web Framework: of course, some kind of Haskell integration in your website. We are going to implement this with our third practicum from the course Functional Programming in 2009-2010: Spreadsheet. This is a simple Excell-like spreadsheet which can do mathematical operations and can just show a String and things like that.

Things that need to be done before Monday Jan 17th

# Content Author
1 Overview R
2 [DONE] Template Wikipage R
3 HappStack? /HSP review T
4 Yesod review D
5 Hack/Loli/Moe/Happstack review R
6 Snap review T
7 HTTPD Shed review R
8 Finish HTTPD Shed R
9 Finish Snap T
10 Finish Yesod Database D
11 Finish Wash R
12 Finish Haskoon D
13 Finish RedHandlers? T
14 Dependencies + Justification D
15 Finish Comparison / Assign Percentages DRT

-- DerekdeRie - 11 Jan 2011

Criteria

We've tought of some criteria which will determine what WebFramework? is the 'best'.

  • Installation (specifically and general)
  • Maintainence/support
  • Documentation
  • Accessibility (to the package itself (tutorials?) and to HTML combined with the package)
  • Features (CSS, JavaScript? , Forms, Miscellaneous)

-- RenzeDroog - 20 Dec 2010

Planning and Progress

Planning

  • Jan 5th: Progress meeting. Update each other on our progress and check if everbody's doing their work.
  • Jan 11th: Comparison meeting. All websites should be finished, and this meeting shall produce our verdict in the search of good web frame works. Also we'll determine who will write which in the paper and talk.
  • Jan 17th: Deadline first draft paper
  • Jan 20th: Slides for the talk should be ready. Time to go through both the paper and talk for the final time. You should've looked into the other two paper drafts.
  • Jan 24th: Deadline talk and paper.

Result Progress meeting Jan 5th

  • Derek has made significant progress on the Yesod framework. The Haskoon framework has no documentation or examples and because of this it is nearly impossible to use.
  • Tom has had the same problem with the RedHandler? package as Derek did with Haskoon. The HSP-Happstack combination is working nicely and is making good progress.
  • Renze has done good work with the Hack package, although it was difficult to get it going. The Wash framework won't compile. The work on the httpd-shed package has been postponed to the weekend.
  • Our general conclusion that everyone has one package that is good to use. So our plan is to go deeper into that, and focus on the (popular) packages Yesod, HSP-Happstack and Hack.

Result Comparison Meeting Jan 11th

  • Comparisons were made between the packages, resulting in the table found below. To give a better idea of why each package is judged the way it is, we will continue to write reviews of each separate package. The reviews of Yesod, (HappStack? + HSP), (Hack + Loli + Moe) and Snap will be extensive, the others rather short.
  • Derek will set up the Wiki
  • Renze will create a template for our reviews of the packages so uniformity
  • Since we feel like we cannot leave Snap out of our comparison, Tom will investigate this package so he's able to judge it conform our earlier comparisons

-- DerekdeRie - 11 Jan 2011

Result Comparison Meeting Jan 17th

Progress

  • Tom finished his work on HappStack? /HSP. The report on Snap only has to be posted online, and Redhandlers still has to be done
  • Derek finished his work on Yesod and Haskoon. To Do: Background Page
  • Renze finished his work on the Introduction, Versus PHP, Background etc. pages. His report on HAck/Loli/Moe only needs some revision
  • To Do: Case-study page (Mostly Derek's work)

Decisions/Work

  • We've decided on the percentages, Renze will work them in the Wiki.
  • We've decided on the order and content of our presentation (as shown below)
  • New page for better overview case-study
  • We've gone over our results once again, in order to guarantee consistency

Planning Presentation

Approx. Min Content *Speaker
2 Why Haskell in websites? T
2 Why our research? D
3 Case: Introduction R
5 Case: HappStack? /HSP T
3 Case: HTTPD-Shed R
5 Case: Yesod D
5 Case: Hack/Loli/Moe R
3 Other packages T
2 Conclusion D

-- DerekdeRie - 17 Jan 2011

Template

You can find the template we'll be using for every package below. You can see it at the template-page for a fill-in version as a preview and you can see a filled-in version as a preview at the 5th revision of template. The links in the table in this filled-in version are wrong, because they link to the original page and not to the 5th revision, but this will work out just fine if you'd copy everything below and replace every {TAG} with the correct information. Every link is generated automatically, just as the table of contents.

The template is deleted because of the space. You can still find it on it's own page: template.

Discussion

Derek, what was the link to the website Doaitse showed us? I forgot it.

-- RenzeDroog - 22 Nov 2010

http://www.paulgraham.com/arcchallenge.html

-- DoaitseSwierstra - 22 Nov 2010

Updated the complete page with all recent information.

-- RenzeDroog - 06 Dec 2010

I came across a nice article: http://docs.yesodweb.com/blog/yesods-own-world/

-- RenzeDroog - 11 Dec 2010

Making HSP work http://nhlab.blogspot.com/2008/07/html-templating-in-happs-using-hsp.html

-- DerekdeRie - 13 Dec 2010

 

Topic attachments
I Attachment Action Size Date Who Comment
elsexlsx Comparison.xlsx manage 10.2 K 11 Jan 2011 - 12:16 RenzeDroog The first draft of our comparison
zipzip Practicum3.zip manage 6.5 K 06 Dec 2010 - 15:48 RenzeDroog Practicum 3 of FP: Spreadsheet. We will use this as a example to run a (very) small Haskell Application.