90 points · by KirinDave · 15y ago · 59 comments
Yes, I believe that was the implied punch-line of the submission. http://mobile.twitter.com/kirindave/status/83252128575004672
http://lambda-the-ultimate.org/node/1836
I am sure there is also a project that uses a haskell->llvm->javascript but I can't find the link at the moment.
Does Haskel ability to solve "hard" problems makes it somehow unfit for solving "easy" problems?
Or, to put it the other way, why do you think it can solve "hard" problems if it can't even solve "easy" problems?
http://www.yesodweb.com/ http://snapframework.com/ http://happstack.com/index.html http://blog.on-a-horse.org/
I am sure there are more.
Also, do you have any examples of these trails Haskell is blazing?
Non-blocking IO is not a new concept. Haskell isn't blazing any particularly new trails. It's a refinement of ideas from functional programming, just like javascript is a refinement of ideas from imperative programming. Also, it's not really javascript that made Node.js possible, it's improved javascript execution performance.
It's just a language. Use whatever solves the problem you have in the way you want it solved.
I think even C++ had one.
i have a bit of experience with twisted and must say it's pretty world class. it has great streaming APIs, really convenient APIs for working with processes, in addition to a solid networking library where you can either build your own protocols or use existing ones.
to say "it failed at scale" is ridiculous. i can point to a number of institutions with plenty of twisted code in production, moving hundreds of GB a day of data.
the only reason it would seem "failed" or "obscure" is that node.js has a huge fad aspect to it where people blog about and evangelize it constantly. most things in software don't have a fraction of the hype or exposure but that's not really due to technical shortcomings or lack of use.
Actually, everybody has libevent and libev bindings. Everybody can get at event-based programming in whatever language they like.
Those are just the highlights. Also, if you're tempted to say "but what about this one library", go check to see if you can find it for Twisted first.
Also, it's worth pointing out that GUIs have been "asynchronous event-based programming" for over 30 years now, and in practice it's hardly any different in programming style than working with Node.js, especially when using a binding to Python, Perl, Tcl, Ruby, etc.
Haskell has one of the few functioning Software Transactional Memorys, and the reason why it works is actually critically based on the nature of Haskell. (Imperative languages have generally been unable to implement them because it turns out to be critical to control effects, and it's just too easy for something to slip in without a type system preventing it.) Haskell has "par": http://www.haskell.org/ghc/docs/7.0.3/html/users_guide/lang-... , section 7.18.4, which is nearly trivial in a pure functional language and a freakishly hairy mess in an imperative language. See also http://hackage.haskell.org/packages/archive/parallel/3.1.0.1... . Data Parallel Haskell is an interesting project in the early stages.
Actually, just watch this video: http://skillsmatter.com/podcast/scala/talk-by-haskell-expert... , which will also (at the end) explain what's interesting about Data Parallel Haskell beyond just "parallel arrays", which has been done; DPH is actually more interesting than that, and also something hard to imagine being implemented in something like Javascript.
To me, Node seems like the first (most?) "natural" way of programming in this style, even if the competition pioneered it. Everybody knows Javascript and lots of people haven't taken a look at your other choices, so it seems to nicely fit that gap in the programming language spectrum.
Thanks for showing off the haskell stuff. I really need to get around to learning that language.
Just as the difference between Java with the JDK and C(++) without any useful standard lib for application development.
Unless you are doing long polling, I am not sure I understand the point of using an evented framework (and even then, it could be debated I guess). It is very hard to code a significant and reliable piece of code with it.
Personally, I think Node.js offers a regressive programming model and I'm concerned about too many peoples diving into it. Ryan Dahl is a very smart guy, doing a nice job and is greatly responsible for the success of Node.js. The rumors goes he would have been tempted to do something with Haskell first but he stepped back as he was not familiar enough with GHC. Actually, that not a rumor, that's what he said: http://bostinnovation.com/2011/01/31/node-js-interview-4-que...
The problem with Haskell is that Haskellers are very smart peoples (...smart peoples again!). They became very comfortable with some hard to grasp concepts for programmers having a more conventional pedigree and might underestimate the education effort required in order to attract more programmers. Most of them are not necessarily focused at creating a more accessible language but rather explore new FP concepts (which is great, BTW). Things need to change in university classes first.
So you have potentially hard to maintain callback code on the node.js side and monad/lazyness/FR to master on the Haskell side. Nevertheless, from a skill-improvement point of view, I think the Haskell option is a much better investment.
Back to my Scala book now... :)
I thank you for posting it here because it has indeed led to interesting discussion. But please consider not editorializing titles in a way that can lead to flame wars.
I'm afraid AccurateFuturePrediction.hs doesn't compile on OSX due to the size limits, so my ability to avoid this sort of gaffe in the future is limited.
Long title would be "Hey you Haskell guys, everybody is thrilled about node.js, why don't you explain how to achieve high scalability in Haskell without sacrificing the program structure. C'mon guys, I know you can!"
If Haskell is leading the way, they should have some response about node.js, right? Whether or not this can be mainstream and deployed everywhere is another question. I totally respect Haskeller position regarding the experimental/research status of the language.
I've heard Node advocates argue that being limited to a single process isn't a problem for scalability because you can just spin up more Node instances... but that's just threading on a different level. You still run into issues coordinating the instances, but now they are going on in your database instead of in your code.
Give Haskell 4 cores and it can do 100k (simple) requests per second in a single application. Node can't do as many, and can't scale a single application across cores. And you don't have to do anything to reap this because the Haskell runtime is non-blocking. The only other (relatively common) language that has non-blocking IO built into the runtime is Erlang.
...time to get to work on that framework...