Slide 1

Slide 1 text

PAPERS WE LOVE ELIXIR EDITION PAPERS WE LOVE ELIXIR EDITION

Slide 2

Slide 2 text

@whatyouhide

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

“You know Yelp? Yeah, but for weed”– me

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

“You know Uber Eats?”– me

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

weedmaps.com/careers

Slide 14

Slide 14 text

ELIXIR functional concurrent fault tolerant

Slide 15

Slide 15 text

The Elixir core team

Slide 16

Slide 16 text

we existing research

Slide 17

Slide 17 text

Formatting code Diffing data structures Property-based testing ⚙

Slide 18

Slide 18 text

FORMATTING CODE

Slide 19

Slide 19 text

Code formatter welcoming to newcomers consistency across teams/orgs/community no style discussions

Slide 20

Slide 20 text

print code with line length limit

Slide 21

Slide 21 text

%{foo: [1, 2, 3], bar: "baz"}

Slide 22

Slide 22 text

%{foo: [1, 2, 3], bar: "baz"} 30

Slide 23

Slide 23 text

%{foo: [1, 2, 3], bar: "baz"} 25

Slide 24

Slide 24 text

%{ foo: [1, 2, 3], bar: "baz" } 25

Slide 25

Slide 25 text

%{ foo: [1, 2, 3], bar: "baz" } 13

Slide 26

Slide 26 text

%{ foo: [ 1, 2, 3 ], bar: "baz" } 13

Slide 27

Slide 27 text

The Design of a Pretty-printing Library John Hughes

Slide 28

Slide 28 text

Documents "text" concat(document1, document2) nest(document, columns)

Slide 29

Slide 29 text

"[" |> concat("1,") |> concat("2,") |> concat("3") |> concat("]") [1, 2, 3]

Slide 30

Slide 30 text

"[" |> line("1,") |> line("2,") |> line("3") |> nest(2) |> line("]") [ 1, 2, 3 ]

Slide 31

Slide 31 text

A Prettier Printer Philip Wadler

Slide 32

Slide 32 text

group( "[" |> concat("1,") |> concat("2,") |> concat("3") |> nest(2) |> concat("]") ) [ 1, 2, 3 ]

Slide 33

Slide 33 text

choose( doc, replace_concat_with_line_break(doc) ) DANGER: STRICT LANGUAGE AHEAD

Slide 34

Slide 34 text

Strictly Pretty Christian Lindig

Slide 35

Slide 35 text

Our documents color(doc, :blue) nest(doc, :cursor) ...

Slide 36

Slide 36 text

DIFFING DATA STRUCTURES

Slide 37

Slide 37 text

1) test two strings are different (Test) test.ex:6 Assertion with == failed code: assert "hello world!" == "Hello, my world" left: "hello world!" right: "Hello, my world" stacktrace: test.ex:7: (test)

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

An O(ND) Difference Algorithm and Its Variations Eugene W. Myers

Slide 40

Slide 40 text

“Find the shortest edit script to turn a sequence A into a sequence B.” = Find shortest path in a graph

Slide 41

Slide 41 text

O(ND) D is related to how "similar" the two sequences are DNA strand mutation source code changes

Slide 42

Slide 42 text

iex> List.myers_difference([1, 4, 2, 3], [1, 2, 3, 4]) [eq: [1], del: [4], eq: [2, 3], ins: [4]]

Slide 43

Slide 43 text

Now colorize

Slide 44

Slide 44 text

No modifications to the paper this time

Slide 45

Slide 45 text

String Matching with Metric Trees Using an Approximate Distance Ilaria Bartolini, Paolo Ciaccia, Marco Patella

Slide 46

Slide 46 text

PROPERTY-BASED TESTING

Slide 47

Slide 47 text

Shape of input Properties of output + + Randomness = Property-based testing

Slide 48

Slide 48 text

check all list <- list_of(term()) do sorted = sort(list) assert is_list(sorted) assert length(list) == length(sorted) end

Slide 49

Slide 49 text

String.starts_with?(s1 <> s2, s1) String.ends_with?(s1 <> s2, s2) For any strings s1 and s2:

Slide 50

Slide 50 text

Only Erlang tools (with different license)

Slide 51

Slide 51 text

QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs Koen Classen John Hughes

Slide 52

Slide 52 text

all the base ideas are there but it relies too heavily on types

Slide 53

Slide 53 text

data Colour = Red | Blue | Green instance Arbitrary Colour where arbitrary = oneof [return Red, return Blue, return Green]

Slide 54

Slide 54 text

(prop/for-all [v (gen/vector gen/int)] (= (sort v) (sort (sort v)))) Clojure's test.check

Slide 55

Slide 55 text

StreamData check all s1 <- string(), s2 <- string() do assert String.starts_with?(s1 <> s2, s1) assert String.ends_with?(s1 <> s2, s2) end

Slide 56

Slide 56 text

Generators functions that take some random state and return a lazy tree

Slide 57

Slide 57 text

Lazy tree a value plus a "recipe" for shrinking it

Slide 58

Slide 58 text

StreamData.integer() 3 0 2 0 1 0

Slide 59

Slide 59 text

StreamData.integer() 3 0 2 0 1 0

Slide 60

Slide 60 text

map(StreamData.integer(), fn x -> x * 2 end) 3 * 2 0 * 2 2 * 2 0 * 2 1 * 2 0 * 2

Slide 61

Slide 61 text

map(StreamData.integer(), fn x -> x * 2 end) 6 0 4 0 2 0

Slide 62

Slide 62 text

HONORABLE MENTIONS

Slide 63

Slide 63 text

How to make ad-hoc polymorphism less ad hoc Philip Wadler Stephen Blott

Slide 64

Slide 64 text

Recursive functions of symbolic expressions and their computation by machine John McCarthy

Slide 65

Slide 65 text

Advances in record linkage methodology as applied to the 1985 census of Tampa Florida Matthew A. Jaro

Slide 66

Slide 66 text

Iteratee: Teaching an Old Fold New Tricks John W. Lato

Slide 67

Slide 67 text

CONCLUSIONS

Slide 68

Slide 68 text

Existing research is AWESOME

Slide 69

Slide 69 text

Research tends to solve problems in a general/simple/flexible/elegant way

Slide 70

Slide 70 text

HDD Hughes-driven development

Slide 71

Slide 71 text

@whatyouhide