BEAM to the Future: Old Ideas Made New (‘22 Version)

A presentation at FunctionalConf in March 2022 in by Brooklyn Zelenka

Slide 1

Slide 1

Slide 2

Slide 2

Slide 3

Slide 3

M A E B e r u t to u f e h t W E N E D A M S A E D I D L O

Slide 4

Slide 4

M A E B e r u t to u f e h t W E N E D A M S A E D I D L O 2022 Edition

Slide 5

Slide 5

Slide 6

Slide 6

Sometimes in order to keep moving forward, not only must you take one step at a time, but you must be willing to look back occasionally and evaluate your past, no matter how painful it is. Looking back lets you know whether or not you are headed in the right direction. –G.K. Adams

Slide 7

Slide 7

Slide 8

Slide 8

Epigram 53 So many good ideas are never heard from again once they embark in a voyage on the semantic gulf –Alan J. Perlis, Epigrams on Programming (1982)

Slide 9

Slide 9

Meta

Slide 10

Slide 10

Brooklyn Zelenka @expede

Slide 11

Slide 11

Brooklyn Zelenka @expede • CTO at Fission (https://fission.codes) • Edge apps (“post-serverless”) • Goal: make back-ends and DevOps obsolete • PLT, VMs, distributed systems • Standards: DIF, UCAN, Ethereum, Multiformats, others • Founded VanFP, VanBEAM • Primary author of Witchcraft, Algae, Exceptional, etc

Slide 12

Slide 12

Meta 🔮

Slide 13

Slide 13

Meta 🔮

Slide 14

Slide 14

Meta 🔮 The BEAM does so much right 👏

Slide 15

Slide 15

Meta 🔮 How do we move forward as an ecosystem, cross language, cross paradigm?

Slide 16

Slide 16

Meta 🔮 How do we move forward as an ecosystem, cross language, cross paradigm?

Slide 17

Slide 17

Meta 🔮 Local Maxima

Slide 18

Slide 18

Meta 🔮 Local Maxima 😄

Slide 19

Slide 19

Meta 🔮 Local Maxima 😍 😄

Slide 20

Slide 20

Meta 🔮 Local Maxima 😍 😄 😭

Slide 21

Slide 21

Meta 🔮 Spoiler Alert 🚨

Slide 22

Slide 22

Meta 🔮 Spoiler Alert 🚨

  1. Breaking out of linear thinking / von Neumann 🌀

Slide 23

Slide 23

Meta 🔮 Spoiler Alert 🚨

  1. Breaking out of linear thinking / von Neumann 🌀 2. New types of modularity (for the BEAM) 🔌

Slide 24

Slide 24

Meta 🔮 Spoiler Alert 🚨

  1. Breaking out of linear thinking / von Neumann 🌀 2. New types of modularity (for the BEAM) 🔌 3. Composable languages 🗣

Slide 25

Slide 25

In the Beginning… 🌴🦖

Slide 26

Slide 26

In the Beginning… 🌴🦖

Slide 27

Slide 27

In the Beginning… 🌴🦖 Epigram 28 Around computers it is difficult to find the correct unit of time to measure progress. Some cathedrals took a century to complete. Can you imagine the grandeur and scope of a program that would take as long? –Alan J. Perlis, Epigrams on Programming (1982)

Slide 28

Slide 28

In the Beginning… 🌴🦖

Slide 29

Slide 29

In the Beginning… 🌴🦖

Slide 30

Slide 30

In the Beginning… 🌴🦖

Slide 31

Slide 31

In the Beginning… 🌴🦖

Slide 32

Slide 32

In the Beginning… 🌴🦖 29 Years

Slide 33

Slide 33

In the Beginning… 🌴🦖 29 Years

Slide 34

Slide 34

In the Beginning… 🌴🦖 29 Years

Slide 35

Slide 35

In the Beginning… 🌴🦖 29 Years

Slide 36

Slide 36

In the Beginning… 🌴🦖 29 Years 36 Years

Slide 37

Slide 37

In the Beginning… 🌴🦖 29 Years 36 Years

Slide 38

Slide 38

Paradigm Redshift 🌈

Slide 39

Slide 39

Paradigm Redshift 🌈

Slide 40

Slide 40

Paradigm Redshift 🌈 It’s really difficult to distinguish a new paradigm from a really bad idea […] The new shiny object is part of the old paradigm – Douglas Crockford, The Power of the Paradigm (2018)

Slide 41

Slide 41

Paradigm Redshift 🌈 Novelty Budget

Slide 42

Slide 42

Paradigm Redshift 🌈 Novelty Budget

Slide 43

Slide 43

Paradigm Redshift 🌈 Novelty Budget

Slide 44

Slide 44

Paradigm Redshift 🌈 Law of Conservation of Complexity

Slide 45

Slide 45

Paradigm Redshift 🌈 Law of Conservation of Complexity Every application has an inherent amount of complexity that cannot be removed or hidden, but only moved from place to place – Larry Tesler

Slide 46

Slide 46

Paradigm Redshift 🌈 The “What If” Tree

Slide 47

Slide 47

Paradigm Redshift 🌈 The “What If” Tree

Slide 48

Slide 48

Paradigm Redshift 🌈 The “What If” Tree

  1. Array-based 📈 2. Applicative Model 🤹 3. SML Module System 🔌 4. Natural & Biz Language 🕴

Slide 49

Slide 49

  1. Array-based 📈 2. Applicative Model 🤹 3. SML Module System 🔌 4. Natural & Biz Language 🕴 ✂ Paradigm Redshift 🌈 The “What If” Tree

Slide 50

Slide 50

  1. Applicative Model 🤹 3. SML Module System 🔌 4. Natural & Biz Language 🕴 ✂
  2. Array-based 📈 ✂ Paradigm Redshift 🌈 The “What If” Tree

Slide 51

Slide 51

Paradigm Redshift 🌈

Slide 52

Slide 52

Paradigm Redshift 🌈 Let’s start with something alien 🛸👽

Slide 53

Slide 53

Paradigm Redshift 🌈 Something Alien

Slide 54

Slide 54

Paradigm Redshift 🌈 Something Alien {↑1 ⍵∨.∧3 4=+/,̄1 0 1∘.⊖̄1 0 1∘.⌽⊂⍵}

Slide 55

Slide 55

Paradigm Redshift 🌈 Something Alien {↑1 ⍵∨.∧3 4=+/,̄1 0 1∘.⊖̄1 0 1∘.⌽⊂⍵}

Slide 56

Slide 56

Paradigm Redshift 🌈 Something Alien LIFE← {↑1 ⍵∨.∧3 4=+/,̄1 0 1∘.⊖̄1 0 1∘.⌽⊂⍵}

Slide 57

Slide 57

Paradigm Redshift 🌈 Something Alien LIFE← {↑1 ⍵∨.∧3 4=+/,̄1 0 1∘.⊖̄1 0 1∘.⌽⊂⍵} Attribution: wikipedia user LucasVB

Slide 58

Slide 58

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸

Slide 59

Slide 59

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸

Slide 60

Slide 60

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸 • Each step is very simple

Slide 61

Slide 61

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸 • Each step is very simple • Reasoning about dynamic organisms is hard!

Slide 62

Slide 62

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸 • Each step is very simple • Reasoning about dynamic organisms is hard!

Slide 63

Slide 63

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸 • Each step is very simple • Reasoning about dynamic organisms is hard! • Emergent behaviour 😱

Slide 64

Slide 64

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸 • Each step is very simple • Reasoning about dynamic organisms is hard! • Emergent behaviour 😱 • VM in your brain to reason at a higher level

Slide 65

Slide 65

Paradigm Redshift 🌈 What can we learn from APL? Cellular Automata & Actors as Organisms 🌸 • Each step is very simple • Reasoning about dynamic organisms is hard! • Emergent behaviour 😱 • VM in your brain to reason at a higher level • We can abstract away some of this • Broadway • Arrows

Slide 66

Slide 66

Paradigm Redshift 🌈 What can we learn from APL? Universal Scaling Law http://www.perfdynamics.com/Manifesto/USLscalability.html

Slide 67

Slide 67

Paradigm Redshift 🌈 What can we learn from APL? Universal Scaling Law Amdahl’s Law http://www.perfdynamics.com/Manifesto/USLscalability.html

Slide 68

Slide 68

Paradigm Redshift 🌈 What can we learn from APL? Universal Scaling Law Amdahl’s Law USL http://www.perfdynamics.com/Manifesto/USLscalability.html

Slide 69

Slide 69

Paradigm Redshift 🌈 What can we learn from APL? Universal Scaling Law Amdahl’s Law Incoherence Penalty http://www.perfdynamics.com/Manifesto/USLscalability.html USL

Slide 70

Slide 70

Paradigm Redshift 🌈 What can we learn from APL? doall / Automatic Parallelism / Cyclic Multithreading 🔁

Slide 71

Slide 71

Paradigm Redshift 🌈 What can we learn from APL? doall / Automatic Parallelism / Cyclic Multithreading 🔁 1. Shared-nothing architecture 2. Good for embarrassingly parallel problems 3. Macro could do a LOT more with this at compile-time 4. Impurity and granular control mean that we don’t get this by default (with good reason)

Slide 72

Slide 72

Paradigm Redshift 🌈 OTP → TOP Table Oriented Programming

Slide 73

Slide 73

Paradigm Redshift 🌈 Table Oriented Programming Naive Tables

Slide 74

Slide 74

Paradigm Redshift 🌈 Table Oriented Programming Naive Tables Name Handle City Brooklyn expede Vancouver Quinn quinnwilton Mountain View Steven icidasset Ghent

Slide 75

Slide 75

Paradigm Redshift 🌈 Table Oriented Programming Naive Tables Name Handle City Brooklyn expede Vancouver Quinn quinnwilton Mountain View Steven icidasset Ghent

Slide 76

Slide 76

Paradigm Redshift 🌈 Table Oriented Programming Naive Tables Name Handle City Brooklyn expede Vancouver Quinn quinnwilton Mountain View Steven icidasset Ghent

Slide 77

Slide 77

Paradigm Redshift 🌈 Table Oriented Programming Perfectly Parallel Control Tables

Slide 78

Slide 78

Paradigm Redshift 🌈 Table Oriented Programming Functions Perfectly Parallel Control Tables Data

Slide 79

Slide 79

Paradigm Redshift 🌈 Table Oriented Programming Functions Perfectly Parallel Control Tables Data

Slide 80

Slide 80

Paradigm Redshift 🌈 Table Oriented Programming Functions Perfectly Parallel Control Tables Data

Slide 81

Slide 81

Paradigm Redshift 🌈 Table Oriented Programming Perfectly Parallel Control Tables Functions Zero dependencies by definition Data

Slide 82

Slide 82

Paradigm Redshift 🌈 Table Oriented Programming The Nth-Dimension 🚀

Slide 83

Slide 83

Paradigm Redshift 🌈 Table Oriented Programming

Slide 84

Slide 84

Composition & Modularity 🧱

Slide 85

Slide 85

Complexity & Modularity 🧱

Slide 86

Slide 86

Complexity & Modularity 🧱 –Alan J. Perlis, Epigrams on Programming (1982)

Slide 87

Slide 87

Complexity & Modularity 🧱 Epigram 6 Symmetry is a complexity-reducing concept; seek it everywhere –Alan J. Perlis, Epigrams on Programming (1982)

Slide 88

Slide 88

Complexity & Modularity 🧱 Epigram 6 Symmetry is a complexity-reducing concept; seek it everywhere Epigram 105 You can’t communicate complexity, only awareness of it –Alan J. Perlis, Epigrams on Programming (1982)

Slide 89

Slide 89

Complexity & Modularity 🧱 What do you mean by “composition”?

Slide 90

Slide 90

Complexity & Modularity 🧱 What do you mean by “composition”?

Slide 91

Slide 91

Complexity & Modularity 🧱 What do you mean by “composition”? HOF Application

Slide 92

Slide 92

Complexity & Modularity 🧱 What do you mean by “composition”? Modularity HOF Application

Slide 93

Slide 93

Complexity & Modularity 🧱 What do you mean by “composition”? Commutativity Modularity HOF Application

Slide 94

Slide 94

Complexity & Modularity 🧱 What do you mean by “composition”? Orthogonality Commutativity Modularity HOF Application

Slide 95

Slide 95

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬

Slide 96

Slide 96

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the data dimension

Slide 97

Slide 97

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the data dimension a b c d e

Slide 98

Slide 98

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬

Slide 99

Slide 99

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the function dimension

Slide 100

Slide 100

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the function dimension f g

Slide 101

Slide 101

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the function dimension f g Da ta flo w h

Slide 102

Slide 102

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬

Slide 103

Slide 103

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the capabilities (protocols and HOFs)

Slide 104

Slide 104

Complexity & Modularity 🧱 What do you mean by “composition”? Focus 🔬 Composition in the capabilities (protocols and HOFs) Data Function

Slide 105

Slide 105

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry

Slide 106

Slide 106

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012)

