News for hackers. Stuff that matters.
Re:A Node.js hacker asks what Haskell can do to stay relevant. by jerf on Tuesday June 21, 2011 @06:01PM (#2680618)
Perl has so many that a library was built on top to manage abstracting between them, AnyEvent, which unified support for many event-loop based systems, most notably Glib, Event::Lib, and POE, but quite a few others (and IIRC POE actually outcompeted some other contender that is now dead). Ruby has EventMachine (predates Node.js, not that timeframe though). Tcl was simply built around an event loop, so it isn't even meaningful to talk about which library adds it. Python has Twisted and Stackless Python (which has many of the interesting capabilities that Erlang has at a language level), along with libevent and libev bindings. C also has numerous ones, with corresponding bindings in many languages, glib being one big one. gtk is built on glib, but you can get the glib event loop outside of gtk, and there are real things that use it, like the pidgin core, which is not actually dependent on a UI, only glib.

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.

Re:A Node.js hacker asks what Haskell can do to stay relevant. by gcr on Tuesday June 21, 2011 @10:49PM (#2681464)
Yeah, but.... i mean, it's Perl. EventMachine's HTTP server threw tons of warnings for every request when I used it in early 2010 (and that's actually what drove me to Node in the first place.) Twisted Python is pretty un-pythonic and building a huge webapp in C is usually a mistake.

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.

Re:A Node.js hacker asks what Haskell can do to stay relevant. by cdavid on Wednesday June 22, 2011 @12:29AM (#2681729)
Not having much experience with node.js, what makes it more natural than twisted ? I agree on twisted being unpythonic, but most of what I don't like in twisted seems rather fundamental to (explicit) async programming (callbacks everywhere, lack of meaningful stack traces, error handling extremely tedious).
Re:A Node.js hacker asks what Haskell can do to stay relevant. by jerf on Wednesday June 22, 2011 @02:13PM (#2684373)
"Yeah, but.... i mean, it's Perl."

If you get to play the "yeah, but", believe me, I can "Yeah, but it's Javascript" with just as much justification.

Given the choice between Perl and Javascript as it stands in V8, I'll take Perl in a split second. js.next would be a harder choice, but it's not the one I have.

"Twisted Python is pretty un-pythonic"

So what? Node isn't Pythonic either; is that stopping you? It's a great little talking point, but if you try to unpack it into something sensible there's nothing actually there.

Re:A Node.js hacker asks what Haskell can do to stay relevant. by Uchikoma on Wednesday June 22, 2011 @01:48AM (#2681913)
The difference is Node has an ecosystem of async 3rd party libs for IO drivers etc. Your evented web server is worthless if your IO (DB, File, REST, ...) is sync.

Just as the difference between Java with the JDK and C(++) without any useful standard lib for application development.

Re:A Node.js hacker asks what Haskell can do to stay relevant. by jerf on Wednesday June 22, 2011 @01:54PM (#2684274)
"The difference is Node has an ecosystem of async 3rd party libs for IO drivers etc."

This is also an utterly false and misleading argument. You think these multiple event-based ecosystems were all staffed by drooling idiots who didn't realize that? This isn't some sort of subtle point that can be used as a base of a secret sauce, it's a blindingly-obvious core requirement. They all have drivers for all that sort of thing. Some more than others, but they all have the basics. Many were better stocked with more and higher-quality libraries four years ago than Node.js has now.

This is why I say I hate the Node hype, even as I'm only really ambivalent about Node itself. It's bullshit. It's like Ryan Dahl went into hibernation in 1995, only to pop out again a couple of years ago. It's full of lies about the state of the programming world. Node looks fucking awesome if you uncritically swallow the propaganda packet. Well, gosh, no wonder, it's like a magical 2010-ish library magically showed up in 1995! Node looks "meh" at best, and as I said, heading down a dead-end trail, if you look at where it sits in the real programming landscape in 2011.

Re:A Node.js hacker asks what Haskell can do to stay relevant. by Uchikoma on Wednesday June 22, 2011 @02:19PM (#2684395)
"[...] but they all have the basics."

No. Perl had no async DBC drivers when I wrote Perl code. Netty does not have async JDBC drivers. But then what do I know. But then what do you know, your reply is essentially fact free.

It would help if you point me, e.g. to the 3rd party async IO drivers (JDBC, Redis, MongoDB, File - I have one for HTTP) for Netty.