Slide 1

Slide 1 text

Elixir Update from the core team May 2022

Slide 2

Slide 2 text

Andrea Leopardi @whatyouhide Elixir core team, engineer for 

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

1.13

Slide 5

Slide 5 text

1.13 December 2021 Focused on developer experience

Slide 6

Slide 6 text

1.13 Semantic recompilation mix xref improvements Code.Fragment Formatter plugins

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

1.13 # In .formatter.exs [ plugins: [MixMarkdownFormatter], inputs: [...] ]

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

1.14

Slide 11

Slide 11 text

June 2022 Requires OTP 23+ 1.14

Slide 12

Slide 12 text

PartitionSupervisor 1.14

Slide 13

Slide 13 text

Application supervisor Bottleneck process 1.14

Slide 14

Slide 14 text

Application supervisor Bottleneck process 1.14 PartitionSupervisor Bottleneck process Bottleneck process

Slide 15

Slide 15 text

children = [ {PartitionSupervisor, child_spec: {ErrorReporter, []}, name: Reporters} ] 1.14

Slide 16

Slide 16 text

def report_error(err) do ErrorReporter.report( {:via, PartitionSupervisor, {Reporters, self()}}, err ) end 1.14

Slide 17

Slide 17 text

Slicing with steps 1.14

Slide 18

Slide 18 text

1.14 1..10//2

Slide 19

Slide 19 text

1.14 Enum.slice(~w(a b c d e f g h), 1..4//2) #=> ["b", "d"]

Slide 20

Slide 20 text

Expression-based inspection 1.14

Slide 21

Slide 21 text

1.14 IO.inspect(Version.parse!("1.0.0")) #=> #Version<1.0.0> Before:

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

1.14 Version Version.Requirement MapSet Date.Range

Slide 24

Slide 24 text

1.14 __repr__ Python's

Slide 25

Slide 25 text

Improved errors in binary construction* 1.14 *thanks Erlang!

Slide 26

Slide 26 text

1.14 In OTP 25 (part of EEP 54)

Slide 27

Slide 27 text

1.14 int = 1 bin = "foo" int <> bin ** (ArgumentError) argument error

Slide 28

Slide 28 text

1.14 int = 1 bin = "foo" int <> bin ** (ArgumentError) construction of binary failed: segment 1 of type 'binary': expected a binary but got: 1

Slide 29

Slide 29 text

elixir-lang.org @whatyouhide