Slide 107

Slide 107

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t

Slide 108

Slide 108

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t

Slide 109

Slide 109

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t

Slide 110

Slide 110

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t

Slide 111

Slide 111

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t

Slide 112

Slide 112

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t 👍 ! s e t u m m o c It

Slide 113

Slide 113

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t 👍 ! s e t u m m o c It

Slide 114

Slide 114

Complexity & Modularity 🧱 What do you mean by “composition”? Execution Symmetry A program can be developed on a sequential platform, even if it is meant to run on a parallel platform, because the behaviour is not affected by whether we execute it using a sequential or parallel dynamics – Robert Harper, Practical Foundations for Programming Languages (2012) t 👍 ! s e t u m m o c It

Slide 115

Slide 115

Complexity & Modularity 🧱 What do you mean by “composition”? Explicit Data Flow

Slide 116

Slide 116

Complexity & Modularity 🧱 What do you mean by “composition”? Explicit Data Flow

Slide 117

Slide 117

Complexity & Modularity 🧱 What do you mean by “composition”? Explicit Data Flow

Slide 118

Slide 118

Complexity & Modularity 🧱 What do you mean by “composition”? Explicit Data Flow

Slide 119

Slide 119

Complexity & Modularity 🧱 How Modular are Modules?

Slide 120

