Re: [web-devel] [Haskell-beginners] happstack versus yesod

This probably isn't the right forum for expressing this thought, but here
goes anyway:
What exactly is the freedom that Yesod takes away from you? I know this idea
gets passed around a lot: Yesod isn't "really" Haskell, Yesod is its own
language, etc. But all of that is really just talking about some sugar that
Yesod puts in place for you: under the surface, it's just functions, data
types and type classes. You can go ahead and write a complete Yesod
application without using Template Haskell of QuasiQuotation.
So what's the restriction that Yesod has that Happstack/Snap don't? Yesod
requires you to provide some datatypes. That's it. What's the purpose of the
datatypes? Mostly, it's about type-safe URLs. I'm not exactly sure why the
term "restriction" or "freedom" even applies here: Yesod has a *feature*
that Happstack/Snap do not include out of the box.
Let me phrase this in a different way: "But I don't like Haskell, because
the idea of Python in more interesting for me. Python gives you some
freedom." I really do see this as the same argument. You can go ahead and
right some code without static type checking in Python, and you might even
write it faster than you would have in Haskell. But go ahead and start
making changes, and unless you have some very good unit tests, you're in for
a world of hurt. In Haskell, often times the compiler will save you from
yourself.
The same is true in Yesod. I've refactored incredibly large codebases, with
hundreds of different resource patterns, and *never* had to worry about
404s. Maybe some people consider that giving up freedom. I consider it
giving up the freedom to shoot yourself in the foot.
Oh, and if you are absolutely dependent on the idea of getting rid of this
data-type requirements, and want all the freedom of dynamic routes, you can
try out a 44 line module[1] that I mentioned recently[2].
OK, enough of this rant. I'm not trying to attack you, I'm just tired of
this notion that Yesod is a ball-and-chain around your ankles. People can
have legitimate reasons to prefer Happstack or Snap to Yesod, I've never
claimed that it was a perfect framework for everyone. I just don't think
this is one of those legitimate reasons.
Michael
[1] https://gist.github.com/884802
https://gist.github.com/884802[2]
http://osdir.com/ml/general/2011-04/msg02160.html
On Tue, Apr 5, 2011 at 8:35 PM, Alexey G
Hello. It's very interesting theme for me and I want to express my opinion. Yesod - very fast web-framework( http://www.yesodweb.com/blog/preliminary-warp-cross-language-benchmarks). But I don't like Yesod, because idea of Happstack more interesting for me. Happstack gives to you some freedom.
I trying to use Snap Framework now. And it's very good for me. Try it http://snapframework.com/!
Sorry for my english.
2011/4/5 Ramy Abdel-Azim
I already posted about this a little bit but i think i should let the old thread get back to it's regularly scheduled conversaion. on to my question:
So I know there are a million easier ways to createa blog (wordpress, django, drupal, etc. etc.) but which would you recommend I use to build a beginner website that is simliar to a blog: happstack or yesod? _Ramy
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Sorry, for double email. I hate my KMail. I think by "freedom" people often mean "how fast can i be comfortable in the framework to start running around and do things." It is true that its much faster to start writing useful code in Snap than in Yesod. And that gives people the perception of freedom. Yesod requires substantial time investment. And even after that some of its parts are still behind the wall (persistence, widgets, subsites). Complex parts that are not documented. I spent quite some time to pick up Yesod, and i am glad that i did. But looking back i realize that because i am not using many of the features of Yesod (persistence, widgets, subsites) i would probably get faster to the same place where i am with Snap and bolted in hamlet. On Tuesday, April 05, 2011 11:32:38 AM you wrote:
This probably isn't the right forum for expressing this thought, but here goes anyway:
What exactly is the freedom that Yesod takes away from you? I know this idea gets passed around a lot: Yesod isn't "really" Haskell, Yesod is its own language, etc. But all of that is really just talking about some sugar that Yesod puts in place for you: under the surface, it's just functions, data types and type classes. You can go ahead and write a complete Yesod application without using Template Haskell of QuasiQuotation.
So what's the restriction that Yesod has that Happstack/Snap don't? Yesod requires you to provide some datatypes. That's it. What's the purpose of the datatypes? Mostly, it's about type-safe URLs. I'm not exactly sure why the term "restriction" or "freedom" even applies here: Yesod has a *feature* that Happstack/Snap do not include out of the box.
Let me phrase this in a different way: "But I don't like Haskell, because the idea of Python in more interesting for me. Python gives you some freedom." I really do see this as the same argument. You can go ahead and right some code without static type checking in Python, and you might even write it faster than you would have in Haskell. But go ahead and start making changes, and unless you have some very good unit tests, you're in for a world of hurt. In Haskell, often times the compiler will save you from yourself.
The same is true in Yesod. I've refactored incredibly large codebases, with hundreds of different resource patterns, and *never* had to worry about 404s. Maybe some people consider that giving up freedom. I consider it giving up the freedom to shoot yourself in the foot.
Oh, and if you are absolutely dependent on the idea of getting rid of this data-type requirements, and want all the freedom of dynamic routes, you can try out a 44 line module[1] that I mentioned recently[2].
OK, enough of this rant. I'm not trying to attack you, I'm just tired of this notion that Yesod is a ball-and-chain around your ankles. People can have legitimate reasons to prefer Happstack or Snap to Yesod, I've never claimed that it was a perfect framework for everyone. I just don't think this is one of those legitimate reasons.
Michael
[1] https://gist.github.com/884802 https://gist.github.com/884802[2] http://osdir.com/ml/general/2011-04/msg02160.html
On Tue, Apr 5, 2011 at 8:35 PM, Alexey G
wrote: Hello. It's very interesting theme for me and I want to express my opinion. Yesod - very fast web-framework( http://www.yesodweb.com/blog/preliminary-warp-cross-language-benchmarks). But I don't like Yesod, because idea of Happstack more interesting for me. Happstack gives to you some freedom.
I trying to use Snap Framework now. And it's very good for me. Try it http://snapframework.com/!
Sorry for my english.
2011/4/5 Ramy Abdel-Azim
I already posted about this a little bit but i think i should let the old thread get back to it's regularly scheduled conversaion. on to my question:
So I know there are a million easier ways to createa blog (wordpress, django, drupal, etc. etc.) but which would you recommend I use to build a beginner website that is simliar to a blog: happstack or yesod? _Ramy
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

