(Given to the Vancouver Erlang and Ruby/Rails Meetup groups on May 19, 2009.)
Erlang is an up-and-coming language on the web scene. New libraries and frameworks are sprouting up at a rampant rate, and web giants Facebook and Twitter are using it to develop highly-scalable web applications.
This talk will introduce Erlang as a language and platform, summarize its strengths and weaknesses, and cover how you can use Erlang and Ruby together to conquer the web frontier.
Speaker Bio:
Ken Pratt has been developing software for the web for over 10 years. He fell in love with Ruby four years ago, but is still passionate about learning other languages and platforms. He has developed scalable web services for Electronic Arts, built Rails-based web applications since pre-1.0, and been featured in interactive art installations.
6. The language
Functional
Strong, dynamic typing
NO shared state(!!) (and no mutable variables)
Pattern matching on steroids
<3 tail recursion
Compiled to bytecode, runs on VM
10. Concurrent programming
It is VERY easy to turn procedural code into concurrent
code (as long as you follow conventions)
Code with race conditions either goes in a singleton
process or in a transaction in Mnesia
It is harder to write distributed applications, but still
much, much easier than most platforms (primarily due
to no shared state, no locks, no synchronization, etc...)
11. Libraries
Native and “OTP” libraries do all the concurrency heavy
lifting for you
Supervisor trees
Mnesia distributed database
Web frameworks (Nitrogen, Webmachine)
JSON!
12. So what?
Who the hell would use
this obscure functional crap?
21. Nanite
A “self-assembling cluster of Ruby daemons”
Daemons can be anything small or large, including a
Rails server or map/reduce tasks
RabbitMQ handles the distributed stuff
22. Erlectricity
“Real” Erlang/Ruby interaction
Bi-directional communication using Erlang’s binary
format
Erlang treats Ruby processes as “just another” Erlang
process
23. BUT
“Use the right tool for the right job.”
Erlang is great for distributed services...
...but Ruby is still king for expressing business logic.
24. Where to start
“Programming Erlang”
by Joe Armstrong
(creator of Erlang)
Slides & videos online!
(I’ll post the link to the mailing list)
http://www.erlang-factory.com/
conference/SFBayAreaErlangFactory2009