Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rubyists! Have a sip of Elixir!

Rubyists! Have a sip of Elixir!

This talk is about Elixir – a functional, meta-programming aware language built on top of the Erlang VM.

I introduce some of Elixir's more interesting language features. Then I will demonstrate some of the features that Erlang gives Elixir for free, such as the OTP framework, that let's you build fault tolerant and distributed systems.

So come along and join me to experience programming joy.

Benjamin Tan Wei Hao

November 18, 2014
Tweet

More Decks by Benjamin Tan Wei Hao

Other Decks in Programming

Transcript

  1. Rubyists: Have a sip of Elixir RUBYCONF | 18 Nov

    2014 | SAN DEIGO BENJAMIN TAN WEI HAO @BENTANWEIHAO
  2. iex

  3. mix

  4. 1. is a Process 2. performs a specific task 3.

    can send and receive a message An Actor:
  5. 1. is a Process 2. performs a specific task 3.

    can send and receive a message 4. responds to specific types of messages An Actor:
  6. 1. is a Process 2. performs a specific task 3.

    can send and receive a message 4. responds to specific types of messages 5. no shared memory with other processes An Actor:
  7. .

  8. The Protocol Coordinator Process n = 3 # = 0

    Coordinator: I need to handle 3 workers. I have received messages from 0 workers.
  9. The Protocol Coordinator Process Worker Process send ,{:ok,5000} Worker: Hey

    Coordinator, yahoo.com took 5000 msecs. <0.81.0> n = 3 # = 0
  10. The Protocol Coordinator Process Worker Process send ,{:error, :404} Worker:

    Hey Coordinator, yahoo.com errored out. <0.83.0> n = 3 # = 1
  11. n = 3 # = 3 BASE CASE: ! !

    ! ! ! ! PROCESSED WORKERS == NUMBER OF WORKERS SAME VALUE!
  12. Running the program n = 3 # = 3 RESULT:

    2 succeeded, 1 failure.
  13. HEATHER MILLER for the slide designs I stole. Credits My

    HUI LING, for letting me ignore her. http://misterjazzz.deviantart.com/art/Constructicons-with-Prowl-C-446618997 http://thisotplife.tumblr.com http://battlefordreamisland.wikia.com/ Image Credits Network by Brennan Novak from The Noun Project Fork by Dmitry Baranovskiy from The Noun Project