vikraman / packages-ng

GNU General Public License v2.0
0 stars 0 forks source link

Learn more about and compare haskell web frameworks #3

Open vikraman opened 10 years ago

vikraman commented 10 years ago

Currently considering snap or happstack, not yesod.

gg7 commented 10 years ago

What about scotty?

vikraman commented 10 years ago

scotty seems too minimal. From what I read, I think snap should be the best choice. If we want typesafe urls, we can use https://github.com/lukerandall/snap-web-routes. Also snaplets look interesting. Let's get started with snap.

vikraman commented 10 years ago

For "orm", we can use https://github.com/yesodweb/persistent from yesod (makes migrations etc. easy), or use plain hdbc.

gg7 commented 10 years ago

I think snap should be the best choice.

Agreed.

orm

The more I learn about databases the more I start disliking ORMs. I like the idea but I frequently run into limitations (so far I've used Django's ORM and Hibernate and while the former is OK the latter is pretty bad IMO).

I should be able to easily define custom indexes (e.g. a partial functional B-tree one), constraints, data types (if I need to), and occasionally a stored procedure or a trigger (I hope we won't need them). I should be able to easily open a read-only transaction with a SERIALIZABLE isolation level. You get the idea. Posgtres has a lot of features which most ORMs don't support, such as rich datatypes (arrays, JSON, ...), SELECT FOR UPDATE, WITH Queries (Common Table Expressions), aggregate functions, window functions, table inheritance, a listen/notify system, foreign data wrappers, materialized views, and many more which we (probably) won't need.

If we manually manage indexes/constraints/whatever we lose migrations, right? (Or at least make migrations more complicated.) I like migrations, but if need be we can live without them.

I know that some of Haskell's ORMs give you type safety (which is great!), but I don't have any experience with them. What issues do you think we will encounter if we decide to use yesod-persistent (or another Haskell ORM)?