The Tyranny of
Structurelessness How more meaningful code can make your project more resilient & maintainable
Slide 2
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
Slide 3
Give me the right word and the right accent and I will move the world Joseph Conrad on Archimedes Lever
Slide 4
Brooklyn Zelenka @expede
Slide 5
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)
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
Slide 10
This is the
Big Idea ππ‘π
Slide 11
Big Idea
One Liner
πΈ Work at a higher level π
Slide 12
Big Idea
Language Design Reflects Intended Use
π
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?
Slide 19
Big Idea
Core Evolution We need to evolve our approach: focus on domain and structure!
Slide 20
Big Idea
Core Evolution We need to evolve our approach: focus on domain and structure! β¨
π¦ π
Slide 21
Structural Example: Schema Lenses
w
.inkandswitch.com/cambria.html
w
w
Big Idea
Slide 22
In the Large π
Slide 23
In the Large
Code You Used to Write
Imperative
Slide 24
In the Large
Code You Used to Write
Imperative
Slide 25
In the Large
βGoodβ Elixir
Imperative
Functional core,
imperative shell
Slide 26
In the Large
βGoodβ Elixir
Imperative
Ξ»
Functional core,
imperative shell
Slide 27
In the Large
Imperative
3LA Future
Imperative Ξ»
Slide 28
In the Large
3LA Future
Imperative
Semantic DSL / OO
Imperative Ξ»
Slide 29
In the Large
Prop & Model Test
Imperative
Slide 30
GOTO Considered Harmful
π€π΅
Slide 31
The quality of programmers is a decreasing function of the density of GOTO statements in the programs they produce Edsger Dijkstra
Slide 32
GOTO Considered Harmful
Whatβs So Bad About Having Control? π¦Άπ«
Slide 33
GOTO Considered Harmful
Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs
Slide 34
GOTO Considered Harmful
Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction
Slide 35
GOTO Considered Harmful
Whatβs So Bad About Having Control? π¦Άπ« β’ GOTOs β’ Low level instruction β’ Literally how the machine is going to see it
Slide 36
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
Slide 37
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
Slide 38
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
Slide 39
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
Slide 40
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
Slide 41
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
Slide 42
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
π₯
Slide 43
GOTO Considered Harmful
Structured Programming
while
Slide 44
GOTO Considered Harmful
Structured Programming
β’ Subroutines
while
Slide 45
GOTO Considered Harmful
Structured Programming
β’ Subroutines β’ Loops while
Slide 46
GOTO Considered Harmful
Structured Programming
β’ Subroutines β’ Loops β’ Switch/branching
while
Slide 47
GOTO Considered Harmful
Structured Programming
β’ Subroutines β’ Loops β’ Switch/branching β’ Named routines
while
Slide 48
GOTO Considered Harmful
The Next Generation π
Slide 49
GOTO Considered Harmful
The Next Generation π
β’ Objects, Actors, Protocols
Slide 50
GOTO Considered Harmful
The Next Generation π
β’ Objects, Actors, Protocols β’ Map, Reduce, Filter
Slide 51
GOTO Considered Harmful
The Next Generation π
β’ Objects, Actors, Protocols β’ Map, Reduce, Filter β’ Functor, Applicative, Monad
Slide 52
GOTO Considered Harmful
The Next Generation π
β’ Objects, Actors, Protocols β’ Map, Reduce, Filter β’ Functor, Applicative, Monad β’ Constraint Solvers
Slide 53
GOTO Considered Harmful
Tradeoffs
Slide 54
GOTO Considered Harmful
Tradeoffs
β’ Exchange granular control for structure
Slide 55
GOTO Considered Harmful
Tradeoffs
β’ Exchange granular control for structure β’ Meaning over mechanics
Slide 56
GOTO Considered Harmful
Tradeoffs
β’ Exchange granular control for structure β’ Meaning over mechanics β’ More human than machine
Slide 57
GOTO Considered Harmful
Tradeoffs
β’ Exchange granular control for structure β’ Meaning over mechanics β’ More human than machine β’ Safer!
Slide 58
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
Slide 59
250
GOTO Considered Harmful
Payoff
Structured
Unstructured
Slide 60
250
GOTO Considered Harmful
COMPLEXITY
Payoff
Structured
Unstructured
TIME
Slide 61
GOTO Considered Harmful
Payoff 1000
COMPLEXITY
750
500
Unstructured Structured
250
TIME
Slide 62
GOTO Considered Harmful
Payoff 1000
COMPLEXITY
750
500
Unstructured Structured
250
TIME
Slide 63
GOTO Considered Harmful
Payoff 1000
COMPLEXITY
750
500
Unstructured Structured
250
TIME
Slide 64
On Complexity π±πΈπΎ
Slide 65
On Complexity
Overused
Slide 66
On Complexity
Overused
Slide 67
On Complexity
The Bad Kind β
Slide 68
On Complexity
The Bad Kind β β’ Probably pretty familiar with this
Slide 69
On Complexity
The Bad Kind β β’ Probably pretty familiar with this β’ Euphemism for: β’ Complicated β’ Inconsistent β’ No plan β’ βUnstructured messβ
Slide 70
On Complexity
The Good Kind: Deep
What do these have in common?
(a+b)/a ~ a / b
Slide 71
On Complexity
Orthogonal Complecting
Slide 72
On Complexity
Orthogonal Complecting
Slide 73
On Complexity
Orthogonal Complecting
Slide 74
On Complexity
Orthogonal Complecting
Slide 75
On Complexity
Orthogonal Complecting
Slide 76
On Complexity
Orthogonal Complecting
Slide 77
On Complexity
Orthogonal Complecting
Slide 78
On Complexity
Orthogonal Complecting
Slide 79
On Complexity
Orthogonal Complecting
Slide 80
On Complexity
Orthogonal Complecting
Slide 81
On Complexity
Orthogonal Complecting
π
Slide 82
On Complexity
Orthogonal Complecting
π
Structures: 4
Slide 83
On Complexity
Orthogonal Complecting
π
ff
Structures: 4 Results: e ectively limitless
Slide 84
On Complexity
Complex != Complicated
Slide 85
On Complexity
Complex != Complicated
β’ Complex β interconnected parts
Slide 86
On Complexity
Complex != Complicated
β’ Complex β interconnected parts
ffi
β’ Complicated β di cult to understand
Slide 87
Abstraction & DSLs
The Power of Words
Slide 88
Abstraction & DSLs
The Power of Words
β’ Restrict your vocabulary to your domain β’ β¦the hard part is deciding on that vocabulary
Slide 89
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/
Slide 90
On Complexity
The Actor Abyss
Slide 91
On Complexity
The Actor Abyss β’ Each step is very simple
Slide 92
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
Slide 93
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
Slide 94
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
Slide 95
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
Slide 96
Fighting GenSoup π«π²β
Slide 97
Fighting GenSoup
Good Interfaces != Good Abstractions
Slide 98
Fighting GenSoup
Good Interfaces != Good Abstractions
β’ GenServer & co are actually pretty low level β’ Please add some semantics π
Slide 99
Fighting GenSoup
Good Interfaces != Good Abstractions
β’ GenServer & co are actually pretty low level β’ Please add some semantics π β’ Donβt reinvent the wheel every time π‘
Slide 100
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
Slide 101
Fighting GenSoup
Abstraction
Slide 102
Fighting GenSoup
Simple Case: Map
Slide 103
Fighting GenSoup
Async Case: Part I (defstruct)
Slide 104
Fighting GenSoup
i
Async Case: Part II (def mpl)
Slide 105
Fighting GenSoup
What Did We Get?
Slide 106
Fighting GenSoup
What Did We Get?
β’ Common interface
Slide 107
Fighting GenSoup
What Did We Get?
β’ Common interface β’ Encapsulate the detail
Slide 108
Fighting GenSoup
What Did We Get?
β’ Common interface β’ Encapsulate the detail β’ Donβt have to think about mechanics anymore π π§
Abstraction & DSLs Not Getting Trapped in the Details
Slide 113
Abstraction & DSLs
Commonalities
Slide 114
Abstraction & DSLs
Commonalities β’ They clearly have a similar structure
Slide 115
Abstraction & DSLs
Commonalities β’ They clearly have a similar structure β’ NOT equally expressive β’ Enumerable
Slide 116
Abstraction & DSLs
Commonalities β’ They clearly have a similar structure β’ NOT equally expressive β’ Enumerable β’ Always converted to List β’ Witchcraft.Functor
Slide 117
Abstraction & DSLs
Commonalities
Slide 118
Abstraction & DSLs
Commonalities
β’ Di erent, but also have similar structure β’ Not very pipeable because 2 paths
ff
β’ β¦lots of duplicate code
Slide 119
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?
Slide 120
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?
Slide 121
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?
Slide 122
Abstraction & DSLs
Start From Rules π
Slide 123
Abstraction & DSLs
Start From Rules π
β’ Describe what the overall solution looks like
Slide 124
Abstraction & DSLs
Start From Rules π
β’ Describe what the overall solution looks like β’ Choose how it gets run contextually
Slide 125
Abstraction & DSLs
2-Phase
Slide 126
Abstraction & DSLs
2-Phase
β’ Always a two-phase process
Slide 127
Abstraction & DSLs
2-Phase
β’ Always a two-phase process β’ Abstract, then concrete
Slide 128
Abstraction & DSLs
2-Phase
β’ Always a two-phase process β’ Abstract, then concrete β’ Do concretion at application boundary
Slide 129
Abstraction & DSLs
2-Phase
β’ Always a two-phase process β’ Abstract, then concrete β’ Do concretion at application boundary
Slide 130
Abstraction & DSLs
2-Phase
β’ Always a two-phase process β’ Abstract, then concrete β’ Do concretion at application boundary
Abstraction & DSLs
Improving Kernel with Fallback Keys
Slide 135
Abstraction & DSLs
Improving Kernel with Fallback Keys β’ Insight: β’ Composition is at the heart of modularity β’ Orthogonality is at the heart of composition
Slide 136
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
Slide 137
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
Slide 138
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
Slide 139
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
Slide 140
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
Slide 141
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
Slide 142
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions
Slide 143
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions
*
from foo
/
*
/
Get foo!
Slide 144
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions
*
from foo
/
*
/
Get foo!
Slide 145
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions
*
from foo
/
*
/
Get foo!
Slide 146
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions π£
*
from foo
/
*
/
Get foo!
Slide 147
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions π£
*
from foo
/
*
/
Get foo!
Slide 148
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions π£
*
from foo
/
*
/
Get foo!
π£
Slide 149
Abstraction & DSLs
Improving Kernel with(out?) Bang Functions π£
*
from foo
/
*
/
Get foo!
π£
Abstraction & DSLs
A Note on Metaphor β’ Concept: Flow-ability is very core to Elixirβs ethos β’ Kernel.|>/2
Slide 163
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
Slide 164
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
Slide 165
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
Slide 166
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
Slide 167
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 β’ Clear β’ Composable β’ Greater reuse β» β’ User choice β’ Increased testability β’ Simple example: is_exception?/1 β’ Could still add protocol to get even more power
Slide 175
Abstraction & DSLs
Storytelling π
Slide 176
Abstraction & DSLs
Storytelling π
β’ Your code read like a story
Slide 177
Abstraction & DSLs
Storytelling π
β’ Your code read like a story β’ We even see this in high-level goals of (e.g.) Phoenix
Slide 178
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!
Slide 179
Abstraction & DSLs
How to Eat the Elephant π΄
Slide 180
Abstraction & DSLs
How to Eat the Elephant π΄
β’ By feature?
Slide 181
Abstraction & DSLs
How to Eat the Elephant π΄
β’ By feature? β’ By behaviour?
Slide 182
Abstraction & DSLs
How to Eat the Elephant π΄
β’ By feature? β’ By behaviour? β’ By structure / properties!
Intermission Puzzle
What Do The Following Have In Common?
Slide 185
Intermission Puzzle
What Do The Following Have In Common? β’ Async/await (or Task, if you prefer)
Slide 186
Intermission Puzzle
What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch
Slide 187
Intermission Puzzle
What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch β’ with blocks
Slide 188
Intermission Puzzle
What Do The Following Have In Common? β’ Async/await (or Task, if you prefer) β’ throw/catch β’ with blocks β’ SQL queries β LINQ
Slide 189
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
Slide 190
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β
Slide 191
Structure
One of these things is like all the others
Slide 192
Structure
There Are Only Three Right Answers
1
2
3
Slide 193
Structure
There Are Only Three Right Answers
1
2
3
Slide 194
Structure
Associativity
Slide 195
Structure
Associativity β’ Not a data structure
Slide 196
Structure
Associativity β’ Not a data structure β’ Not a function
Slide 197
Structure
Associativity β’ Not a data structure β’ Not a function β’ An interface & rules!
Slide 198
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
Slide 199
Structure
A Semigroup Onβ¦
Slide 200
Structure
A Semigroup Onβ¦
Slide 201
Structure
An Unlawful Counterexample π¨
Slide 202
Structure
How to Enforce Properties
Slide 203
Structure
How to Enforce Properties
β’ A structure of structures β’ Keep it in your brain β’ Manually prop test β’ Enforce with TypeClass
Slide 204
Letβs Do Something
Wild π¦ (Power Up Pipes)
Slide 205
Power Up
Explicit Assumptions
Slide 206
Power Up
Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized
Slide 207
Power Up
Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy
Slide 208
Power Up
Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy
t
Slide 209
Power Up
Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy
t
Slide 210
Power Up
Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy
t
Slide 211
Power Up
Explicit Assumptions β’ Parallel pipes! β’ Concurrency = partial order β’ Monotonic β’ All loops must be linearized β’ Properties β’ Serial composition β’ Parallel composition β’ Explicit evaluation strategy
t
Slide 212
Power Up
Pipes++
Slide 213
Power Up
Pipes++
Slide 214
Power Up
Pipes++
Slide 215
Power Up
Pipes++
Slide 216
Power Up
How?!
Slide 217
Power Up
How?!
Slide 218
Power Up
Cleanup
Slide 219
Power Up
Cleanup
Slide 220
Power Up
Carrier Data
Slide 221
Power Up
Carrier Data
Slide 222
Power Up
Carrier Data
Slide 223
Power Up
Carrier Data
Slide 224
Power Up
Carrier Data
Slide 225
Power Up
Carrier Data
Slide 226
Power Up
Base Case
Slide 227
Power Up
Base Case
Slide 228
Power Up
Base Case
Slide 229
Power Up
Async
Slide 230
Power Up
Async
Slide 231
Power Up
Async
Slide 232
Power Up
Async
Slide 233
Power Up
Upshot
Slide 234
Power Up
Upshot β’ Higher semantic density (meaning > mechanics)
Slide 235
Power Up
Upshot β’ Higher semantic density (meaning > mechanics) β’ Declarative, configurable data flow π€―
Slide 236
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{}
Slide 237
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
Slide 238
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
Slide 239
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
Slide 240
A Call for
Libraries
Slide 241
A Call for Libraries
Summary
Slide 242
A Call for Libraries
Summary
β’ Can plug into / extend
Slide 243
A Call for Libraries
Summary
β’ Can plug into / extend β’ Single-threaded context
Slide 244
A Call for Libraries
Summary
β’ Can plug into / extend β’ Single-threaded context β’ Distributed context
Slide 245
A Call for Libraries
Summary
β’ Can plug into / extend β’ Single-threaded context β’ Distributed context β’ Dynamic hybrid contexts
Slide 246
A Call for Libraries
Extend Railroad Programming
Slide 247
A Call for Libraries
Extend Railroad Programming Happy Path (Continue)
Error Case (Skip)
ff
No E ect (Afterwards)
Slide 248
A Call for Libraries
Extend Railroad Programming Happy Path (Continue)
Error Case (Skip)
ff
No E ect (Afterwards)
Slide 249
A Call for Libraries
Extend Railroad Programming Happy Path (Continue)
Error Case (Skip)
ff
No E ect (Afterwards)
Slide 250
A Call for Libraries
Surprising Number of Factors
Slide 251
A Call for Libraries
Surprising Number of Factors
Log
Program
Slide 252
A Call for Libraries
Surprising Number of Factors
Log
Program
Slide 253
Summary
Slide 254
Summary
Keep In Mindβ¦
Slide 255
Summary
Keep In Mind⦠⒠Protocols-for-DDD
Slide 256
Summary
Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer
Slide 257
Summary
Keep In Mind⦠⒠Protocols-for-DDD ⒠Add a semantic layer ⒠How do you locally test your distributed system? Look at the properties!
Slide 258
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?
Slide 259
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
Slide 260
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
Slide 261
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 π Generalit
Few assumption
β’
Many use cases
s
β’
n
Low informatio
y
β’
Slide 264
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
β’
Slide 265
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 π
Slide 266
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 π
Slide 267
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 π
Slide 268
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 π
Slide 269
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 π
Slide 270
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