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

Update from the Elixir team - 2022

Update from the Elixir team - 2022

Andrea Leopardi

May 20, 2022
Tweet

More Decks by Andrea Leopardi

Other Decks in Programming

Transcript

  1. Elixir
    Update from the
    core team
    May 2022

    View Slide

  2. Andrea Leopardi
    @whatyouhide
    Elixir core team,


    engineer for 

    View Slide

  3. Recap
    Every 6 months (May, Nov)
    Non-breaking versions (1.x)

    View Slide

  4. 1.13

    View Slide

  5. 1.13
    December 2021
    Focused on developer experience

    View Slide

  6. 1.13
    Semantic recompilation
    mix xref improvements
    Code.Fragment
    Formatter plugins

    View Slide

  7. 1.13
    defmodule MixMarkdownFormatter do


    @behaviour Mix.Tasks.Format


    def features(_opts) do


    [sigils: [:M], extensions: [".md", ".markdown"]]


    end


    def format(contents, opts) do


    # ...


    end


    end

    View Slide

  8. 1.13
    # In .formatter.exs


    [


    plugins: [MixMarkdownFormatter],


    inputs: [...]


    ]

    View Slide

  9. View Slide

  10. 1.14

    View Slide

  11. June 2022
    Requires OTP 23+
    1.14

    View Slide

  12. PartitionSupervisor
    1.14

    View Slide

  13. Application


    supervisor
    Bottleneck


    process
    1.14

    View Slide

  14. Application


    supervisor
    Bottleneck


    process
    1.14
    PartitionSupervisor
    Bottleneck


    process
    Bottleneck


    process

    View Slide

  15. children = [


    {PartitionSupervisor,


    child_spec: {ErrorReporter, []},


    name: Reporters}


    ]
    1.14

    View Slide

  16. def report_error(err) do


    ErrorReporter.report(


    {:via, PartitionSupervisor, {Reporters, self()}},


    err


    )


    end
    1.14

    View Slide

  17. Slicing with steps
    1.14

    View Slide

  18. 1.14
    1..10//2

    View Slide

  19. 1.14
    Enum.slice(~w(a b c d e f g h), 1..4//2)


    #=> ["b", "d"]

    View Slide

  20. Expression-based


    inspection
    1.14

    View Slide

  21. 1.14
    IO.inspect(Version.parse!("1.0.0"))


    #=> #Version<1.0.0>
    Before:

    View Slide

  22. 1.14
    IO.inspect(Version.parse!("1.0.0"))


    #=> Version.parse!("1.0.0")
    Now:

    View Slide

  23. 1.14
    Version


    Version.Requirement


    MapSet


    Date.Range

    View Slide

  24. 1.14
    __repr__
    Python's

    View Slide

  25. Improved errors in


    binary construction*
    1.14
    *thanks Erlang!

    View Slide

  26. 1.14
    In OTP 25
    (part of EEP 54)

    View Slide

  27. 1.14
    int = 1


    bin = "foo"


    int <> bin


    ** (ArgumentError) argument error

    View Slide

  28. 1.14
    int = 1


    bin = "foo"


    int <> bin


    ** (ArgumentError) construction of binary failed:


    segment 1 of type 'binary':


    expected a binary but got: 1

    View Slide

  29. elixir-lang.org
    @whatyouhide

    View Slide