consolidating Haskell's web-framework scene

Hello! I'm (still) Haskell noob learning the language with the help of RWH book and plan to write desktop GUI app (probably with qthaskell). However, there is also need to put together some web sites and I'd be very happy to use Haskell instead of tinkering with Python/Django. You know, once when you get even a small taste for Haskell it's hard to 'go back'. :-) Although it might be great framework, I'll be frank to say that Happstack with all technology that goes along is something which is either too complicated for me, not practical to be run on shared hosting (e.g. Webfaction), not documented properly and it belongs to 'noSQL' which is not for me at the moment. That's why I'm interested to discuss possibility to somehow consolidate Haskell's web frameworks nad provide something which is good for practical development, does not require VPS to be used, nice documentation etc. If we take a look in the Python's neigbourhood, we think something like Django although knowing well that it is quite big community, with lot of docs, books, apps etc., so it's maybe not the best example. However, Alson's yesterday post about leaving Haskell and (probably) leaving Turbinado abandoned (http://www.alsonkemp.com/haskell/reflections-on-leaving-haskell/) made me think to write this post. From his post it is obvious that he faced some walls during his devlopment which he could not overcome. I'm sad that the Turbinado was not more open so that someone can jump in and offer suggestions. Otoh, it was also not documented - docs were promised for quite some time, but nothing happened. Otherwise, the project had some nice objectives...so, let's learn the lessons. Some time ago, Michael posted about Yesod and I read about WAI initiative. He is very responsive and I've already exchanged several emails with him, but being noob for web-development in Haskell I want to learn more and help, according to my skills, that Haskell gets one decent & practical web-framework. The Haskell language itself was created to consolidate fragmented market of different FP languages. Are we ready to follow our 'ancestors' and in their spirit do the same when it comes to web-framework(s)? * Is it WAI & Yesod good start? What the others think? Any further reference you can provide for someone to learn more about web-programming in Haskell? (RWH is not very extensive here.) * I said frameworks because it seems that Happs is in its own category and if you read the comments in the above referenced URL, you'll see that often Happs is labeled as too complex. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ----------------------------------------------------------------

On 2010-03-14 08:11 +0100 (Sun), Gour wrote:
From his post it is obvious that he faced some walls during his devlopment which he could not overcome. I'm sad that the Turbinado was not more open so that someone can jump in and offer suggestions.
It seems that it's open now, since it's on GitHub. That said, I don't
think it's a good starting point due to the design decisions; I
commented on this extensively (to the tune of about a thousand words)
in a comment I posted to his blog entry, though that comment has yet to
appear.
cjs
--
Curt Sampson

On Sun, 14 Mar 2010 19:10:34 +0900
"Curt" == Curt Sampson wrote:
Curt> It seems that it's open now, since it's on GitHub. That said, I Curt> don't think it's a good starting point due to the design Curt> decisions; I commented on this extensively (to the tune of about Curt> a thousand words) in a comment I posted to his blog entry, though Curt> that comment has yet to appear. Interesting post - it just appeared on his blog. I am not thinking that Turbinado is good starting point, but maybe Yesod is a better one? Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ----------------------------------------------------------------

Alright, so web-devel doesn't seem interested in moderating my message, so I'll just break it up into two chunks: I was planning on writing a blog post called "call to arms," which would have been something similar to what you said. I agree that there is far too much fragmentation in the community; I debated starting Yesod at all when there were already a number of frameworks out there (Happs, KIbro, Turbinado). However, none of them hit the spot that I was aiming for, so I created it. At the same time, Jinjing came out with Hack, and I tried to go with that. Unfortunately, there are some inherent flaws with Hack (you can review the Hack-discuss mailing list to see some discussions over there), so I started WAI. So it would seem that so far, I've done more fragmentation than consolidation :(. On the other hard, the other frameworks having had much development, Yesod is still active, and it looks like Happstack will be joining WAI, so not all is lost. I am very interested in trying to continue consolidation, but I think aiming for the One True Haskell Framework is a bad idea. Python- the community known for One Way To Do It- can't even consolidate around a single framework, so Haskell- the language of We Can All Write A Monad Transformers Library- doesn't stand a chance. So where can we consolidate? On libraries. I have purposely released a number of the components of Yesod as separate libraries that are available to any framework author (or even someone *not* using a framework). Here are some in particular to look at: wai wai-extra web-encodings clientsession authenticate data-object, data-object-json and data-object-yaml failure and control-monad-failure hack-handler-webkit Some of these packages have very obvious room for future development, and if someone (like Gour) is looking for somewhere to start contributing to the Haskell web community, I would recommend one of the following: authenticate currently supports OpenId 1 and RPXnow. I would like to have authenticate itself support *all* sites that RPXnow does. The first step in that process would be to get authenticate to use the openid package and determine whether a server support openid 1 or 2. From there, Twitter, Facebook, Windows Live support would all be nice. hack-handler-webkit is, IMO, a really cool idea. It allows you to convert any Hack application into a desktop app. It runs simpleserver and then opens up a Webkit window that connects to it. This is much better than simply running the simpleserver and then opening up a webbrowser, because: 1) The program terminates automatically when the web browser closes. 2) You can control menu bars, title bar, etc completely, making it *feel* like a desktop app. 3) You can ensure that all of the functionality you want is present in webkit. Unfortunately, hack-handler-webkit has two problems: 1) It's written for hack instead of WAI. However, this should take all of 5 minutes to fix. 2) It only works on Linux, and even there I don't have any documentation on setting it up.

