Intro to Erlang

5,448 views
5,165 views

Published on

(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.

Published in: Technology, News & Politics
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,448
On SlideShare
0
From Embeds
0
Number of Embeds
80
Actions
Shares
0
Downloads
162
Comments
0
Likes
13
Embeds 0
No embeds

No notes for slide

























  • Intro to Erlang

    1. 1. Intro to Erlang May 19, 2009 Ken Pratt http://kenpratt.net/
    2. 2. What is Erlang? + = Open Source
    3. 3. History Created in ’86 Open-sourced in ’98 “Programming Erlang” published in ’07 Taking off in popularity (3 more books on the way)
    4. 4. Ruby killer? Absolutely not!
    5. 5. The philosophy Simple language Ultra-lightweight concurrency No shared state (and no locks, no mutexes) <3 asynchronous message passing Processes should be able to run forever
    6. 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
    7. 7. Silly code example
    8. 8. Architecture = light-weight process with a built-in mailbox
    9. 9. Distributed architecture = light-weight process with a built-in mailbox
    10. 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. 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. 12. So what? Who the hell would use this obscure functional crap?
    13. 13. Highly-concurrent phone switching servers 99.9999999% uptime (~3ms down/year) Soft real-time characteristics Fault tolerant
    14. 14. Facebook Chat backend 7+ million active chat channels at peak ~100 servers (= 700,000 channels/server) AJAX + Comet (long-polling)
    15. 15. Amazon SimpleDB Schema-less database
    16. 16. IM client integration ejabberd (Erlang Jabber service)
    17. 17. Chat room polling in Campfire 283 LoC 1500 req/sec
    18. 18. ...and many more
    19. 19. Ruby + Erlang They can work together
    20. 20. Katamari/Fuzed Rails server clustering Erlang bindings for Rails YAWS web server
    21. 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. 22. Erlectricity “Real” Erlang/Ruby interaction Bi-directional communication using Erlang’s binary format Erlang treats Ruby processes as “just another” Erlang process
    23. 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. 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
    25. 25. Erlang meetup http://www.meetup.com/erlang-vancouver First meetup in mid-to-late June “Intro to Erlang Programming”(?) Definitely won’t conflict with Ruby meetup Thanks!

    ×