Live data from Hacker News

"Ruby developers need to stop using EventMachine. It's the wrong direction."

slideshare.net

41–50 of 72 posts

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#41
post #19
post #4

We write a lot of EventMachine code here; I have some questions. He writes: EventMachine is • A frankenstein guts the ruby internals • Not in active development • Makes non-blocking IO block • Requires special code from Ruby libraries • Hard to use in an OOP way • Is really difficult to work with • Poorly documented I'm not sure I understand how EventMachine "guts the Ruby internals" (I didn't watch the talk). It's tr…

> I'm not sure I understand how EventMachine "guts the Ruby internals" EventMachine does not use the Ruby IO primitives (e.g. TCPSocket, UDPSocket, etc) as the basis of its IO abstraction, and instead has reimplemented its own set of primitives for doing IO. Because of this it can't take advantage of work being done in Ruby core to advance Ruby's socket layer. For this reason IPv6 support langered, among other proble…

> ... Compare to Twisted, which is built on libevent, or to Node, which is built on libev/libuv

Or compared to AnyEvent which works with [m]any event loop - https://metacpan.org/module/AnyEvent

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#42

If you really like evented programming, use node. Everything there is evented. I tried EventMachine and it just felt worse than node, documentation is worse, libraries are worse, it just wasn't a whole lot of fun. I haven't tried celluloid yet, but I've learned one lesson building things with PHP, Ruby, Python, Node, Java, Scala, etc. That lesson is to use tools with a community of people around it that are using tho…

Well actually, the JVM is probably the most potent platform when it comes to async I/O, not only because the standard nio library and the high-level wrappers, like Netty and Mina, are very mature, but also because you can compose blocking and non-blocking pieces of functionality like you cannot do with Node / V8.

Checkout Akka, it's awesome: http://akka.io/

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#43
post #39
post #10

Earlier quoted context omitted.

Real evented code isn't a series of onRead/onWrite callbacks, because real evented code buffers strategically, and abstracts itself into state machines with simple callback interfaces, so that the rest of the program can be written in terms of higher level events. I don't want to turn this into "events work for every program", because like I said above: I don't think event interfaces work for all kinds of programs. I…

I don't see the "evented runtime vs. evented API" issue as boring. This kind of thing is the core of any application you are going to build; it's hardly a minor or nitpicky issue. Using non-blocking APIs requires you to turn your application "inside out", putting state that would normally have been on the stack into a state machine. You wind up in a maze of callbacks and low-level details. This kind of thing might be…

It forces you to keep your methods short with reasonably appropriate boundaries between them. Good programmers should be doing this anyway, but an event/callback API at least prevents you from writing a 300-line "do everything" method.

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#44

If you really like evented programming, use node. Everything there is evented. I tried EventMachine and it just felt worse than node, documentation is worse, libraries are worse, it just wasn't a whole lot of fun. I haven't tried celluloid yet, but I've learned one lesson building things with PHP, Ruby, Python, Node, Java, Scala, etc. That lesson is to use tools with a community of people around it that are using tho…

For event programming I use AnyEvent (Perl) the so called DBI of event loop programming.

It's well documented, straightforward to use, robust and works seamlessly on top of many event loops (libev, libevent, Glib, Tk and more).

And I just need to look at AnyEvent::* namespace on CPAN to see what can be run with it - http://search.cpan.org/search?query=anyevent%3A%3A*&mode... (currently lists 630 modules)

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#45
post #16

Earlier quoted context omitted.

I wonder why nobody ever talks about drb, a distributed system that ships with ruby. It's active in Japan, and there has been an effort to make it better known in the rest of the world with a book dedicated to the topic in english (published by Pragmatic Programmers). Still, it hasn't stirred much interest. Even if it's less advanced than DCell, it's still a recommended way to start learning about distributed computi…

