Elixir

7c12adb8b5521c060ab4630360a4fa27?s=47 Plataformatec
November 18, 2012

 Elixir

This talk highlights the reason, goals and roadmap behind Elixir, http://elixir-lang.org

7c12adb8b5521c060ab4630360a4fa27?s=128

Plataformatec

November 18, 2012
Tweet

Transcript

  1. @elixirlang / elixir-lang.org Monday, November 19, 2012

  2. @josevalim Monday, November 19, 2012

  3. Monday, November 19, 2012

  4. Why? Monday, November 19, 2012

  5. case #1 Monday, November 19, 2012

  6. Switch Switch Monday, November 19, 2012

  7. Switch Browser Endpoint Server Monday, November 19, 2012

  8. Server Browser Monday, November 19, 2012

  9. •Web sockets •API streaming •Server sent events Server Monday, November

    19, 2012
  10. case #2 Multi-core Monday, November 19, 2012

  11. Server Server Server Server Monday, November 19, 2012

  12. 50 cores $2600 Monday, November 19, 2012

  13. Server Monday, November 19, 2012

  14. case #3 Doing it live! Monday, November 19, 2012

  15. http://blog.whatsapp.com/index.php/2012/01/1-million-is-so-2011/ 2 million connections on a single node Monday, November

    19, 2012
  16. http://stackoverflow.com/questions/1636455/where-is-erlang-used-and-why Monday, November 19, 2012

  17. Goals Monday, November 19, 2012

  18. goal #1 Productivity Monday, November 19, 2012

  19. Everything is an expression Monday, November 19, 2012

  20. -module(my_module). some_function(Foo) -> % ... other_function(Bar) -> % ... erlang

    Monday, November 19, 2012
  21. -module(my_module). % won’t compile io:put_chars("hello"). some_function(Foo) -> % ... other_function(Bar)

    -> % ... erlang Monday, November 19, 2012
  22. defmodule MyModule do def some_function(foo) do # ... end IO.puts

    "hello" def other_function(bar) do # ... end end elixir Monday, November 19, 2012
  23. Macros Monday, November 19, 2012

  24. :foo - atoms/symbols { 1, 2, 3 } - tuples

    [ 1, 2, 3 ] - lists Monday, November 19, 2012
  25. is_atom(:foo) function line args atom { :is_atom, 1, [:foo] }

    Monday, November 19, 2012
  26. 1 + 2 function line args { :+, 1, [1,2]

    } Monday, November 19, 2012
  27. defmacro unless(expr, opts) do quote do if(!unquote(expr), unquote(opts)) end end

    unless(true, do: exit()) elixir Monday, November 19, 2012
  28. Domain Specific Languages Monday, November 19, 2012

  29. defmodule MathTest do use ExUnit.Case test "basic operations" do assert

    1 + 1 == 2 end end elixir Monday, November 19, 2012
  30. defmodule MathTest do use ExUnit.Case def test_basic_operations do assert 1

    + 1 == 2 :ok end end elixir Monday, November 19, 2012
  31. assert 1 + 1 == 2 { :==, 5, [1

    + 1, 2] } function line args Monday, November 19, 2012
  32. # assert 1 + 1 == 2 defmacro assert({ :=~,

    line, [l,r] }) do # ... end defmacro assert({ :==, line, [l,r] }) do # ... end defmacro assert(default) do # ... end Monday, November 19, 2012
  33. goal #2 Extensibility Monday, November 19, 2012

  34. -module(json). to_json(Item) when is_list(Item) -> % ... to_json(Item) when is_binary(Item)

    -> % ... to_json(Item) when is_number(Item) -> % ... erlang Monday, November 19, 2012
  35. Protocols Monday, November 19, 2012

  36. defprotocol JSON do def to_json(item) end JSON.to_json(item) elixir Monday, November

    19, 2012
  37. defimpl JSON, for: List do # ... end elixir defimpl

    JSON, for: Binary do # ... end defimpl JSON, for: Number do # ... end Monday, November 19, 2012
  38. defimpl JSON, for: Array do # ... end elixir Monday,

    November 19, 2012
  39. goal #3 Compatibility Monday, November 19, 2012

  40. Monday, November 19, 2012

  41. DISTRIBUTED FAULT-TOLERANT APPLICATIONS WITH HOT-CODE SWAPPING Monday, November 19, 2012

  42. There is no conversion cost for calling Erlang from Elixir

    and vice-versa Monday, November 19, 2012
  43. • UTF-8 binaries strings • Keyword arguments • First-class documentation

    • First-class regular expressions • Zero-index access • ... Monday, November 19, 2012
  44. Example Monday, November 19, 2012

  45. defmodule MathTest do use ExUnit.Case, async: true test "basic operations"

    do assert 1 + 1 == 2 end end elixir Monday, November 19, 2012
  46. 1 MathTest 2 SystemTest 3 ... 4 ... 5 ...

    6 ... 7 ... 8 ... ExUnit. Runner ExUnit. Formatter Monday, November 19, 2012
  47. 1 MathTest 2 SystemTest 3 ... 4 ... 5 ...

    6 ... 7 ... 8 ... ExUnit. Runner run ExUnit. Formatter Monday, November 19, 2012
  48. 1 MathTest 2 SystemTest 3 ... 4 ... 5 ...

    6 ... 7 ... 8 ... ExUnit. Runner run ExUnit. Formatter Monday, November 19, 2012
  49. 1 MathTest 2 SystemTest 3 ... 4 ... 5 ...

    6 ... 7 ... 8 ... ExUnit. Runner run ExUnit. Formatter Monday, November 19, 2012
  50. 1 MathTest 2 SystemTest 3 ... 4 ... 5 ...

    6 ... 7 ... 8 ... ExUnit. Runner done ExUnit. Formatter info Monday, November 19, 2012
  51. 1 MathTest 2 SystemTest 3 ... 4 ... 5 ...

    6 ... 7 ... 8 ... ExUnit. Runner ExUnit. Formatter run Monday, November 19, 2012
  52. 127.0.0.9 127.0.0.3 1 MathTest 2 SystemTest 3 ... 4 ...

    5 ... 6 ... 7 ... 8 ... ExUnit. Runner ExUnit. Formatter Monday, November 19, 2012
  53. 127.0.0.9 127.0.0.3 1 MathTest 2 SystemTest 3 ... 4 ...

    5 ... 6 ... 7 ... 8 ... ExUnit. Runner ExUnit. Formatter ExUnit. Supervisor Monday, November 19, 2012
  54. Roadmap Monday, November 19, 2012

  55. • v0.6 (Aug/12) Erlang language compatibility • v0.8 (Dec/12) Erlang

    apps support • Dynamo (xx/13) Web framework • v0 (Jan/11) Monday, November 19, 2012
  56. Monday, November 19, 2012

  57. @elixirlang / elixir-lang.org Monday, November 19, 2012