Meeting notes for July 11, 2011: Yesod web framework for Haskell

16 views
Skip to first unread message

Igal Koshevoy

unread,
Jul 13, 2011, 1:15:15 AM7/13/11
to pdxfunc
We had a small, but enthusiastic meeting last night.

We spent much of the time going over a simple wiki I'd written using
the Yesod framework, then more code written by others using that
framework, and discussed various questions that I and others had about
what or how Haskell was doing things. Jamie Sharp introduced us to
Yesod at an earlier meeting, and this was a deeper dive.

Yesod provides much of what you'd want in a modern web framework:
sophisticated URL routing with support for REST, powerful request
handling controllers, content-specific actions (e.g. get HTML or JSON
representation of data at a URL), database abstraction and models,
HTML view templates, and integrated support for CSS and JavaScript. It
makes some great design decisions, like letting you programmatically
compose a page by adding HTML markup, JavaScript, and CSS styles
piece-by-piece as you answer a request, which is something that's
awkward or impossible to do with other frameworks. It's also fast.

I found Yesod to be straightforward to work with -- although I hit a
few Haskell-specific WTFs due to my limited familiarity with the
language. I was impressed by how much functionality Yesod delivered
out of the box. I also liked how it leverages Haskell's type system
throughout, all the way from the database to the browser's client-side
input validation -- this eliminates a wide range of bugs, which is its
major selling point. I also suspect that Haskell's excellent
performance and concurrency will be big draws for others to jump on
the bandwagon.

My only concern with Yesod is that it wants you to write web forms
using its "Formlets" system. These describe web forms, their fields
and types, how they're validated, how they're displayed, etc. These
are then used to generate the web form's HTML, JavaScript and CSS. In
concept, this is cool. In practice, this is tedious, complicated and
gets in the way of being able to create the HTML you actually want.
I've used similar systems in many other frameworks, and they were an
constant source of pain.

Anyway, I feel that Yesod has a bright future and will help get more
people working with Haskell. I'd still choose Rails or Django to build
an application when time is of the essence, but I can definitely see
myself choosing Yesod in situations where the correctness and
performance offered by Haskell are a priority.

I should also mention that Yesod is in active development. If you're
looking for a project to contribute to, they'd be glad to use a hand.
You don't have to be a Haskell guru to help either, because a lot of
what they need help with is documentation.

Links:
* Yesod framework: http://www.yesodweb.com/
* Yesod book, which is really helpful in explaining the framework and
how to use it: http://www.yesodweb.com/book
* Two larger web apps written in Yesod, which I found very helpful for
understanding how to use it: https://github.com/snoyberg/haskellers
AND https://github.com/snoyberg/yesodwiki
* Justin Bailey's Haskell cheatsheet, the clearest and most succinct
explanation of Haskell syntax I found :
http://cheatsheet.codeslower.com/

-igal

Jake Brownson

unread,
Jul 13, 2011, 11:18:45 AM7/13/11
to pdx...@googlegroups.com
Neat, sorry I missed that! Thanks for the writeup.

> --
> You received this message because you are subscribed to the Google Groups "pdxfunc" group.
> To post to this group, send email to pdx...@googlegroups.com.
> To unsubscribe from this group, send email to pdxfunc+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pdxfunc?hl=en.
>
>

Phil Tomson

unread,
Jul 13, 2011, 11:37:41 AM7/13/11
to pdx...@googlegroups.com
Speaking of functional web dev languages, anyone had a look at Opa?
http://opalang.org/
The concept seems kind of interesting. You write in a typed
functional language (very ML-like - it's implemented in Ocaml) and
compile to an executable that is your server and db all in one.

They make a lot of interesting claims about scalability and security.

The language is still rather new and has some warts (why do I need to
prefix expressions with 'do' except for the last line of a function?)
but the concept intriguing. Give it a look. I'd be interested in
hearing opinions from folks with a lot more web-dev experience than
myself.

Phil

Reply all
Reply to author
Forward
0 new messages