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.
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.
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.
As with Ruby and Sinatra, it is mostly a matter of taste. Some people prefer lightweight frameworks and add the components they need, while others like to do things within one well-integrated framework.
> 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.
>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.
> 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!
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.
I don't think this comparison is accurate at all. I suspect the author has only used Snap and not Yesod. Actually I don't know if there is a single Haskell programmer that has seriously tried all three web frameworks.
Could you please use arguments, rather than fallacies? I already said that I primarily have experience with Snap. But I did research both Snap and Yesod before using Snap.
Or from the horse's mouth:
Snap: "Snap is a simple web development framework for unix systems, written in the Haskell programming language."
The Yesod book: "The Haskell community is constantly pushing the boundaries finding the cleanest, most efficient solutions for each challenge.
The downside of such a powerful ecosystem is the complexity of choice. By using Yesod, you will already have most of the tools chosen for you, and you can be guaranteed they work together."
I am very surprised that you think you can make accurate comparisons through googling! But perhaps this points to a documentation problem with Yesod.
I am probably being entirely too harsh here. It is just that when you call something "elaborate" that is not an objective statement taken from the docs. You were probably trying to phrase things in an objective way, but I think every developer views "elaborate" as having a very bad connotation.
I also disagree with the Sinatra vs. Rails comparison for various reasons, but I don't want to spend time arguing analogies.
Type-safe, pure-functional Rails; or simply Rails in Haskell.
So not OO, and (opinion warning) a lot less "magic". Template Haskell and QuasiQuoting can be seen as "magic", but I dont think so; they are actually very transparent ways of making small DSLs (a common practice in Ruby-land) w/o the "Ruby magic" needed to create them.
So what exactly do you feel is bad about "railsishness"?
I think Rails brought a lot of sane defaults and best-practices to a web framework.. I'm not surprised to see nearly all web frameworks that came after it borrow from it. See for instance "Play" on Java/Scala -- very new, very Rails.
I'm not sure what code examples would do, you could use the examples on the yesod site. It isn't a case of "yesod can't do X", it was just out of the 5 people who tried it, 4 voted no. You can't "fix" yesod when it isn't broken, and I think trying to cater to my subjective preferences would simply alienate the people who like yesod.
Your characterization of my posts as trolling is both inaccurate and unnecessary. Having a different opinion is not trolling.
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.
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.
As with Ruby and Sinatra, it is mostly a matter of taste. Some people prefer lightweight frameworks and add the components they need, while others like to do things within one well-integrated framework.