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

Elixir

 Elixir

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

Plataformatec

November 18, 2012
Tweet

More Decks by Plataformatec

Other Decks in Technology

Transcript

  1. defmodule MyModule do def some_function(foo) do # ... end IO.puts

    "hello" def other_function(bar) do # ... end end elixir Monday, November 19, 2012
  2. :foo - atoms/symbols { 1, 2, 3 } - tuples

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

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

    unless(true, do: exit()) elixir Monday, November 19, 2012
  5. defmodule MathTest do use ExUnit.Case test "basic operations" do assert

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

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

    + 1, 2] } function line args Monday, November 19, 2012
  8. # 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
  9. -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
  10. defimpl JSON, for: List do # ... end elixir defimpl

    JSON, for: Binary do # ... end defimpl JSON, for: Number do # ... end Monday, November 19, 2012
  11. There is no conversion cost for calling Erlang from Elixir

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

    • First-class regular expressions • Zero-index access • ... Monday, November 19, 2012
  13. defmodule MathTest do use ExUnit.Case, async: true test "basic operations"

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

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

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

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

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

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

    6 ... 7 ... 8 ... ExUnit. Runner ExUnit. Formatter run Monday, November 19, 2012
  20. 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
  21. 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
  22. • 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