PHP is ugly but can be productive. Haskell is beautiful, but well, I know a lot of people encharmed by it, but no-one productive (i.e. delivering products quickly; it's not the same as solving pure, mathematical problems).
PHP is ugly but can be productive. Haskell is beautiful, but well, I know a lot of people encharmed by it, but no-one productive (i.e. delivering products quickly; it's not the same as solving pure, mathematical problems).
Perhaps someone from industry can confirm my feelings here.
We can iterate faster, the type system prevents us from doing dumb, fallible human things, it makes it easier for other programmers to get up to speed, it is fast, the community is brilliant, and because of its static guarantees open source tooling (even if abandoned) is possible to use because of the aforementioned ease of coming up to speed, the type system is a stringent form of documentation, and you can tweak without fear of introducing regressions (mostly, I can't say all but definitely most).
edit: sorry, this was pretty defensive; I shouldn't have written this comment so hastily.
I don't think I had a single 5xx or 404 when developing it, and last I checked 1 500 error in production. I know it's a small site, but it's still pretty unlikely that I'd make a small Rails site without typoing something/misremembering a SQL column name/making a bad assumption about e.g. always getting a value from a cookie.
Can we say the same for Haskell? Let's take a sample: you say, "I'm enjoying my typesafe SQL queries"
There are 2 Haskell query DSLs worth talking about (read: that support joins): Esqueleto and OpalEye. The latter is fresh off the presses and not yet ready for prime time (see the "ideal sql" samples interspersed with the performance killing actual sql); the former at first blush looks decent, but then you realize, whoops, no string based SQL interface (for those ultra complex db-specific queries business requirements demand, but cannot be expressed in the dsl), and no Oracle or SQL Server support -- yikes, bye bye enterprise; in fact both libraries officially support one single database, Postgres.
Also, given Haskell's lack of a module system (hello global namespace conflicts), the choice of operators is somewhat, well, hideous (Haskell itself remains beautiful though, at least in terms of concision).
Not sure how things are on the web framework front, but given the claims of achieving C-like performance, that Yesod and Snap basically face plant in a popular benchmark[1], one wonders where reality and the ideal world Haskellers seem to live in, meet.
[1] http://www.techempower.com/benchmarks/#section=data-r9&hw=pe...
Re: the techempower benchmarks, my understanding is that they used an old version of GHC which didn't include the MulticoreIO manager or something like that. It's since been fixed [1] but it's been awhile since a TechEmpower benchmark (iirc round 10 was pushed back but they're now working on it again [2]).
[1] https://github.com/TechEmpower/FrameworkBenchmarks/commit/9e...
[2] https://github.com/TechEmpower/FrameworkBenchmarks/issues/12...
On the contrary, Opaleye (lowercase "e") has been used in production to run multiple-hundred line queries with high performance. I gave the "idealized SQL" examples in the docs as a way of making the generated code easier to understand for readers, not to suggest that there is any performance loss. If you know of an example where the code generation leads to a performance loss in Postgres I would be interested to hear about it.
(An aside: Esqueleto isn't anywhere close to typesafe, nor does the author claim this is one of its goals. It is trivial to produce crashing queries: https://github.com/prowdsponsor/esqueleto/issues/41)
Is this actually true, or is it "true in your heart"? Very few people use haskell for solving "pure mathematical problems". People use it for things like developing the fastest microkernel in existence, doing high volume trading, making games, and writing boring old web apps. References to "pure mathematical problems" and implying nobody is actually doing anything with haskell come off as sounding like second (or third, or fourth) hand FUD. We taught our PHP team haskell. They had their first project in production in three months. There's nothing special about math and haskell.
I don't imply that nobody uses it for solving practical problems. Just, I made my judgement based on:
- friends (I know, it may be biased),
- GitHub codes I use (and in general, popularity),
- blog posts on Haskell (I encounter mostly language-oriented; less problem-oriented like "let's make a 3d game", "web scraping", "machine learning", "web dev" etc).
It was previously discussed on HN here: https://news.ycombinator.com/item?id=7472452
I mean, it's not I am anti-Haskell or something (it is clearly on my list things to learn), and I am theoretically-inclined (I did quantum physics and pure mathematics). Moreover, I am biased towards clever, succinct solutions rather that horrible code that "just works, somehow".
Yet, for practical problems I do things that work, even if it is JavaScript code, which is not even close to "pure" or "nice".
To what? I'm supposed to link you to reality? How about since haskell is a general purpose, turing complete language, you demonstrate that there's some magical reason that it can only be used for "pure math problems" and nobody can be productive in it doing "real work". Why should a random nonsense claim be given the standing of fact and need to be disproved?
>friends (I know, it may be biased)
That's why I asked if it was true in your heart. Lots of people say things they think sound reasonable and believable based on other third hand information, but which are in fact made up. I have a very hard time believing you have so many friends into haskell and unable to write programs in it. Especially after teaching a bunch of PHP people who had never heard of functional programming (and half had never heard of types!) haskell in a few short lessons. Either your friends are some crazy statistical anomaly, or my developers are. Or perhaps your friends are apocryphal.
>GitHub codes I use
"I don't use anything written in haskell so you can't write anything practical in it" is a pretty poor argument.
>I encounter mostly language-oriented
Where are you encountering them? And are you sure you aren't just misinterpreting "practical" blog posts as "academic" because they mention something you don't want to hear like monads? Even most things I would assume you classify as "language-oriented" are still about solving practical problems.
http://ro-che.info/articles/2014-12-26-monad-control-type-sy...
That might sound scary to people who don't know haskell, but it is about solving a common issue with web development (and other server type programming) in a nice reusable library. Do you really think there's tens of thousands of people just sitting around writing haskell code that does nothing for no reason?
I would expect it all to be heavily skewed towards high volume trading.