Hello, author of Celluloid here. I think DRb pretty cool and has long been underutilized. That said, there are a few fundamental design problems with the way it works that I think DCell solves: 1. Distributed systems really need to be built on top of asynchronous protocols, and DRb is a direct mapping of a synchronous method dispatch protocol onto a distributed systems protocol. Similar attempts at this include: CORB…

As an aside; Celluloid is awesome and you really made concurrent programming in Ruby better by releasing it :)

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#46
post #2

I've looked at Celluloid. It offers a much nicer paradigm than eventmachine. It also provides a nice way to distribute actors over multiple machines (DCell). I strongly agree with this slidedeck. Callback muck is maddening.

I wonder why nobody ever talks about drb, a distributed system that ships with ruby. It's active in Japan, and there has been an effort to make it better known in the rest of the world with a book dedicated to the topic in english (published by Pragmatic Programmers). Still, it hasn't stirred much interest. Even if it's less advanced than DCell, it's still a recommended way to start learning about distributed computi…

I'm not a Ruby developer, but it looks to me that using drb when there's Celluloid is like using asyncore when there's Twisted, in Python.

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#47
post #19
post #4

We write a lot of EventMachine code here; I have some questions. He writes: EventMachine is • A frankenstein guts the ruby internals • Not in active development • Makes non-blocking IO block • Requires special code from Ruby libraries • Hard to use in an OOP way • Is really difficult to work with • Poorly documented I'm not sure I understand how EventMachine "guts the Ruby internals" (I didn't watch the talk). It's tr…

> I'm not sure I understand how EventMachine "guts the Ruby internals" EventMachine does not use the Ruby IO primitives (e.g. TCPSocket, UDPSocket, etc) as the basis of its IO abstraction, and instead has reimplemented its own set of primitives for doing IO. Because of this it can't take advantage of work being done in Ruby core to advance Ruby's socket layer. For this reason IPv6 support langered, among other proble…

At least 2 years ago, twisted did not use libevent, it was mostly pure python except for a very tiny piece of code (and optional stuff of course).

I am sure you could write a libevent-based reactor, but twisted was started a long time ago (10 years ? The twisted book in o'Reilly was published in 2005), before libevent existed I think.

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#48

If you really like evented programming, use node. Everything there is evented. I tried EventMachine and it just felt worse than node, documentation is worse, libraries are worse, it just wasn't a whole lot of fun. I haven't tried celluloid yet, but I've learned one lesson building things with PHP, Ruby, Python, Node, Java, Scala, etc. That lesson is to use tools with a community of people around it that are using tho…

Well actually, the JVM is probably the most potent platform when it comes to async I/O, not only because the standard nio library and the high-level wrappers, like Netty and Mina, are very mature, but also because you can compose blocking and non-blocking pieces of functionality like you cannot do with Node / V8. Checkout Akka, it's awesome: http://akka.io/

There are very few libraries.

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#49

Earlier quoted context omitted.

Well actually, the JVM is probably the most potent platform when it comes to async I/O, not only because the standard nio library and the high-level wrappers, like Netty and Mina, are very mature, but also because you can compose blocking and non-blocking pieces of functionality like you cannot do with Node / V8. Checkout Akka, it's awesome: http://akka.io/

There are very few libraries.

Are you trying to say that there are very few libraries for something that runs on the JVM?

Re: "Ruby developers need to stop using EventMachine. It's the wrong direction."

#50
There's a fork out there called EventMachine-LE, which is currently in active development for latest features (i.e. IPv6). https://github.com/ibc/EventMachine-LE

Anyway, just wanted to throw it out there that I've deployed several production apps (gaming/messaging servers) using EventMachine, and combined with em-synchrony, I'm pretty comfortable with its performance and limitations. There seems to be good community support (thanks to Ilya Grigorik's articles and em-synchrony) with plenty of examples/documentations.

Just wondering, are there any people out there with Celluloid app experience that's currently in production? Like any other geek, I love programming "the right way" but I know nothing about Celluloid and it's real-world benefits/drawbacks (performance, API, code maintainability, code documentation, community support, blog articles, etc).

Post reply on HN