Guenni
Guenni

Reputation: 459

Haskell and webframeworks

I started developing an application (some boring accounting software for inhouse use) and decided to make it web-based as this would solve a couple of problems in one go.

Now with a couple of webframeworks for Haskell to choose from (happstack, yesod and snap) I still begin feeling the pain again of having to deal with HTML, CSS and devishly clever wired JavaScript.

Uhm.

So what the hell I thought might as well try going all the AJAX way and do the UI in either Cappuccino or SproutCore. (SEO is not an issue here).

But now I wouldn't really need a full blown web-framework such as one of the three above, an HTTP server which could serve data wrapped in JSON or XML should in theory be enough.

Would there now still be a point in using either one of those three?

And most of all how feasible is the approach?

Günther

Upvotes: 1

Views: 863

Answers (2)

mightybyte
mightybyte

Reputation: 7282

All of the big three web frameworks have their own web servers. Yesod's server is warp. Snap's server is snap-server. Happstack's server is happstack-server. They all have fairly low level APIs that would be appropriate for your application. Warp's API is defined in wai. The Snap server's API is defined in snap-core. Happstack doesn't have a separate package for its API, however they have a simplified version of it in the happstack-lite package.

I would recommend that you take a look at the APIs and use whichever one you like best.

Upvotes: 2

Shaun the Sheep
Shaun the Sheep

Reputation: 22762

I think your question might be verging on "overly broad" here - so I guess it depends on your requirements. You probably don't need things like type-safe URLs if all you are doing is exchanging JSON and in fact the Yesod book has a JSON web service example which avoids using Yesod itself and instead builds on the underlying WAI package.

I can't comment on Snap and Happstack since I haven't really looked into them much, but there are other options too. For example Scotty adds a simpler layer on top of WAI which should be more than adequate for building a basic server without much of a learning curve. I also found reading Scotty's code was a good way to build an understanding of WAI which is also very useful if you are developing more complicated Yesod apps.

Upvotes: 4

Related Questions