Slide 120

Complexity & Modularity 🧱 How Modular are Modules? (and libraries)

Slide 121

Slide 121

Complexity & Modularity 🧱 How Modular are Modules? (and libraries)

Slide 122

Slide 122

Complexity & Modularity 🧱 How Modular are Modules? Module-Level Modularity

Slide 123

Slide 123

Complexity & Modularity 🧱 How Modular are Modules? Module-Level Modularity “Hot-swappable dependencies”

Slide 124

Slide 124

Complexity & Modularity 🧱 How Modular are Modules? Module-Level Modularity “Hot-swappable dependencies”

Slide 125

Slide 125

Complexity & Modularity 🧱 How Modular are Modules? Module-Level Modularity “Hot-swappable dependencies”

Slide 126

Slide 126

Complexity & Modularity 🧱 How Modular are Modules? Module-Level Modularity “Hot-swappable dependencies”

Slide 127

Slide 127

Complexity & Modularity 🧱 How Modular are Modules? Hacking Extending the Module System

Slide 128

Slide 128

Complexity & Modularity 🧱 How Modular are Modules? Hacking Extending the Module System

Slide 129

Slide 129

Complexity & Modularity 🧱 How Modular are Modules? Hacking Extending the Module System

Slide 130

Slide 130

Complexity & Modularity 🧱 How Modular are Modules? Higher Order Modules 💖 Behaviours

