4 ms·
For Rails/Play, we have three web frameworks: * Snap * Yesod * Happstack I think all of these have techniques to build web sites in a modular fashion, but I h
by ocharles 13y ago
For Rails/Play, we have three web frameworks:
* Snap
* Yesod
* Happstack
I think all of these have techniques to build web sites in a modular fashion, but I have only used Snap myself.
For querying, I personally just use postgresql-simple and write SQL strings, but this tends to be a major source of runtime bugs so I'm reconsidering that. For type safe alternatives, we have things like HaskellDB (http://chrisdone.com/posts/haskelldb-tutorial http://chrisdone.com/posts/haskelldb-tutorial) and esqueleto (http://hackage.haskell.org/package/esqueleto-1.3.4.2/docs/Database-Esqueleto.html http://hackage.haskell.org/package/esqueleto-1.3.4.2/docs/Da...).
We have a fairly decent date time library in time (http://hackage.haskell.org/package/time http://hackage.haskell.org/package/time) but I don't know if that matches JodaTime (because I don't JVM libraries). For PDF generation I'm actually not sure at all - but have a search on http://hackage.haskell.org http://hackage.haskell.org and there may be something.
- virtualwhys 13y agoThanks, I did check out Yesod and HaskellDB a while back when I was researching ways to escape from Grails hell (i.e. pre grails 2.0). Yesod looked promising, HaskellDB, not so much (IIRC was developed in early 2000s and not actively maintained). Definitely not interested in going back to string based SQL after working with ScalaQuery for the past couple of years. Anyway, the thrust of the question was, can you do full stack web dev with Haskell. The answer seems to be yes, but you have to dig around a bit. Would be a fun side project to hack together a site in Haskell, definitely a fan of the type system
- asdf1234 13y agoFor anything other than trivial queries ScalaQuery/Slick generates very bad SQL. I'd like to use it but generating deeply nested sub-queries when simple joins would suffice is totally unacceptable. The PostgreSQL query optimizer can fix them in the simple cases but the MySQL and Oracle optimizers can't and it causes performance to drop off a cliff. HaskellDB suffers from a similar problem.
- virtualwhys 13y ago> For anything other than trivial queries ScalaQuery/Slick generates very bad SQL For Slick, yes, but for ScalaQuery 0.10, absolutely not. All of my ScalaQuery generated SQL is semantically _exactly_ what I would have written by hand, and completely typesafe, with generated prepared statements to boot. This includes outer join based queries, subselects, and other operations that cause Slick to generate nightmare SQL (why I'm avoiding Slick until the library is stable on the performance front). I love ScalaQuery, but Slick, TBD, they have a ways to go yet, the new Scala collections syntax with groupBy and sortBy is particularly hideous compared to ScalaQuery's SQL based groupBy and sortBy. The Slick team will sort things out, hopefully sooner rather than later (for example, I'd love to have Slick 2.0's composable parameterized query snippet functionality, that alone is a huge boilerplate WIN).
- enigmo 13y agotime (sadly) isn't comparable to Joda Time.
- virtualwhys 13y agoJodaTime is unbelievably awesome. That's one of the reasons why being on the JVM with Scala, Clojure, etc. makes one's coding life simpler: huge ecosystem to draw on with minimal effort (i.e. rarely need to roll your own).
- tel 13y agoAs someone who has never used Joda Time, what makes it so great?
- virtualwhys 13y agoGenerally immutable (supports mutable state for some edge cases) along incredibly rich functionality covering everything you could imagine needing time-wise, and does so concisely. It's a godsend given the built-in Java alternative.