A Completely Unbiased Showcase of Elixir

A Completely Unbiased Showcase of Elixir

Faafc04d9e69b73b9f49995fd4c94d4d?s=128

Andrea Leopardi

September 09, 2016
Tweet

Transcript

  1. UNBIASED A COMPLETELY SHOWCASE OF ELIXIR

  2. None
  3. L F E OVEABLE, UN RLANG

  4. ERLANG FOR HIPSTERS 2.0?

  5. javascript/coffescript java/clojure javascript/elm

  6. javascript/coffescript java/clojure javascript/elm ✓

  7. .BEAM

  8. 1.0 September 2014 1.3 September 2016

  9. GOOD STUFF IMPROVABLE STUFF ELIXIR + ERLANG

  10. @whatyouhide

  11. FOOTBALL ADDICTS

  12. GOOD STUFF IMPROVABLE STUFF ELIXIR + ERLANG

  13. GOOD STUFF IMPROVABLE STUFF ELIXIR + ERLANG

  14. STANDARD LIBRARY

  15. STREAMS

  16. STREAMS "foo.txt" |> File.stream! |> Stream.map(...) |> Stream... |> Enum.to_list

  17. METAPROGRAMMING

  18. defmacro unless(cond, expr) do quote do if !unquote(cond) do unquote(expr)

    end end end
  19. defmacro unless(cond, expr) do quote do if !unquote(cond) do unquote(expr)

    end end end
  20. STRUCTS "official" data types

  21. defmodule User do defstruct [:name, :age] end %User{name: "Meg", age:

    33}
  22. PROTOCOLS

  23. JSON encoding json:encode({user, ...}) user:encode({...})

  24. JSON encoding defprotocol JSON do def encode(_) end defimpl JSON,

    for: User do def encode(user), do: ... end
  25. ExUnit test "send/2" do send(self(), {:ok, 1}) assert_receive {:ok, _}

    end
  26. ExUnit test "send/2" do send(self(), {:ok, 1}) assert_receive {:ok, _}

    end
  27. tagging diff --stale

  28. None
  29. --stale don't run stale stinky tests

  30. INTEROP WITH ERLANG for doing Real Work™

  31. lists:map(fun(X) -> X + 1 end, [1, 2, 3]) :lists.map(fn(x)

    -> x + 1 end, [1, 2, 3])
  32. Enum.shuffle([1, 2, 3]) 'Elixir.Enum':shuffle([1, 2, 3])

  33. MIX

  34. DOCUMENTATION @doc """ Performs command """ def command(c), do: ...

  35. DOCUMENTATION

  36. ONBOARDING Getting Started guide Resources (books, ...) Error messages

  37. ECOSYSTEM Phoenix Nerves Ecto, Plug, GenStage, ...

  38. COMMUNITY

  39. GOOD STUFF IMPROVABLE STUFF ELIXIR + ERLANG

  40. DIALYZER

  41. PROPERTY-BASED TESTING

  42. USING ELIXIR FROM ERLANG

  43. GOOD STUFF IMPROVABLE STUFF ELIXIR + ERLANG

  44. just an app

  45. WHICH ONE DO I USE ELIXIR ELIXIR ELIXIR ELIXIR ELIXIR

    ELIXIR ELIXIR
  46. APPRECIATE BOTH

  47. POSSIBLE RULE OF THUMB libraries in Erlang (if they wouldn't

    benefit from Elixir features) apps in Elixir /
  48. hex.pm Erlang + Elixir

  49. GOOD STUFF IMPROVABLE STUFF ELIXIR <3 ERLANG STDLIB EXUNIT METAPROGRAMMING

    PROTOCOLS MIX DOCS ECOSYSTEM DIALYZER PROPERTY-BASED TESTS ELIXIR FROM ERLANG USE BOTH SHARE ON HEX BE NICE
  50. @whatyouhide