On Mon, 15 Mar 2010 08:10:35 -0700
"Michael" ==
wrote:
Michael> I am very interested in trying to continue consolidation, but Michael> I think aiming for the One True Haskell Framework is a bad Michael> idea. I didn't think about One True Haskell Framework, but about, at least one, which can run on shared hosting using nginx, cherokee, lighty server, some templating engine, database back-end and decently documented. Michael> Python- the community known for One Way To Do It- can't even Michael> consolidate around a single framework, so Haskell- the Michael> language of We Can All Write A Monad Transformers Library- Michael> doesn't stand a chance. That's true, but Python is much bigger community in comparison and, afaics, Python web frameworks have lot of docs, some even many books written about them. Michael> So where can we consolidate? On libraries. I have purposely Michael> released a number of the components of Yesod as separate Michael> libraries that are available to any framework author (or even Michael> someone *not* using a framework). That's great and I'm very happy seeing that Happstack may become WAI-ready. Sincerely, Gour -- Gour | Hlapicina, Croatia | GPG key: F96FF5F6 ----------------------------------------------------------------

And part 2: Yesod is still missing a model layer. This is a project that I will most likely be doing myself, since it will need to be designed to integrate very closely with Yesod, but I'll mention some of the design ideas here. (By the way, Chris Eidhof has a package on Github called Basil which looks very interesting here.) 1) I want to use YAML quasi-quoting to define the models. 2) I don't want a super-complex "object relational mapping"; Haskell is already much closer to the relational level than an OO language. 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to load everything into memory at the beginning. 4) Not tied down to SQL *or* in-memory databases. It should support both of those, but *also* support a system that is usable even in a CGI setup. I'm contemplating now a database that uses multiple directories/files and uses append-only to avoid concurrency issues. Compile-time checking of templates would be great. The Bravo package looks interesting, but I'm a little dubious about the approach used. I think something based on typeclasses might be a bit more nimble. Once again, tight integration with the model system I theoretically design would be nice. So, in summary of a much-too-long e-mail, let's not bother trying to get everyone to agree on One Framework. Happs has its place, Yesod has its place, and I know others are using Loli and probably Kibro. (I'm not sure if anyone every got started with Turbinado.) However, we can raise the bar for *all* packages simultaneously by making a more solid ecosystem of Haskell web packages available that any framework can cherry-pick from.