I won't argue with that sentiment: I think Yesod includes more features than
Happstack or Snap, and therefore it will take more time to learn. For that
matter, PHP has a lower learning curve than anything in Haskell. But I'm
almost certain that on any decently sized project, all three of the
above-mentioned Haskell frameworks give better productivity than PHP.
Michael
On Tue, Apr 5, 2011 at 10:25 PM,
Sorry, for double email. I hate my KMail.
I think by "freedom" people often mean "how fast can i be comfortable in the framework to start running around and do things." It is true that its much faster to start writing useful code in Snap than in Yesod. And that gives people the perception of freedom. Yesod requires substantial time investment. And even after that some of its parts are still behind the wall (persistence, widgets, subsites). Complex parts that are not documented.
I spent quite some time to pick up Yesod, and i am glad that i did. But looking back i realize that because i am not using many of the features of Yesod (persistence, widgets, subsites) i would probably get faster to the same place where i am with Snap and bolted in hamlet.
This probably isn't the right forum for expressing this thought, but here goes anyway:
What exactly is the freedom that Yesod takes away from you? I know this idea gets passed around a lot: Yesod isn't "really" Haskell, Yesod is its own language, etc. But all of that is really just talking about some sugar that Yesod puts in place for you: under the surface, it's just functions, data types and type classes. You can go ahead and write a complete Yesod application without using Template Haskell of QuasiQuotation.
So what's the restriction that Yesod has that Happstack/Snap don't? Yesod requires you to provide some datatypes. That's it. What's the purpose of the datatypes? Mostly, it's about type-safe URLs. I'm not exactly sure why the term "restriction" or "freedom" even applies here: Yesod has a *feature* that Happstack/Snap do not include out of the box.
Let me phrase this in a different way: "But I don't like Haskell, because the idea of Python in more interesting for me. Python gives you some freedom." I really do see this as the same argument. You can go ahead and right some code without static type checking in Python, and you might even write it faster than you would have in Haskell. But go ahead and start making changes, and unless you have some very good unit tests, you're in for a world of hurt. In Haskell, often times the compiler will save you from yourself.
The same is true in Yesod. I've refactored incredibly large codebases, with hundreds of different resource patterns, and *never* had to worry about 404s. Maybe some people consider that giving up freedom. I consider it giving up the freedom to shoot yourself in the foot.
Oh, and if you are absolutely dependent on the idea of getting rid of
On Tuesday, April 05, 2011 11:32:38 AM you wrote: this
data-type requirements, and want all the freedom of dynamic routes, you can try out a 44 line module[1] that I mentioned recently[2].
OK, enough of this rant. I'm not trying to attack you, I'm just tired of this notion that Yesod is a ball-and-chain around your ankles. People can have legitimate reasons to prefer Happstack or Snap to Yesod, I've never claimed that it was a perfect framework for everyone. I just don't think this is one of those legitimate reasons.
Michael
[1] https://gist.github.com/884802 https://gist.github.com/884802[2] http://osdir.com/ml/general/2011-04/msg02160.html
On Tue, Apr 5, 2011 at 8:35 PM, Alexey G
wrote: Hello. It's very interesting theme for me and I want to express my opinion. Yesod - very fast web-framework(
http://www.yesodweb.com/blog/preliminary-warp-cross-language-benchmarks).
But I don't like Yesod, because idea of Happstack more interesting for me. Happstack gives to you some freedom.
I trying to use Snap Framework now. And it's very good for me. Try it http://snapframework.com/!
Sorry for my english.
2011/4/5 Ramy Abdel-Azim
I already posted about this a little bit but i think i should let the old thread get back to it's regularly scheduled conversaion. on to my question:
So I know there are a million easier ways to createa blog (wordpress, django, drupal, etc. etc.) but which would you recommend I use to build a beginner website that is simliar to a blog: happstack or yesod? _Ramy
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

