7 ms·
A Node.js hacker asks what Haskell can do to stay relevant.
- jinushaun 15y agoI didn't know they were competing. Reminds me of Rails v Django articles.
- mnutt 15y agoMaybe I'm being to generous in reading it, but I took the original question as "I'm familiar with Node and the problems it solves. I'm interested in Haskell; can it solve those same problems?"
- fleitz 15y agoThe Church-Turing thesis says that problems solvable by a UTM are also solvable by lambda-calculus. So yes, any problem that can be solved in javascript can also be solved in haskell.
- glenjamin 15y agoThis is a flawed argument, the problems that higher level languages solve are those of organisation and program structure.
- scott_s 15y agoWhich, while true, is about as helpful as answering "Yes." to the question "Do you know what time it is?".
- fleitz 15y agoWhich is about as helpful an answer as you can get when you ask if a 'language' (haskell) solves the same problems as an 'API' (node)
- mnutt 15y agoNo, it's about as unhelpful an answer as you can get. Why would you even bother? Would you answer him the same way in person if he came to a Haskell meetup?
- exDM69 15y agoThis is not really about the Haskell language, but rather the GHC compiler and runtime that implement the language. What the GHC runtime does is somewhat comparable to what Node.js does.
- scarmig 15y agoBy the same token, any problem that can be solved in javascript can also be solved in CSS3+HTML or brainfuck. ...time to get to work on that framework...
- micmcg 15y agoCSS3 + HTML isn't Turing complete
- deleted 15y ago[deleted]
- olalonde 15y agoAren't Rails and Django competing? I'd hope so...
- SlyShy 15y agoAnswer: if you know Haskell you don't have to run scared from threading, because threading really isn't so hard. 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.
- mnutt 15y agoIf you're eventually going to hit the upper limit of a single machine, have you really gained that much? Eventually you'll have to figure out a way to coordinate between processes, because some will be running on other nodes.
- wunderfool 15y agouse erlang
- nickik 15y agoI think distributed computing is not a language problem. If you solve the problem on one computer its allready a big help if you build a distributed system.
- jerf 15y agoUh... it's very much the other way around. Haskell's building the future of concurrency, even if it isn't going to be "the language" of 2020, and Node.js is a throwback to late-1990s to early-2000s solutions that repeated and consistently failed to work at scale, with no real chance that Node.js is going to escape the same fate any more than the several dozen event-based frameworks based on languages very similar to Javascript before it did. (If the manually-compiled event callbacks, cooperative-multithreading scheduling approach was going to be the Next Big Thing, it would have happened years ago.) It's Node.js that needs to worry about how it's going to "stay relevant" as it walks a dead-end path, not Haskell as it blazes (relatively) new trails.
- benihana 15y agoDo you have any examples of these late 90s early 00s solutions that consistently failed to work at scale? Can you point me to any of the 'several dozen' event-based frameworks before JavaScript did it? I don't seem to remember these very well, and if Node.js is just a throwback, I'd love to see what it was a throwback of. Also, do you have any examples of these trails Haskell is blazing?
- samstokes 15y agoTwisted Python and Ruby's EventMachine would both be examples of evented IO frameworks that predate Node.js's popularity, and possibly even its development. I think even C++ had one.
- unshift 15y agoC++ has asio, now part of boost. 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.
- sharmajai 15y agohttp://qconlondon.com/dl/qcon-london-2011/slides/GregoryCollins_HighPerformanceWebApplicationsInHaskell.pdf http://qconlondon.com/dl/qcon-london-2011/slides/GregoryColl... is about this exactly. He explains why Haskell's green threads are better than Node's callback driven model.
- gawi 15y agoThis is funny. I'm the person having submitted the question on StackOverflow. KirinDave just assumed I was a Node.js hacker (which is absolutely not true!). I really wanted to understand how Haskell is planning to attack the >10k-100k connections problem. The question was just an excuse to talk about the Haskell-way. 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-questions-with-creator-ryan-dahl/ 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... :)
- KirinDave 15y agoI did just assume, and I apologize if that is offensive to you. But you have to admit, this title is pretty provocative. ;)
- jamesbritt 15y agoBut the SO post says nothing about anything "staying relevant." It's simply, "What is the Haskell response to Node.js?" with some follow-up.
- nandemo 15y agoDave, I had seen the Stackoverflow post before so I was surprised when I clicked the link here and got there, because your title misrepresents the question. 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.
- jessedhillon 15y agoThis post affirms for me, yet again, that the people who think Node.js represents a notable, significant improvement over current tools are noobs.
- gregwebs 15y agoThe SO question and many of these comments are ridiculous because Haskell has already solved this issue in a much better way. Here is the benchmark: http://www.yesodweb.com/blog/2011/03/preliminary-warp-cross-language-benchmarks http://www.yesodweb.com/blog/2011/03/preliminary-warp-cross-... 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.