News for hackers. Stuff that matters.
Re:Yesod 1.0 - a robust, friendly, high performance web fram... by cies on Monday April 09, 2012 @05:33PM (#3819354)
> FWIW, since I only really have experience with Snap: When comparing to Ruby frameworks, you could roughly say that Snap is to Yesod what Sinatra is to Rails.

I've used both and this is pretty from my experience.

If I can make comparisons I think:

* Yesod is like Rails w/ haml+sass (but type-safety throughout)

* Snap is like Servlets+JSP (especially wrt templating, besides that it is quite similar to Yesod)

* Happstack is like Zope w/o the frontend (mainly because it is the oldest (has a pre-Rails feel to it) and has its own in-haskell ACID db (Zope has ZoDB))

> Snap is relatively simple and as such easy to fully understand. But since it is a relatively simple framework, you have to mix and match other packages to get the functionality that you want.

I found it as hard a Yesod to get it up and running. Both suffer from old docs/tutorials/examples, both needed me to climb the daunting haskell learning curve.

> Yesod on the other hand is very elaborate - it contains a lot of functionality and relies fairly heavily on the use of Template Haskell and Quasi-Quoting.

How is that a problem? I say: "Template Haskell and Quasi-Quoting FTW!" DSLs or little interpreters are great in reducing code-size. Reducing code size is great, arguably nr.1, in reducing bugs.

> As with Ruby and Sinatra, it is mostly a matter of taste.

I suspect you mean "Rails and Sinatra".

It is not a matter of taste: Rails and Sinatra both build on the Rack interface and have several options for http servers (mongrel/webrick/thin/etc).

With Yesod and Snap you find they both have their own "Rack". Yesod has "WAI" and an http server "Warp" -- these blow every other option out of the water in terms of speed and seem to have a more clever design.

But it could be just my opinion. (I did remember reading somewhere that the Snap devs envy Yesod's speed and try to make their solution faster which is a good thing)

> Some people prefer lightweight frameworks and add the components they need, while others like to do things within one well-integrated framework.

This is mostly a matter of how you build your app: "from scratch" or "scaffolded". Both Yesod and Snap allow both ways. Scaffolding with Yesod brings you much further along the axis of "well-integratedness" then scaffolding with Snap which is obviously a win those preferring the scaffolding approach.

Re:Yesod 1.0 - a robust, friendly, high performance web fram... by papsosouid on Monday April 09, 2012 @06:59PM (#3819731)
>Snap is like Servlets+JSP (especially wrt templating, besides that it is quite similar to Yesod)

Snap offers heist as a default template engine. It is nothing like JSP at all, it is a pure html template engine like lift or zope's templates. There is no embedding any sort of logic or code in the template at all.

>How is that a problem? I say: "Template Haskell and Quasi-Quoting FTW!"

Using is fine, it is intended to reduce boilerplate and works well for that purpose. Yesod over-uses it where it is entirely unnecessary. You lose composability and have to learn another language.

Re:Yesod 1.0 - a robust, friendly, high performance web fram... by cies on Monday April 09, 2012 @07:15PM (#3819785)
> Snap offers heist as a default template engine. It is nothing like JSP at all, it is a pure html template engine like lift or zope's templates. There is no embedding any sort of logic or code in the template at all.

As a reference: also think Zope's templates and Lift are like JSP. But after closer inspection is see your point that JSP allows some in-template arithmetic that other don't.

> Yesod over-uses it where it is entirely unnecessary. You lose composability and have to learn another language.

I think we can safely agree to disagree on this one. :) Small DSL is not another language in my book; "templates" do not need the same kind of composability that "code" benefits so much from. As you say, it reduces "boilerplate and works well for that purpose" -- great!

Re:Yesod 1.0 - a robust, friendly, high performance web fram... by papsosouid on Monday April 09, 2012 @07:38PM (#3819858)
Are you saying JSP and meaning something else? I can't figure out any way you could think that other than confusion over what JSP is. JSP is where markup and code are mixed together, using a special delimiter to start and end code parts. Just like ASP and PHP and hamlet and virtually all template engines. Lift/heist/zpt are the exceptions to the rule.