Hacker News new | ask | show | jobs
by tikhonj 4843 days ago
Many of the same advantages (and some additional ones, no doubt) hold for the Haskell web frameworks, with the added benefit of using Haskell.

I'm in no position to say whether Yesod or Lift is better; I just wish more people would consider Haskell at all--it's a great choice for web programming (among many other things).

2 comments

Many of the same advantages hold for any other language's frameworks, with the added benefit of using any other language.
Yesod is great, especially its quasi quoters, such as Hamlet.

However, two things that I constantly bumped into maintaining a small Yesod app is that there was a fairly constant stream of API changes and that deployment on different machines was annoying because of version conflicts installing packages.

If you use Yesod, you are probably best off using a Cabal sandbox (e.g. via cabal-dev) and making specific package versions dependencies. Of course, that may be questionable from a security perspective.

I ended up rewriting that particular web app to Play, which offers some of the same benefits, but was a lot easier to deploy. You can create a stand-alone version of an application with play dist, which includes all the required jars, and the only thing required on a server is the Java runtime environment. Also, Maven/sbt seems a lot more mature than Cabal. As an added advantage, you can use tried and tested Java or can go all-functional via Scala.

Concerning the cabal dependencies problem. I didn't tested it yet, but I believe a sane solution should be to use stackage[1].

I know fpcomplete use stackage for their School of Haskell[2]. This way, there is never any package dependency problem. Which gives them the incredible ability to execute yesod application directly on their server from the code of an user changing the code in the browser. If you haven't did it yet, you should really try it.

Also, concerning the deployment, having a single statically linked binary is very similar to having a single jar file. And this is very easy to deploy using heroku for example.

You can ask me more detail if you want to know how I deploy my application but this is mostly very well documented in the wiki.

[1]: https://github.com/fpco/stackage [2]: https://www.fpcomplete.com/school

Well, for very relative values of "all-functional".

But yeah, Cabal is certainly a bit of a pain. Happily, people are working on it. Superior cabal-dev functionality is going to be integrated into cabal proper very soon, if it hasn't already, for example.

Also, couldn't you just compile your binary with static linking and just deploy that? I understand there can be problems if you depend on certain non-Haskell libraries like GUI toolkits, but that shouldn't be an issue for a web app. I think a statically linked binary is pretty similar to a jar file in practice.

Not everyone develops on the same platform as an application is deployed.