A presentation at Elixir Brasil 2020 by Brooklyn Zelenka
The Tyranny of Structurelessness How more meaningful code can make your project more resilient & maintainable
I have regarded it as the highest goal of programming language design to enable good ideas to be elegantly expressed Tony Hoare, Turing Award Lecture 1980
Give me the right word and the right accent and I will move the world Joseph Conrad on Archimedes Lever
Brooklyn Zelenka @expede
Brooklyn Zelenka @expede β’ CTO at Fission β https://fission.codes β’ WebNative β’ Making backends obsolete π€ β’ PLT, VMs, Distributed Systems, ETH Core β’ Founder of the Vancouver FP meetup β’ Witchcraft, Quark, Algae, Exceptional, and others β’ Exceptional (Elixir)
< β’ Witchcraft (Elixir) Rescue (Haskell) Prelude (Haskell)
PING ME AND WEβLL MAIL SOME Stickers!
This Talk is Aboutβ¦
This Talk is About⦠⒠An approach to programming (broadly) ⒠Some observations about Elixir specifically ⒠A vision for the future of the ecosystem ⒠If you were at CodeBEAM BR, this talk generalizes some of the same ideas
This is the Big Idea ππ‘π
Big Idea One Liner πΈ Work at a higher level π
Big Idea Language Design Reflects Intended Use π
Big Idea Whoβs Org Looks Like This?
Big Idea Whoβs Org Looks Like This? π§ π¨π» π©π» π©π» π¨π» β π©π» π¨π»
Big Idea Whoβs Org Looks Like This? π§ π¨π» π©π» π©π» π¨π» β π©π» π¨π»
Big Idea Whoβs Org Looks Like This? π©π» π©π» π¨π» β π¨π» π©π» π¨π»
Big Idea Whoβs Org Looks Like This? π©π» π©π» π¨π» β π¨π» π©π» π¨π»
Big Idea Forward Thinking We want more type of features over time. As a result, complexity grows at an exponential rate. How do you make Elixir code more flexible and easier to reason about at scale? Do you think that the patterns we use today are the best possible patterns for software? How will you write code in 2025, 2030, and 2050?
Big Idea Core Evolution We need to evolve our approach: focus on domain and structure!
Big Idea Core Evolution We need to evolve our approach: focus on domain and structure! β¨ π¦ π
Structural Example: Schema Lenses w .inkandswitch.com/cambria.html w w Big Idea
In the Large π
In the Large Code You Used to Write Imperative
In the Large Code You Used to Write Imperative
In the Large βGoodβ Elixir Imperative
In the Large βGoodβ Elixir Imperative Ξ»
In the Large Imperative 3LA Future Imperative Ξ»
In the Large 3LA Future Imperative Semantic DSL / OO Imperative Ξ»
In the Large Prop & Model Test Imperative
GOTO Considered Harmful π€π΅
The quality of programmers is a decreasing function of the density of GOTO statements in the programs they produce Edsger Dijkstra
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ«
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible β’ Highly concrete
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible β’ Highly concrete β’ Huge number of implicit states
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible β’ Highly concrete β’ Huge number of implicit states Line 1 Line 2 Line 3 Line 4 Line 5 β GOTO Line 6
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible β’ Highly concrete β’ Huge number of implicit states Line 1 Line 2 Line 3 Line 4 Line 5 β GOTO Line 6
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible β’ Highly concrete β’ Huge number of implicit states Line 1 Line 2 Line 3 Line 4 Line 5 β GOTO Line 6
GOTO Considered Harmful Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it β’ Extremely flexible β’ Highly concrete Line 1 Line 2 Line 3 Line 4 Line 5 β GOTO Line 6 β’ Huge number of implicit states π₯
GOTO Considered Harmful Structured Programming while
GOTO Considered Harmful Structured Programming β’ Subroutines while
GOTO Considered Harmful Structured Programming β’ Subroutines β’ Loops while
GOTO Considered Harmful Structured Programming β’ Subroutines β’ Loops β’ Switch/branching while
GOTO Considered Harmful Structured Programming β’ Subroutines β’ Loops β’ Switch/branching β’ Named routines while
GOTO Considered Harmful The Next Generation π
GOTO Considered Harmful The Next Generation π β’ Objects, Actors, Protocols
GOTO Considered Harmful The Next Generation π β’ Objects, Actors, Protocols β’ Map, Reduce, Filter
GOTO Considered Harmful The Next Generation π β’ Objects, Actors, Protocols β’ Map, Reduce, Filter β’ Functor, Applicative, Monad
GOTO Considered Harmful The Next Generation π β’ Objects, Actors, Protocols β’ Map, Reduce, Filter β’ Functor, Applicative, Monad β’ Constraint Solvers
GOTO Considered Harmful Tradeoffs
GOTO Considered Harmful Tradeoffs β’ Exchange granular control for structure
GOTO Considered Harmful Tradeoffs β’ Exchange granular control for structure β’ Meaning over mechanics
GOTO Considered Harmful Tradeoffs β’ Exchange granular control for structure β’ Meaning over mechanics β’ More human than machine
GOTO Considered Harmful Tradeoffs β’ Exchange granular control for structure β’ Meaning over mechanics β’ More human than machine β’ Safer!
GOTO Considered Harmful Tradeoffs β’ Exchange granular control for structure β’ Spectrum β’ Meaning over mechanics β’ Turing Tarpit β’ More human than machine β’ Church Chasm β’ Safer! β’ Haskell Fan Fiction
250 GOTO Considered Harmful Payoff Structured Unstructured
250 GOTO Considered Harmful COMPLEXITY Payoff Structured Unstructured TIME
GOTO Considered Harmful Payoff 1000 COMPLEXITY 750 500 Unstructured Structured 250 TIME
GOTO Considered Harmful Payoff 1000 COMPLEXITY 750 500 Unstructured Structured 250 TIME
GOTO Considered Harmful Payoff 1000 COMPLEXITY 750 500 Unstructured Structured 250 TIME
On Complexity π±πΈπΎ
On Complexity Overused
On Complexity Overused
On Complexity The Bad Kind β
On Complexity The Bad Kind β β’ Probably pretty familiar with this
On Complexity The Bad Kind β β’ Probably pretty familiar with this β’ Euphemism for: β’ Complicated β’ Inconsistent β’ No plan β’ βUnstructured messβ
On Complexity The Good Kind: Deep What do these have in common? (a+b)/a ~ a / b
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting
On Complexity Orthogonal Complecting π
On Complexity Orthogonal Complecting π Structures: 4
On Complexity Orthogonal Complecting π ff Structures: 4 Results: e ectively limitless
On Complexity Complex != Complicated
On Complexity Complex != Complicated β’ Complex β interconnected parts
On Complexity Complex != Complicated β’ Complex β interconnected parts ffi β’ Complicated β di cult to understand
Abstraction & DSLs The Power of Words
Abstraction & DSLs The Power of Words β’ Restrict your vocabulary to your domain β’ β¦the hard part is deciding on that vocabulary
Abstraction & DSLs The Power of Words β’ Restrict your vocabulary to your domain β’ β¦the hard part is deciding on that vocabulary β’ Technical debt is lack of understanding β’ https://daverupert.com/2020/11/technical-debt-as-a-lack-of-understanding/
On Complexity The Actor Abyss
On Complexity The Actor Abyss β’ Each step is very simple
On Complexity The Actor Abyss β’ Each step is very simple β’ Reasoning about dynamic organisms is hard β’ Remember to (re)store your data β’ e.g. crash recovery β’ Called collaborator may not be there
On Complexity The Actor Abyss β’ Each step is very simple β’ Reasoning about dynamic organisms is hard β’ Remember to (re)store your data β’ e.g. crash recovery β’ Called collaborator may not be there β’ Complexity grows faster than linear
On Complexity The Actor Abyss β’ Each step is very simple β’ Reasoning about dynamic organisms is hard β’ Remember to (re)store your data β’ e.g. crash recovery β’ Called collaborator may not be there β’ Complexity grows faster than linear β’ Find common factors β your abstraction
On Complexity The Actor Abyss β’ Each step is very simple β’ Reasoning about dynamic organisms is hard β’ Remember to (re)store your data β’ e.g. crash recovery β’ Called collaborator may not be there β’ Complexity grows faster than linear β’ Find common factors β your abstraction
Fighting GenSoup π«π²β
Fighting GenSoup Good Interfaces != Good Abstractions
Fighting GenSoup Good Interfaces != Good Abstractions β’ GenServer & co are actually pretty low level β’ Please add some semantics π
Fighting GenSoup Good Interfaces != Good Abstractions β’ GenServer & co are actually pretty low level β’ Please add some semantics π β’ Donβt reinvent the wheel every time π‘
Fighting GenSoup Good Interfaces != Good Abstractions β’ GenServer & co are actually pretty low level β’ Please add some semantics π β’ Donβt reinvent the wheel every time π‘ β’ Letβs look at a very common example
Fighting GenSoup Abstraction
Fighting GenSoup Simple Case: Map
Fighting GenSoup Async Case: Part I (defstruct)
Fighting GenSoup i Async Case: Part II (def mpl)
Fighting GenSoup What Did We Get?
Fighting GenSoup What Did We Get? β’ Common interface
Fighting GenSoup What Did We Get? β’ Common interface β’ Encapsulate the detail
Fighting GenSoup What Did We Get? β’ Common interface β’ Encapsulate the detail β’ Donβt have to think about mechanics anymore π π§
Fighting GenSoup Abstraction = Focus & Essence
Fighting GenSoup Abstraction = Focus & Essence
Fighting GenSoup Abstraction = Focus & Essence π
Abstraction & DSLs Not Getting Trapped in the Details
Abstraction & DSLs Commonalities
Abstraction & DSLs Commonalities β’ They clearly have a similar structure
Abstraction & DSLs Commonalities β’ They clearly have a similar structure β’ NOT equally expressive β’ Enumerable
Abstraction & DSLs Commonalities β’ They clearly have a similar structure β’ NOT equally expressive β’ Enumerable β’ Always converted to List β’ Witchcraft.Functor
Abstraction & DSLs Commonalities
Abstraction & DSLs Commonalities β’ Di erent, but also have similar structure β’ Not very pipeable because 2 paths ff β’ β¦lots of duplicate code
Abstraction & DSLs Commonalities β’ Di erent, but also have similar structure β’ Not very pipeable because 2 paths β’ β¦lots of duplicate code ff β’ Why limit to only to two ways?
Abstraction & DSLs Commonalities β’ Di erent, but also have similar structure β’ Not very pipeable because 2 paths β’ β¦lots of duplicate code ff β’ Why limit to only to two ways?
Abstraction & DSLs Commonalities β’ Di erent, but also have similar structure β’ Not very pipeable because 2 paths β’ β¦lots of duplicate code ff β’ Why limit to only to two ways?
Abstraction & DSLs Start From Rules π
Abstraction & DSLs Start From Rules π β’ Describe what the overall solution looks like
Abstraction & DSLs Start From Rules π β’ Describe what the overall solution looks like β’ Choose how it gets run contextually
Abstraction & DSLs 2-Phase
Abstraction & DSLs 2-Phase β’ Always a two-phase process
Abstraction & DSLs 2-Phase β’ Always a two-phase process β’ Abstract, then concrete
Abstraction & DSLs 2-Phase β’ Always a two-phase process β’ Abstract, then concrete β’ Do concretion at application boundary
Abstraction & DSLs 2-Phase β’ Always a two-phase process β’ Abstract, then concrete β’ Do concretion at application boundary
Abstraction & DSLs 2-Phase β’ Always a two-phase process β’ Abstract, then concrete β’ Do concretion at application boundary
Abstraction & DSLs Improving Kernel
Abstraction & DSLs Improving Kernel β’ Fallback keys
Abstraction & DSLs Improving Kernel β’ Fallback keys β’ Bang-functions
Abstraction & DSLs Improving Kernel with Fallback Keys
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition β’ Letβs abstract default values! β’ More focused (does one thing) β’ More general (works everywhere) β’ Ad hoc function extension
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition β’ Letβs abstract default values! β’ More focused (does one thing) β’ More general (works everywhere) β’ Ad hoc function extension
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition β’ Letβs abstract default values! β’ More focused (does one thing) β’ More general (works everywhere) β’ Ad hoc function extension
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition β’ Letβs abstract default values! β’ More focused (does one thing) β’ More general (works everywhere) β’ Ad hoc function extension
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition β’ Letβs abstract default values! β’ More focused (does one thing) β’ More general (works everywhere) β’ Ad hoc function extension
Abstraction & DSLs Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition β’ Letβs abstract default values! β’ More focused (does one thing) β’ More general (works everywhere) β’ Ad hoc function extension
Abstraction & DSLs Improving Kernel with(out?) Bang Functions
Abstraction & DSLs Improving Kernel with(out?) Bang Functions * from foo / * / Get foo!
Abstraction & DSLs Improving Kernel with(out?) Bang Functions * from foo / * / Get foo!
Abstraction & DSLs Improving Kernel with(out?) Bang Functions * from foo / * / Get foo!
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ * from foo / * / Get foo!
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ * from foo / * / Get foo!
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ * from foo / * / Get foo! π£
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ * from foo / * / Get foo! π£
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Get foo! from foo π£ π * / * / β©
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Get foo! from foo π£ π β© * / * / π£
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Get foo! from foo π£ π β© * / * / π£ Works everywhere
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Get foo! from foo π£ π β© * / * / π£
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ π β© * / * / π£
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ π β© * / * / π£ Your choice o flow (e.g. pipes!)
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ π β© * / * / π£ Your choice o flow (e.g. pipes!) Super easy to test
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ π β© * / * / π£ Your choice o flow (e.g. pipes!) Super easy to test
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ Your choice o flow (e.g. pipes!) Super easy to test π β© * / * / π£ BONUS
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ Your choice o flow (e.g. pipes!) Super easy to test π β© * / * / π£ BONUS Fix nil blindness,
Abstraction & DSLs Improving Kernel with(out?) Bang Functions π£ Works everywhere Any data Any exception struct Get foo! from foo π£ Your choice o flow (e.g. pipes!) Super easy to test π β© * / * / π£ BONUS Fix nil blindness, the βbillion dollar mistakeβ
Abstraction & DSLs A Note on Metaphor
Abstraction & DSLs A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2
Abstraction & DSLs A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2 β’ Consistent flow metaphor / punning on existing metaphor β’ Exceptional: ~>/2 and >>>/2 Because itβs easier now
Abstraction & DSLs A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2 β’ Consistent flow metaphor / punning on existing metaphor β’ Exceptional: ~>/2 and >>>/2 Because itβs easier now
Abstraction & DSLs A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2 β’ Consistent flow metaphor / punning on existing metaphor β’ Exceptional: ~>/2 and >>>/2 Because itβs easier now
Abstraction & DSLs A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2 β’ Consistent flow metaphor / punning on existing metaphor β’ Exceptional: ~>/2 and >>>/2 Because itβs easier now
Abstraction & DSLs A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2 β’ Consistent flow metaphor / punning on existing metaphor β’ Exceptional: ~>/2 and >>>/2 Because itβs easier now
Abstraction & DSLs Whatβs Gained
Abstraction & DSLs Whatβs Gained β’ Clear
Abstraction & DSLs Whatβs Gained β’ Clear β’ Composable
Abstraction & DSLs Whatβs Gained β’ Clear β’ Composable β’ Greater reuse β»
Abstraction & DSLs Whatβs Gained β’ Clear β’ Composable β’ Greater reuse β» β’ User choice
Abstraction & DSLs Whatβs Gained β’ Clear β’ Composable β’ Greater reuse β» β’ User choice β’ Increased testability β’ Simple example: is_exception?/1
Abstraction & DSLs Whatβs Gained β’ Clear β’ Composable β’ Greater reuse β» β’ User choice β’ Increased testability β’ Simple example: is_exception?/1 β’ Could still add protocol to get even more power
Abstraction & DSLs Storytelling π
Abstraction & DSLs Storytelling π β’ Your code read like a story
Abstraction & DSLs Storytelling π β’ Your code read like a story β’ We even see this in high-level goals of (e.g.) Phoenix
Abstraction & DSLs Storytelling π β’ Your code read like a story β’ We even see this in high-level goals of (e.g.) Phoenix β’ Go make some DSLs!
Abstraction & DSLs How to Eat the Elephant π΄
Abstraction & DSLs How to Eat the Elephant π΄ β’ By feature?
Abstraction & DSLs How to Eat the Elephant π΄ β’ By feature? β’ By behaviour?
Abstraction & DSLs How to Eat the Elephant π΄ β’ By feature? β’ By behaviour? β’ By structure / properties!
Intermission Puzzle π§©
Intermission Puzzle What Do The Following Have In Common?
Intermission Puzzle What Do The Following Have In Common? β’ Async/await (or Task, if you prefer)
Intermission Puzzle What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch
Intermission Puzzle What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch β’ with blocks
Intermission Puzzle What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch β’ with blocks β’ SQL queries β LINQ
Intermission Puzzle What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch β’ with blocks β’ SQL queries β LINQ β’ JSON parsing
Intermission Puzzle What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch β’ with blocks β’ SQL queries β LINQ β’ JSON parsing β’ βWarm fuzzy thingβ
Structure One of these things is like all the others
Structure There Are Only Three Right Answers 1 2 3
Structure There Are Only Three Right Answers 1 2 3
Structure Associativity
Structure Associativity β’ Not a data structure
Structure Associativity β’ Not a data structure β’ Not a function
Structure Associativity β’ Not a data structure β’ Not a function β’ An interface & rules!
Structure Associativity β’ Not a data structure β’ Not a function β’ An interface & rules! (No w o l f e h t te a t e m ) r o ph
Structure A Semigroup Onβ¦
Structure A Semigroup Onβ¦
Structure An Unlawful Counterexample π¨
Structure How to Enforce Properties
Structure How to Enforce Properties β’ A structure of structures β’ Keep it in your brain β’ Manually prop test β’ Enforce with TypeClass
Letβs Do Something Wild π¦ (Power Up Pipes)
Power Up Explicit Assumptions
Power Up Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized
Power Up Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy
Power Up Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy t
Power Up Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy t
Power Up Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy t
Power Up Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy t
Power Up Pipes++
Power Up Pipes++
Power Up Pipes++
Power Up Pipes++
Power Up How?!
Power Up How?!
Power Up Cleanup
Power Up Cleanup
Power Up Carrier Data
Power Up Carrier Data
Power Up Carrier Data
Power Up Carrier Data
Power Up Carrier Data
Power Up Carrier Data
Power Up Base Case
Power Up Base Case
Power Up Base Case
Power Up Async
Power Up Async
Power Up Async
Power Up Async
Power Up Upshot
Power Up Upshot β’ Higher semantic density (meaning > mechanics)
Power Up Upshot β’ Higher semantic density (meaning > mechanics) β’ Declarative, configurable data flow π€―
Power Up Upshot β’ Higher semantic density (meaning > mechanics) β’ Declarative, configurable data flow π€― β’ Extremely extensible β’ def mpl Dataflow, for: %Stream{} β’ def mpl Dataflow, for: %Distributed{} i i i β’ def mpl Dataflow, for: %Broadway{}
Power Up Upshot β’ Higher semantic density (meaning > mechanics) β’ Declarative, configurable data flow π€― β’ Extremely extensible β’ def mpl Dataflow, for: %Stream{} β’ def mpl Dataflow, for: %Distributed{} β’ def mpl Dataflow, for: %Broadway{} i i i β’ Model-testable
Power Up Upshot β’ Higher semantic density (meaning > mechanics) β’ Declarative, configurable data flow π€― β’ Extremely extensible β’ def mpl Dataflow, for: %Stream{} β’ def mpl Dataflow, for: %Distributed{} β’ def mpl Dataflow, for: %Broadway{} β’ Model-testable i i i β’ Composable with other pipes and change evaluation strategies
Data dominates. If youβve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. Rob Pike, 5 Rules of Programming
A Call for Libraries
A Call for Libraries Summary
A Call for Libraries Summary β’ Can plug into / extend
A Call for Libraries Summary β’ Can plug into / extend β’ Single-threaded context
A Call for Libraries Summary β’ Can plug into / extend β’ Single-threaded context β’ Distributed context
A Call for Libraries Summary β’ Can plug into / extend β’ Single-threaded context β’ Distributed context β’ Dynamic hybrid contexts
A Call for Libraries Extend Railroad Programming
A Call for Libraries Extend Railroad Programming Happy Path (Continue) Error Case (Skip) ff No E ect (Afterwards)
A Call for Libraries Extend Railroad Programming Happy Path (Continue) Error Case (Skip) ff No E ect (Afterwards)
A Call for Libraries Extend Railroad Programming Happy Path (Continue) Error Case (Skip) ff No E ect (Afterwards)
A Call for Libraries Surprising Number of Factors
A Call for Libraries Surprising Number of Factors Log Program
A Call for Libraries Surprising Number of Factors Log Program
Summary
Summary Keep In Mindβ¦
Summary Keep In Mind⦠⒠Protocols-for-DDD
Summary Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer
Summary Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer ⒠How do you locally test your distributed system? Look at the properties!
Summary Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer ⒠How do you locally test your distributed system? Look at the properties! ⒠Under which conditions does your code work? What are your assumptions?
Summary Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer ⒠How do you locally test your distributed system? Look at the properties! ⒠Under which conditions does your code work? What are your assumptions? ⒠Prop testing is useful for structured abstractions
Summary Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer ⒠How do you locally test your distributed system? Look at the properties! ⒠Under which conditions does your code work? What are your assumptions? ⒠Prop testing is useful for structured abstractions ⒠You should be able to code half-asleep
https://fission.codes https://talk.fission.codes https://tools.fission.codes π§π· Thank You, Elixir Brasil π brooklyn@fission.codes g i t h u b . c o m /e x p e d e @expede
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Few assumption β’ Many use cases s β’ n Low informatio y β’
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases s Few assumption s β’ n High informatio n β’ y Low informatio r β’
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Low informatio β’ High informatio β’ Few assumption β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases s s n n y r GENERALITY π β POWER π
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Low informatio β’ High informatio β’ Few assumption β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases s s n n y r GENERALITY π β POWER π
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Low informatio β’ High informatio β’ Few assumption β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases Enum s s n n y r GENERALITY π β POWER π
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Low informatio β’ High informatio β’ Few assumption β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases Enum s s n n y r GENERALITY π Ecto.Schema β POWER π
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Low informatio β’ High informatio β’ Few assumption β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases GenServer Enum s s n n y r GENERALITY π Ecto.Schema β POWER π
LIBRARY PRINCIPLES π GENERALITY SWEET SPOTS π Generalit Powe β’ Low informatio β’ High informatio β’ Few assumption β’ Can make many assumption β’ Many use cases β’ Tailored to few use cases GenServer Enum GENERALITY π s s n n y r Libraries Ecto.Schema β POWER π Applications