4 ms·
Is Haskell a good choice for web applications?
- TweedHeads 17y agoNo SQL libs? Haskell is not ready yet...
- chancho 17y agoThere are a number of SQL libraries. http://hackage.haskell.org/packages/archive/pkg-list.html#cat:database http://hackage.haskell.org/packages/archive/pkg-list.html#ca... The complaint was that there aren't any mature libraries that go a step further, beyond feeding manually-constructed query strings to the DB connection, preventing injection vulns at the type level, etc. In an OO language this would be an object-relational mapper. I think the functional crowd is still trying to figure out what a "functional-relational mapper" is supposed to look like.
- TweedHeads 17y agoJust checking MySQL from that list: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hsql-mysql http://hackage.haskell.org/cgi-bin/hackage-scripts/package/h... http://www.maubi.net/~waterson/hacks/hdbc-mysql.html http://www.maubi.net/~waterson/hacks/hdbc-mysql.html http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haskelldb-hsql-mysql http://hackage.haskell.org/cgi-bin/hackage-scripts/package/h... Nop, not ready yet...
- chancho 17y agoFair enough. I won't argue with the fact that Haskell is not yet ready for TweedHeads.
- rarrrrrr 17y agoI tend to push SQL fairly hard. As such I find that ORMs are in my way as often as they help. The lack of one doesn't concern me at all. Seriously, how hard is it to compose a SQL query?
- Xichekolas 17y agoAgreed. On that topic, anyone know of a decent mysql lib for ruby that just lets me query and iterate over the results? The one constantly at the top of google results is at tmtm.org, but my understanding is that it's not threadsafe or particularly speedy. I saw something called asymy made by tptacek, but my impression was that the project was abandoned... Thomas, any comment on where that stands?
- jcapote 17y agohave you looked into Sequel? Fast + Thread Safe http://sequel.rubyforge.org/ http://sequel.rubyforge.org/
- jamesbritt 17y agoPerhaps M4DBI http://purepistos.net/m4dbi http://purepistos.net/m4dbi I'm also a fan of Sequel (though I wish it had a different name).
- njm 17y agoIt's not that SQL queries are difficult to compose, it's that ORMs enable different abstractions to emerge, at least when used appropriately; I'll admit though that junior developers are drawn most to ORMs because they limit exposure to SQL. I'd recommend you check out a legitimate ORM that implements the Data Mapper family of design patterns such as SQLAlchemy or Hibernate. (Incidentally, DataMapper in Ruby doesn't in fact implement the Data Mapper pattern, which I find irritating.)
- michaelneale 17y agoI think ORMs do a fine job, excellent even. The problem is that you may be using O's which require a lot of M'ing to from the R's ;) So if you don't do mainstream OO, then you probably don't ever need ORM. SQL databases are powerful relational engines in their own right - many ORMs have to replicate a lot of that functionality into their memory based stuff (which can be good, but its more work). I guess its all slowly fading, as I am led to believe the trend is away from relational data to distributed data, which has a different set of problems...
- baguasquirrel 17y agoI'm using Haskell + CouchDB. The bindings are simple enough that I've been able to hack fixes for them pretty easily, and just as importantly, Haskell's GADTs are much easier to translate into JSON than they are into SQL rows (at least I thought so). Turning around, you can spit JSON back up at the web layer after some mapping, filtering and processing, so it's not as if you'd wasted effort by writing JSON instances for your data.