Slide 131

Slide 131

Declarative Embedded DSLs 🍏🍊

Slide 132

Slide 132

Declarative Embedded DSLs 🍏🍊

Slide 133

Slide 133

Declarative Embedded DSLs 🍏🍊 I have regarded it as the highest goal of programming language design to enable good ideas to be elegantly expressed – Tony Hoare, Turing Aware Lecture, 1980

Slide 134

Slide 134

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL?

Slide 135

Slide 135

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Wide Narrow

Slide 136

Slide 136

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? m g i d ra a P Wide t a P n r te n a L a u g e g D L S k n r o o i e t w c a e a c f i l r m p e a t r p n F I A Narrow

Slide 137

Slide 137

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Counterexample

Slide 138

Slide 138

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Counterexample This is just Elixir!

Slide 139

Slide 139

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Algebraic Data Type eDSL

Slide 140

Slide 140

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Algebraic Data Type eDSL

Slide 141

Slide 141

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Algebraic Data Type eDSL

Slide 142

Slide 142

Declarative Embedded DSLs 🍏🍊 Isn’t Everything a DSL? Algebraic Data Type eDSL

Slide 143

Slide 143

Declarative Embedded DSLs 🍏🍊 Business Language for Business Time 💼

Slide 144

Slide 144

Declarative Embedded DSLs 🍏🍊 Business Language 💼

Slide 145

Slide 145

Declarative Embedded DSLs 🍏🍊 Business Language 💼 What can we learn from COBOL? (Yes, really. COBOL.) Toggl, How to Kill at the Dragon in 9 Programming Languages

