PAPERS WE LOVEELIXIR EDITIONPAPERS WE LOVEELIXIR EDITION
View Slide
@whatyouhide
“You know Yelp?Yeah, but for weed”– me
“You know Uber Eats?”– me
weedmaps.com/careers
ELIXIRfunctionalconcurrentfault tolerant
The Elixir core team
we existing research
Formatting code Diffing data structures Property-based testing ⚙
FORMATTING CODE
Code formatterwelcoming to newcomersconsistency across teams/orgs/communityno style discussions
print code with line length limit
%{foo: [1, 2, 3], bar: "baz"}
%{foo: [1, 2, 3], bar: "baz"}30
%{foo: [1, 2, 3], bar: "baz"}25
%{foo: [1, 2, 3],bar: "baz"}25
%{foo: [1, 2, 3],bar: "baz"}13
%{foo: [1,2,3],bar: "baz"}13
The Design of a Pretty-printing LibraryJohn Hughes
Documents"text"concat(document1, document2)nest(document, columns)
"["|> concat("1,")|> concat("2,")|> concat("3")|> concat("]")[1, 2, 3]
"["|> line("1,")|> line("2,")|> line("3")|> nest(2)|> line("]")[1,2,3]
A Prettier PrinterPhilip Wadler
group("["|> concat("1,")|> concat("2,")|> concat("3")|> nest(2)|> concat("]"))[1,2,3]
choose(doc,replace_concat_with_line_break(doc)) DANGER:STRICT LANGUAGE AHEAD
Strictly PrettyChristian Lindig
Our documentscolor(doc, :blue)nest(doc, :cursor)...
DIFFINGDATA STRUCTURES
1) test two strings are different (Test)test.ex:6Assertion with == failedcode: assert "hello world!" == "Hello, my world"left: "hello world!"right: "Hello, my world"stacktrace:test.ex:7: (test)
An O(ND) Difference Algorithmand Its VariationsEugene W. Myers
“Find the shortest edit script to turna sequence A into a sequence B.”= Find shortest pathin a graph
O(ND)D is related to how"similar" the twosequences areDNA strand mutationsource code changes
iex> List.myers_difference([1, 4, 2, 3], [1, 2, 3, 4])[eq: [1], del: [4], eq: [2, 3], ins: [4]]
Now colorize
No modifications tothe paper this time
String Matching with Metric TreesUsing an Approximate DistanceIlaria Bartolini, Paolo Ciaccia, Marco Patella
PROPERTY-BASEDTESTING
Shape of inputProperties of output++Randomness=Property-based testing
check all list <- list_of(term()) dosorted = sort(list)assert is_list(sorted)assert length(list) == length(sorted)end
String.starts_with?(s1 <> s2, s1)String.ends_with?(s1 <> s2, s2)For any strings s1 and s2:
Only Erlang tools(with different license)
QuickCheck: A Lightweight Tool forRandom Testing of Haskell ProgramsKoen Classen John Hughes
all the base ideas are therebut it relies tooheavily on types
data Colour = Red | Blue | Greeninstance Arbitrary Colour wherearbitrary = oneof[return Red, return Blue, return Green]
(prop/for-all [v (gen/vector gen/int)](= (sort v) (sort (sort v))))Clojure's test.check
StreamDatacheck all s1 <- string(),s2 <- string() doassert String.starts_with?(s1 <> s2, s1)assert String.ends_with?(s1 <> s2, s2)end
Generatorsfunctions that takesome random stateand return a lazy tree
Lazy treea value plus a "recipe"for shrinking it
StreamData.integer()302010
map(StreamData.integer(), fn x -> x * 2 end)3 * 20 * 22 * 20 * 21 * 20 * 2
map(StreamData.integer(), fn x -> x * 2 end)604020
HONORABLEMENTIONS
How to make ad-hocpolymorphism less ad hocPhilip WadlerStephen Blott
Recursive functions ofsymbolic expressions and theircomputation by machineJohn McCarthy
Advances in recordlinkage methodology asapplied to the 1985census of Tampa FloridaMatthew A. Jaro
Iteratee: Teaching an OldFold New TricksJohn W. Lato
CONCLUSIONS
Existing researchis AWESOME
Research tends to solve problems in ageneral/simple/flexible/elegant way
HDDHughes-driven development