I agree with vagif' explanation for "freedom". For most people, especially beginners, their criterion for a framework is like "how can I learn it easily, or to what extent does it fit my prior knowledge". According to this criterion, maybe Yesod is harder to learn because of its more features and less documentations, and harder to feel comfortable for its TH things. However, I don't think the above criterion is reasonable. To evaluate a framework, the main factors are: * How well and consistent is it designed? * How KISS(keep it simple and stupid) is it? * Does it scale well in large projects? I had used python/django to develop web projects before, it's very easy to learn and use. But to reduce your repetitive work, you need to write or use many utils like decorators and generic view. I really like the haskell language,so I try to use haskell as much as possible. From last year, I have learnt Happstack, Snap, and Yesod respectively, and compare their design and features. After reading most of the haskellers.com's code, I think its codes are very clean and elegant. So I chose Yesod among the three frameworks. I think Yesod's design is good, and safe url fits haskell's philosophy. As for the TH things, they are just the convenient way to reduce repetitive coding. As one said, "Every large projects to some extent implement a variant of Lisp." QQ is just the method provides by Yesod to attack repetitions, if you don't like it, you can bypass it. In a word, the existence of TH and QQ in Yesod is not that unreasonable. Although Yesod has the most features in the three, it's still in its childhood compared to something like django. As mentioned in one thread, I request the common "join" support in persistent. Yesod has much work to be done, especially documentations. Nevertheless, I think it's promising. On Tue, 2011-04-05 at 12:25 -0700, vagif.verdi@gmail.com wrote:
I think by "freedom" people often mean "how fast can i be comfortable in the framework to start running around and do things."
participants (3)
-
James
-
Michael Snoyman
-
vagif.verdi@gmail.com