Slide 146

Slide 146

Declarative Embedded DSLs 🍏🍊 What Can We Learn from COBOL?

Slide 147

Slide 147

Declarative Embedded DSLs 🍏🍊 What Can We Learn from COBOL? When No One Wants to Go To Jail 👩⚖

Slide 148

Slide 148

Declarative Embedded DSLs 🍏🍊 What Can We Learn from COBOL? When No One Wants to Go To Jail 👩⚖ • Needs to be readable by lawyers • (Who can’t read code) • Formal methods & static analysis • Down to the compiler, of course • An unholy union of COBOL and Prolog

Slide 149

Slide 149

Declarative Embedded DSLs 🍏🍊 What Can We Learn from COBOL? When No One Wants to Go To Jail 👩⚖ • Needs to be readable by lawyers • (Who can’t read code) • Formal methods & static analysis • Down to the compiler, of course • An unholy union of COBOL and Prolog

Slide 150

Slide 150

Declarative Embedded DSLs 🍏🍊 Upside

Slide 151

Slide 151

Declarative Embedded DSLs 🍏🍊 Upside

  1. Fabulous for communicating with domain experts 2. We know how these DSLs work (e.g. they form an algebra) 3. They can be correct-by-construction 4. Check for various properties (compile- or run-time) 5. A language that exactly fits your needs (DDD)

Slide 152

Slide 152

Declarative Embedded DSLs 🍏🍊 But We Have a Problem

Slide 153

Slide 153

Declarative Embedded DSLs 🍏🍊 But We Have a Problem (Hint: it’s inflexibility)

Slide 154

Slide 154

Declarative Embedded DSLs 🍏🍊 🏖 Shallow Embedding 🦀

Slide 155

Slide 155

Declarative Embedded DSLs 🍏🍊 🏖 Shallow Embedding 🦀 i.e. The “Quick and Dirty” Way

Slide 156

Slide 156

Declarative Embedded DSLs 🍏🍊 Shallow Embedding

Slide 157

Slide 157

Declarative Embedded DSLs 🍏🍊 Shallow Embedding • Just use the built-in AST • What it can represent is limited • e.g. Ecto, Algae

Slide 158

Slide 158

Declarative Embedded DSLs 🍏🍊 Shallow Embedding • Just use the built-in AST • What it can represent is limited • e.g. Ecto, Algae

Slide 159

Slide 159

Declarative Embedded DSLs 🍏🍊 Shallow Embedding • Just use the built-in AST • What it can represent is limited • e.g. Ecto, Algae

Slide 160

Slide 160

Declarative Embedded DSLs 🍏🍊 Shallow Embedding • Just use the built-in AST • What it can represent is limited • e.g. Ecto, Algae

Slide 161

Slide 161

Declarative Embedded DSLs 🍏🍊 🌊 Deep Embedding 🦈

Slide 162

Slide 162

Declarative Embedded DSLs 🍏🍊 🌊 Deep Embedding 🦈 “Better AST”

Slide 163

Slide 163

Declarative Embedded DSLs 🍏🍊 Deep Embedding Three Steps

Slide 164

Slide 164

Declarative Embedded DSLs 🍏🍊 Deep Embedding Three Steps

  1. Build a game plan 2. Transform (optional) 3. Tear down

Slide 165

Slide 165

Declarative Embedded DSLs 🍏🍊 Deep Embedding “Build a Game Plan” Example

Slide 166

Slide 166

Declarative Embedded DSLs 🍏🍊 Deep Embedding “Build a Game Plan” Example

Slide 167

Slide 167

Declarative Embedded DSLs 🍏🍊 Deep Embedding Tradeoffs

Slide 168

Slide 168

Declarative Embedded DSLs 🍏🍊 Deep Embedding Tradeoffs •More work to write (write your own AST) •Way more powerful (full control) •Precisely the vocabulary that you need — exact surface area •Can check more things about the meaning of your code •Logic-as-data is MUCH simpler to debug than running functions •Time travelling debugging! •Unlike protocols, you’re not locked into one canonical implementation

Slide 169

Slide 169

Declarative Embedded DSLs 🍏🍊 Deep Embedding Combine Powerful, Modular, Reusable DSLs!

Slide 170

Slide 170

Declarative Embedded DSLs 🍏🍊 Deep Embedding Desugar