Compile-type checking can be very helpful and it is Haskell's strong side. But what about hot code swapping? In working web application it is often convenient to update some part of application without disturbing connected users. It's strong side of Erlang, but what about Haskell? Michael Snoyman wrote:
And part 2:
Yesod is still missing a model layer. This is a project that I will most likely be doing myself, since it will need to be designed to integrate very closely with Yesod, but I'll mention some of the design ideas here. (By the way, Chris Eidhof has a package on Github called Basil which looks very interesting here.)
1) I want to use YAML quasi-quoting to define the models. 2) I don't want a super-complex "object relational mapping"; Haskell is already much closer to the relational level than an OO language. 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to load everything into memory at the beginning. 4) Not tied down to SQL *or* in-memory databases. It should support both of those, but *also* support a system that is usable even in a CGI setup. I'm contemplating now a database that uses multiple directories/files and uses append-only to avoid concurrency issues.
Compile-time checking of templates would be great. The Bravo package looks interesting, but I'm a little dubious about the approach used. I think something based on typeclasses might be a bit more nimble. Once again, tight integration with the model system I theoretically design would be nice.
So, in summary of a much-too-long e-mail, let's not bother trying to get everyone to agree on One Framework. Happs has its place, Yesod has its place, and I know others are using Loli and probably Kibro. (I'm not sure if anyone every got started with Turbinado.) However, we can raise the bar for *all* packages simultaneously by making a more solid ecosystem of Haskell web packages available that any framework can cherry-pick from. ------------------------------------------------------------------------
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

On Mon, Mar 15, 2010 at 9:07 AM, Dmitry Belayev
Compile-type checking can be very helpful and it is Haskell's strong side.
But what about hot code swapping? In working web application it is often convenient to update some part of application without disturbing connected users. It's strong side of Erlang, but what about Haskell?
That's definitely a good point. My current deployment uses lighttpd/CGI to server the application, along with a development system running on 3000. Here's my workflow: 1) Develop on local system using simple-server. 2) Push changes to development system. Who cares about a little downtime there. 3) When everything works, pull changes into the production repo. 4) Compile everything with -Wall -Werror. 5) Copy templates, static files and CGI binary in one fell swoop to the production directory. So this is really a solution outside of Haskell. I believe Turbinado used some features for dynamically compiling code, but I prefer this kind of approach in general. If I was during a standalone server approach, one possibility for production deployment might be: 1) Run the production server on port 3001 (or anything else). Set up iptables to forward port 80 to port 3001. (I do this already). 2) When I want to make a production change, start a *new* production server on port 3002. 3) Adjust iptables to port forward to 3002. 4) Next time around, switch back to 3001. For the record, I think iptables forwarding is probably the safest way to run an application on a privileged port. Michael Snoyman wrote:
And part 2:
Yesod is still missing a model layer. This is a project that I will most likely be doing myself, since it will need to be designed to integrate very closely with Yesod, but I'll mention some of the design ideas here. (By the way, Chris Eidhof has a package on Github called Basil which looks very interesting here.)
1) I want to use YAML quasi-quoting to define the models. 2) I don't want a super-complex "object relational mapping"; Haskell is already much closer to the relational level than an OO language. 3) Utilize IO thunks (ie, lazy IO loading) so that we don't need to load everything into memory at the beginning. 4) Not tied down to SQL *or* in-memory databases. It should support both of those, but *also* support a system that is usable even in a CGI setup. I'm contemplating now a database that uses multiple directories/files and uses append-only to avoid concurrency issues.
Compile-time checking of templates would be great. The Bravo package looks interesting, but I'm a little dubious about the approach used. I think something based on typeclasses might be a bit more nimble. Once again, tight integration with the model system I theoretically design would be nice.
So, in summary of a much-too-long e-mail, let's not bother trying to get everyone to agree on One Framework. Happs has its place, Yesod has its place, and I know others are using Loli and probably Kibro. (I'm not sure if anyone every got started with Turbinado.) However, we can raise the bar for *all* packages simultaneously by making a more solid ecosystem of Haskell web packages available that any framework can cherry-pick from. ------------------------------------------------------------------------
_______________________________________________ web-devel mailing list web-devel@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
participants (4)
-
Curt Sampson
-
Dmitry Belayev
-
Gour
-
Michael Snoyman