Hacker News new | ask | show | jobs
How Erlang Makes Event-Driven Code Easy (needlesslymessianic.com)
11 points by mindaugas 5912 days ago
1 comments

I've been deep in this world for the past few weeks, as I've spent my spare time more-or-less implementing an event system for Ruby... partly because Thin doesn't work on JRuby, and partly because EventMachine is almost totally undocumented. And it doesn't play too well with other multithreaded code on the same VM.

The performance of the Rack bit is on a par with Thin, even without an optimized request or response parser, and I've got about 1/6 the code of just EventMachine alone. But I digress.

While I've come up with a few solutions to the 'breaking code into little chunks' problem, nothing really beats having event-driven I/O built into the runtime, and nothing has driven that point home better than implementing an event system

And yeah, I'll be open-sourcing it in the near future... want to mop up some of the internals a bit, add MRI support, and finish stealing every spec and unit test that I can from other Rack webservers.

Part of me really wants to just write a Ruby-like language that has Erlang-like concurrency features, but that's a project for later.
There already is a project, Reia http://wiki.reia-lang.org/wiki/Reia_Programming_Language, which implements a Ruby like language on the Erlang VM.
Depending on what you like from Ruby, you could also check out Lisp Flavored Erlang at http://github.com/rvirding/lfe. IIRC Virding was one of the original creators of Erlang.