Slide 171

Slide 171

Declarative Embedded DSLs 🍏🍊 Deep Embedding “Huh, this kinda feels like GenServer” 😉

Slide 172

Slide 172

Declarative Embedded DSLs 🍏🍊 Deep Embedding “Huh, this kinda feels like GenServer” 😉

Slide 173

Slide 173

Declarative Embedded DSLs 🍏🍊 Deep Embedding “Huh, this kinda feels like GenServer” 😉

Slide 174

Slide 174

Declarative Embedded DSLs 🍏🍊 Deep Embedding “Huh, this kinda feels like GenServer” 😉

Slide 175

Slide 175

Declarative Embedded DSLs 🍏🍊 Deep Embedding With Their Powers Combined!

Slide 176

Slide 176

Declarative Embedded DSLs 🍏🍊 Deep Embedding One Last Line

Slide 177

Slide 177

Declarative Embedded DSLs 🍏🍊 Deep Embedding One Last Line

Slide 178

Slide 178

Declarative Embedded DSLs 🍏🍊 Deep Embedding More Flexible Than protocols

Slide 179

Slide 179

Declarative Embedded DSLs 🍏🍊 Deep Embedding More Flexible Than protocols

  1. Protocols require canonicity 2. Libraries of well-defined mini-languages, even without interpreter ff
  2. Di erent in tests and prod (trivial to mock)

Slide 180

Slide 180

Let’s Make New Mistakes! 💥✨

Slide 181

Slide 181

Let’s Make New Mistakes! 💥✨ 5 Problems for the Next 30 Years of BEAM

Slide 182

Slide 182

Let’s Make New Mistakes 5 Problems for the Next 30 Years of BEAM

Slide 183

Slide 183

Let’s Make New Mistakes 5 Problems for the Next 30 Years of BEAM

  1. Wasm — client & edge BEAM

Slide 184

Slide 184

Let’s Make New Mistakes 5 Problems for the Next 30 Years of BEAM

  1. Wasm — client & edge BEAM 2. Lower the barrier to entry (low code)

Slide 185

Slide 185

Let’s Make New Mistakes 5 Problems for the Next 30 Years of BEAM

  1. Wasm — client & edge BEAM 2. Lower the barrier to entry (low code) 3. Correctness tools (i.e. better static & dynamic analysis, formal methods)

Slide 186

Slide 186

Let’s Make New Mistakes 5 Problems for the Next 30 Years of BEAM

  1. Wasm — client & edge BEAM 2. Lower the barrier to entry (low code) 3. Correctness tools (i.e. better static & dynamic analysis, formal methods) 4. Automatic dynamic parallel evaluation

Slide 187

Slide 187

Let’s Make New Mistakes 5 Problems for the Next 30 Years of BEAM

  1. Wasm — client & edge BEAM 2. Lower the barrier to entry (low code) 3. Correctness tools (i.e. better static & dynamic analysis, formal methods) 4. Automatic dynamic parallel evaluation 5. Mobile agents (incl. dynamic FaaS)

Slide 188

Slide 188

Parting Thought 🧠

Slide 189

Slide 189

Slide 190

Slide 190

–Alan J. Perlis, Epigrams on Programming (1982)

Slide 191

Slide 191

Epigram 101 –Alan J. Perlis, Epigrams on Programming (1982)

Slide 192

Slide 192

Epigram 101 Dealing with failure is easy: –Alan J. Perlis, Epigrams on Programming (1982)

Slide 193

Slide 193

Epigram 101 Dealing with failure is easy: work hard to improve. –Alan J. Perlis, Epigrams on Programming (1982)

Slide 194

Slide 194

Epigram 101 Dealing with failure is easy: work hard to improve. Success is also easy to handle: –Alan J. Perlis, Epigrams on Programming (1982)

Slide 195

Slide 195

Epigram 101 Dealing with failure is easy: work hard to improve. Success is also easy to handle: you’ve solved the wrong problem. –Alan J. Perlis, Epigrams on Programming (1982)

Slide 196

Slide 196

Epigram 101 Dealing with failure is easy: work hard to improve. Success is also easy to handle: you’ve solved the wrong problem. Work hard to improve. –Alan J. Perlis, Epigrams on Programming (1982)

Slide 197

Slide 197

🎉 Thank You, India 🇮🇳 brooklyn@fission.codes https://fission.codes github.com/expede @expede