$30 off During Our Annual Pro Sale. View Details »

Update from the Elixir team - 2018

Update from the Elixir team - 2018

Andrea Leopardi

May 31, 2018
Tweet

More Decks by Andrea Leopardi

Other Decks in Programming

Transcript

  1. Update from the Elixir team
    elixir-lang.org

    View Slide

  2. @whatyouhide

    View Slide

  3. View Slide

  4. View Slide

  5. weedmaps.com/careers

    View Slide

  6. Elixir v1.0
    Sep 2014
    > 180 contributors

    View Slide

  7. Elixir v1.6
    Jan 2018
    > 730 contributors

    View Slide

  8. • Follow two- to three-part commands: "Put your book
    away, brush your teeth, and then get in bed."
    • Recognize familiar word signs such as "STOP"
    • Better understand the concept of time
    • Count ten or more objects
    • Correctly name at least four colors and three shapes
    Elixir 1.0 is almost 4yo

    View Slide

  9. Release every 6 months
    v1.5 → mid 2017
    v1.6 → beg 2018
    v1.7 →

    View Slide

  10. IMPROVEMENTS IN v1.6

    View Slide

  11. View Slide

  12. Code formatter

    View Slide

  13. def foo (
    a, b ) do a+ b
    end
    def foo(a, b) do
    a + b
    end

    View Slide

  14. Feature complete
    formats code
    is configurable (for some things)
    supports formatting entire Mix projects (.formatter.exs)

    View Slide

  15. View Slide

  16. Dynamic supervisor

    View Slide

  17. simple_one_for_one
    confusing/mixed API
    documentation

    View Slide

  18. opts = [strategy: :one_for_one]
    {:ok, sup} = DynamicSupervisor.start_link(opts)
    DynamicSupervisor.start_child(
    sup,
    {Agent, fn -> %{} end}
    )

    View Slide

  19. "Just like simple_one_for_one but actually simple"

    View Slide

  20. Documentation

    View Slide

  21. @deprecated/@since
    @doc "Breaks a collection into chunks"
    @since "1.0.0"
    @deprecated "Use chunk_every/2 instead"
    def chunk(collection, chunk_size) do
    chunk_every(collection, chunk_size)
    end

    View Slide

  22. @deprecated/@since
    @doc "Breaks a collection into chunks"
    @since "1.0.0"
    @deprecated "Use chunk_every/2 instead"
    def chunk(collection, chunk_size) do
    chunk_every(collection, chunk_size)
    end

    View Slide

  23. @deprecated/@since
    @doc "Breaks a collection into chunks"
    @since "1.0.0"
    @deprecated "Use chunk_every/2 instead"
    def chunk(collection, chunk_size) do
    chunk_every(collection, chunk_size)
    end

    View Slide

  24. Library guidelines

    View Slide

  25. Compatibility table with Erlang/OTP

    View Slide

  26. Table of deprecations

    View Slide

  27. UX

    View Slide

  28. --slowest N
    $ mix test --slowest 2
    Finished in 1.4 seconds
    Top 3 slowest (0.9s), 61.0% of total time:
    * test client suicide (602.8ms) (RedixTest)
    * test unable to connect (201.2ms) (RedixTest)
    * test timeouts (101.8ms) (RedixTest)

    View Slide

  29. 10-20% compilation speedup with OTP21
    definitely thanks to us

    View Slide

  30. defguard

    View Slide

  31. defguard is_drinking_age(age) when age >= 21
    def serve_drink(%User{age: age})
    when is_drinking_age(age) do
    # Serve the drink
    end

    View Slide

  32. FUTURE

    View Slide

  33. View Slide

  34. StreamData
    data generation
    property-based testing
    +

    View Slide

  35. Enum.take(StreamData.integer(), 2)
    #=> [1, -2]

    View Slide

  36. use ExUnitProperties

    property "bin1 <> bin2 always starts with bin1" do
    check all bin1 <- binary(),
    bin2 <- binary() do
    assert String.starts_with?(bin1 <> bin2, bin1)
    end
    end

    View Slide

  37. only stateless testing...
    ...but discussion started
    for stateful testing

    View Slide

  38. __STACKTRACE__

    View Slide

  39. try do
    apply(mod, fun, args)
    catch
    :error, val ->
    {:error, {val, __STACKTRACE__}}
    end

    View Slide

  40. Configuration and releases

    View Slide

  41. Solve problems with Mix.Config
    Streamline releases and integrate with Mix

    View Slide

  42. Docs chunk

    View Slide

  43. EEP 48
    documentation storage and format

    View Slide

  44. Standard API for all BEAM languages
    Access to docs in the shell
    +
    (Elixir already has this)

    View Slide

  45. RESEARCH PROJECTS

    View Slide

  46. Google Summer of Code

    View Slide

  47. StreamData + typespecs

    View Slide

  48. Enum.take(from_type(timeout/0), 3)
    #=> [0, :infinity, 927]
    @type timeout() :: non_neg_integer() | :infinity

    View Slide

  49. check all arg1 <- from_type(timeout/0) do
    result = my_fun(arg1)
    assert is_integer(result)
    end
    @spec my_fun(timeout()) :: integer()

    View Slide

  50. ElixirBench

    View Slide

  51. mix dialyzer

    View Slide

  52. TensorflEx: Tensorflow bindings for Elixir

    View Slide

  53. github.com/elixir-lang/elixir

    View Slide

  54. elixir-lang.org

    View Slide