BRIDGING THE DIVIDE πŸ’” ❀ βœ¨βš” A NOBLE QUEST OF BOOTSTRAPS, SUGAR, AND SPECTRAL PYRAMIDS πŸ‰βš‘

BRIDGING THE DIVIDE πŸ’” βœ¨βš” A NOBLE QUEST OF BOOTSTRAPS, SUGAR, AND SPECTRAL PYRAMIDS πŸ‰βš‘

If you don’t like what you got Why don’t you change it If your programming language is all screwed up Rearrange it 🀘😈πŸ”₯ TROOPER, β€œRAISE A LIT TLE HELL” (SORT OF)

M E TA TA L K I N G A B O U T T H I S T A L K

M E TA TA L K I N G A B O U T T H I S T A L K

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ”Ή Ethereum Core Dev

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ”Ή Ethereum Core Dev πŸ“œ Authored bunch of standards

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ”Ή Ethereum Core Dev πŸ“œ Authored bunch of standards βš› FISSION Framework

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ”Ή Ethereum Core Dev πŸ“œ Authored bunch of standards βš› FISSION Framework πŸ’¬ Clarity Language

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ”Ή Ethereum Core Dev πŸ“œ Authored bunch of standards βš› FISSION Framework πŸ’¬ Clarity Language πŸ§™ Open Sourceress

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ§™ Open Sourceress πŸ”Ή Ethereum Core Dev πŸ€“ PLT Enthusiast πŸ“œ Authored bunch of standards βš› FISSION Framework πŸ’¬ Clarity Language

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ§™ Open Sourceress πŸ”Ή Ethereum Core Dev πŸ€“ PLT Enthusiast πŸ“œ Authored bunch of standards Ξ» Founded VanFP βš› FISSION Framework πŸ’¬ Clarity Language

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ§™ Open Sourceress πŸ”Ή Ethereum Core Dev πŸ€“ PLT Enthusiast πŸ“œ Authored bunch of standards Ξ» Founded VanFP βš› FISSION Framework βš— Previously Elixir consultant & trainer πŸ’¬ Clarity Language

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ§™ Open Sourceress πŸ”Ή Ethereum Core Dev πŸ€“ PLT Enthusiast πŸ“œ Authored bunch of standards Ξ» Founded VanFP βš› FISSION Framework βš— Previously Elixir consultant & trainer πŸ’¬ Clarity Language πŸ“š Witchcraft, Algae, Quark, Exceptional

M E TA B R O O K LY N Z E L E N K A β€” @ E X P E D E β™  CEO & Chief Scientist @ SPADE Co πŸ§™ Open Sourceress πŸ”Ή Ethereum Core Dev πŸ€“ PLT Enthusiast πŸ“œ Authored bunch of standards Ξ» Founded VanFP βš› FISSION Framework βš— Previously Elixir consultant & trainer πŸ’¬ Clarity Language πŸ“š Witchcraft, Algae, Quark, Exceptional T E G E M CO KERS! C I T S

M E TA FOLLOW UP TO LOVE POTION NUMBER 9

M E TA FOLLOW UP TO LOVE POTION NUMBER 9

M E TA STRUCTURE πŸ›

M E TA STRUCTURE πŸ› β€’ Philosophy

M E TA STRUCTURE πŸ› β€’ Philosophy β€’ Principles

M E TA STRUCTURE πŸ› β€’ Philosophy β€’ Principles β€’ Toy Example

M E TA STRUCTURE πŸ› β€’ Philosophy β€’ Principles β€’ Toy Example β€’ (Partly also an experience report 🀫)

M E TA WHY FOCUS ON LIBRARIES? πŸ“š

M E TA WHY FOCUS ON LIBRARIES? πŸ“š β€’ Much material on language design β€’ Language ergonomics are an active area of research

M E TA WHY FOCUS ON LIBRARIES? πŸ“š β€’ Much material on language design β€’ Language ergonomics are an active area of research β€’ Different constraints when working inside an existing language

M E TA WHY FOCUS ON LIBRARIES? πŸ“š β€’ Much material on language design β€’ Language ergonomics are an active area of research β€’ Different constraints when working inside an existing language β€’ Blending languages and porting concepts

M E TA WHY FOCUS ON LIBRARIES? πŸ“š β€’ Much material on language design β€’ Language ergonomics are an active area of research β€’ Different constraints when working inside an existing language β€’ Blending languages and porting concepts β€’ I agonized over how to make Haskell idioms fit into Elixir β€’ Learn from my mistakes experiences!

M E TA C O D E I L L U S T R AT I O N S W I L L B E H I G H L E V E L

M E TA C O D E I L L U S T R AT I O N S W I L L B E H I G H L E V E L

M E TA C O D E I L L U S T R AT I O N S W I L L B E H I G H L E V E L

M E TA C O D E I L L U S T R AT I O N S W I L L B E H I G H L E V E L

TOOLS OF THOUGHT πŸ› πŸ§  A P P L I C AT I O N S C O M E A N D G O , B U T C O N C E P T S S TAY T H E S A M E

To think is to forget a difference, to generalize, to abstract πŸ™‚ JORGE LUIS BORGES

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial β€’ Arabic numerals > Roman numerals

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial β€’ Arabic numerals > Roman numerals β€’ 24-hours and 360-degrees have nice divisors

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial β€’ Arabic numerals > Roman numerals β€’ 24-hours and 360-degrees have nice divisors

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial β€’ Arabic numerals > Roman numerals β€’ 24-hours and 360-degrees have nice divisors Flavours 🍨🍧

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial β€’ Arabic numerals > Roman numerals β€’ 24-hours and 360-degrees have nice divisors Flavours 🍨🍧 1. Algorithms (β€œhow”) β€’ ex. Long division

TOOLS OF THOUGHT πŸ› πŸ§  TOOLS & ME THODS > BIOLOGY πŸ•πŸ”₯πŸš€ β€’ Possibly use our minds less than our ancestors β€’ We have better mental tools 🏹πŸ”₯ β€’ Metric > Imperial β€’ Arabic numerals > Roman numerals β€’ 24-hours and 360-degrees have nice divisors Flavours 🍨🍧 1. Algorithms (β€œhow”) β€’ ex. Long division 2. Abstraction (β€œwhat”) β€’ ex. Geometric metaphors

TOOLS OF THOUGHT πŸ› πŸ§  N O T J U S T FA S T E R H O R S E S = 🏎

TOOLS OF THOUGHT πŸ› πŸ§  N O T J U S T FA S T E R H O R S E S = 🏎 β€’ Algorithms > hardware β€’ Moore’s Law ending ☠ β€’ Algorithms more beneficial to performance in many domains

TOOLS OF THOUGHT πŸ› πŸ§  N O T J U S T FA S T E R H O R S E S = 🏎 β€’ Algorithms > hardware β€’ Moore’s Law ending ☠ β€’ Algorithms more beneficial to performance in many domains β€’ Abstraction very important to software quality β€’ Because of the β€œhuman” part of HCI β€’ (Of course a PLT person would say this 😜)

TOOLS OF THOUGHT πŸ› πŸ§  N O T J U S T FA S T E R H O R S E S = 🏎 β€’ Algorithms > hardware β€’ Moore’s Law ending ☠ β€’ Algorithms more beneficial to performance in many domains β€’ Abstraction very important to software quality β€’ Because of the β€œhuman” part of HCI β€’ (Of course a PLT person would say this 😜) β€’ Recent successes A β€’ Machine learning β€’ Zero knowledge proofs

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy πŸ”Ί Abstraction

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy πŸ”Ί Abstraction πŸ’­ Concepts & Practice

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy πŸ”Ί Abstraction πŸ’­ Concepts & Practice πŸ—£ Grammar & Vocabulary

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy πŸ”Ί Abstraction πŸ’­ Concepts & Practice πŸ—£ Grammar & Vocabulary πŸ“ Concrete Code

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy πŸ”Ί Abstraction πŸ’­ Concepts & Practice πŸ—£ Grammar & Vocabulary πŸ“ Concrete Code βš™ Machine

TOOLS OF THOUGHT πŸ› πŸ§  P L AT O N I C I D E A L πŸ‘Ό 🌌 Reality πŸ€” Philosophy πŸ”Ί Abstraction πŸ’­ Concepts & Practice πŸ—£ Grammar & Vocabulary πŸ“ Concrete Code βš™ Machine 🎭 Real World Outcomes

TOOLS OF THOUGHT πŸ› πŸ§  FORKING & BLENDING 🍰 🌌 πŸ€” πŸ”Ί πŸ’­ Context A πŸ—£ πŸ“ βš™ 🎭

TOOLS OF THOUGHT πŸ› πŸ§  FORKING & BLENDING 🍰 🌌 πŸ€” πŸ”Ί πŸ’­ Context A πŸ—£ πŸ“ βš™ 🎭

TOOLS OF THOUGHT πŸ› πŸ§  FORKING & BLENDING 🍰 🌌 πŸ€” πŸ”Ί πŸ’­ Context A πŸ—£ πŸ“ βš™ 🎭

TOOLS OF THOUGHT πŸ› πŸ§  FORKING & BLENDING 🍰 🌌 πŸ€” πŸ”Ί πŸ’­ Context A πŸ—£ πŸ—£ πŸ“ πŸ“ βš™ 🎭 Context B

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality β€’ Low information β€’ Few assumptions β€’ Many use cases

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases GENERALITY 🌏 βš– POWER πŸš€

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases GENERALITY 🌏 βš– POWER πŸš€

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases Enum GENERALITY 🌏 βš– POWER πŸš€

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases Enum GENERALITY 🌏 Ecto.Schema βš– POWER πŸš€

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases GenServer Enum GENERALITY 🌏 Ecto.Schema βš– POWER πŸš€

TOOLS OF THOUGHT πŸ› πŸ§  LIBRARY SWEE T SPOTS 🍭 Generality Power β€’ Low information β€’ High information β€’ Few assumptions β€’ Can make many assumptions β€’ Many use cases β€’ Tailored to few use cases GenServer Enum Libraries GENERALITY 🌏 Ecto.Schema βš– POWER πŸš€ Applications

TOOLS OF THOUGHT πŸ› πŸ§  A TA X O N O M Y O F L I B R A R I E S πŸ“š

TOOLS OF THOUGHT πŸ› πŸ§  A TA X O N O M Y O F L I B R A R I E S πŸ“š β€’ Generality β€’ ex. Witchcraft, Database Adapters

TOOLS OF THOUGHT πŸ› πŸ§  A TA X O N O M Y O F L I B R A R I E S πŸ“š β€’ Generality β€’ ex. Witchcraft, Database Adapters β€’ Framework β€’ ex. Phoenix, Nerves

TOOLS OF THOUGHT πŸ› πŸ§  A TA X O N O M Y O F L I B R A R I E S πŸ“š β€’ Generality β€’ ex. Witchcraft, Database Adapters β€’ Framework β€’ ex. Phoenix, Nerves β€’ Feature Emulation β€’ ex. TypeClass

TOOLS OF THOUGHT πŸ› πŸ§  A TA X O N O M Y O F L I B R A R I E S πŸ“š β€’ Generality β€’ ex. Witchcraft, Database Adapters β€’ Framework β€’ ex. Phoenix, Nerves β€’ Feature Emulation β€’ ex. TypeClass β€’ Representation & Interface β€’ ex. Algae, Serialization

TOOLS OF THOUGHT πŸ› πŸ§  A TA X O N O M Y O F L I B R A R I E S πŸ“š β€’ Generality β€’ ex. Witchcraft, Database Adapters β€’ Framework β€’ ex. Phoenix, Nerves β€’ Feature Emulation β€’ ex. TypeClass β€’ Representation & Interface β€’ ex. Algae, Serialization β€’ Patterns β€’ ex. Quark, Exceptional

PORTING PRINCIPLES STRE TCHING WITHOUT SNAPPING πŸ’₯

It’s dangerous to go alone! Take this [advice]!

PORTING PRINCIPLES M O T I VAT I O N πŸ₯•

PORTING PRINCIPLES M O T I VAT I O N πŸ₯• β€’ Two styles of Scala 1. Java without the braces 2. Haskell fan fiction

PORTING PRINCIPLES M O T I VAT I O N πŸ₯• β€’ Two styles of Scala 1. Java without the braces 2. Haskell fan fiction β€’ β€œI’d need to convert my entire project for this lib to make sense” πŸ‘Ž

PORTING PRINCIPLES M O T I VAT I O N πŸ₯• β€’ Two styles of Scala 1. Java without the braces 2. Haskell fan fiction β€’ β€œI’d need to convert my entire project for this lib to make sense” πŸ‘Ž β€’ Also have seen this antipattern in production with Ruby, Swift, and JS

PORTING PRINCIPLES M O T I VAT I O N πŸ₯• β€’ Two styles of Scala 1. Java without the braces 2. Haskell fan fiction β€’ β€œI’d need to convert my entire project for this lib to make sense” πŸ‘Ž β€’ Also have seen this antipattern in production with Ruby, Swift, and JS β€’ It doesn’t have to be this way πŸš€

PORTING PRINCIPLES I, LIBRARY πŸ€–

PORTING PRINCIPLES I, LIBRARY πŸ€–

  1. Context Independence Each unit of code must be able to be taken on its own. An extension may not break nor alter the runtime semantics of either enclosed or exterior code.

PORTING PRINCIPLES I, LIBRARY πŸ€–

  1. Context Independence Each unit of code must be able to be taken on its own. An extension may not break nor alter the runtime semantics of either enclosed or exterior code. 2. Ethos An extension must remain consistent with the character of the host language and broadest community standards, except where such consistency would conflict with the First Law.

PORTING PRINCIPLES I, LIBRARY πŸ€–

  1. Context Independence Each unit of code must be able to be taken on its own. An extension may not break nor alter the runtime semantics of either enclosed or exterior code. 2. Ethos An extension must remain consistent with the character of the host language and broadest community standards, except where such consistency would conflict with the First Law. 3. Completeness An extension must introduce or integrate its concept(s) as completely as possible, as long as such constructs do not conflict with the First or Second Laws.

PORTING PRINCIPLES

  1. Context Independence Each unit of code must be able to be taken on its own. An extension may not break nor alter the runtime semantics of either enclosed or exterior code. 2. Ethos An extension must remain consistent with the character of the host language and broadest community standards, except where such consistency would conflict with the First Law. 3. Completeness An extension must introduce or integrate its concept(s) as completely as possible, as long as such constructs do not conflict with the First or Second Laws.

PORTING PRINCIPLES HEY! LISTEN! 🧚 1. Courage βš” Each unit of code must be able to be taken on its own. An extension may not break nor alter the runtime semantics of either enclosed or exterior code. 2. Wisdom πŸ“š An extension must remain consistent with the character of the host language and broadest community standards, except where such consistency would conflict with the First Law. 3. Power πŸš€ An extension must introduce or integrate its concept(s) as completely as possible, as long as such constructs do not conflict with the First or Second Laws.

CONTEXT INDEPENDENCE THE COURAGE TO VENTURE ALONE βš”

CONTEXT INDEPENDENCE THE COURAGE TO VENTURE ALONE βš”

The art of programming is the art of organizing complexity, of mastering multitude, and avoiding its bastard chaos as effectively as possible 🧘 EDSGER DIJKSTRA

Each unit of code must be able to be taken on its own. An extension must not break nor alter the runtime semantics of either enclosed or exterior code.

CONTEXT INDEPENDENCE I N D E P E N D E N C E D AY πŸ›Έ

CONTEXT INDEPENDENCE I N D E P E N D E N C E D AY πŸ›Έ β€’ Clarity, composability, and unambiguity β€’ Same class of thing as referential transparency β€’ Especially important with FP assumptions β€’ Each chunk of code (horizontal or vertical) should be comprehensible on its own β€’ Most common: behaviour depending on implicit or hidden state

CONTEXT INDEPENDENCE M A C R O S O K AY

CONTEXT INDEPENDENCE M A C R O S O K AY β€’ Despite structural changes from macros β€’ No macro mangle πŸ™… β€’ You have to try pretty hard to break this in Elixir

CONTEXT INDEPENDENCE CASE STUDY: Algae

CONTEXT INDEPENDENCE CASE STUDY: Algae β€’ Concept: Bootstrap structs into ADTs

CONTEXT INDEPENDENCE CASE STUDY: Algae β€’ Concept: Bootstrap structs into ADTs β€’ Takeaway: Composition, orthogonality, structured abstraction

CONTEXT INDEPENDENCE CASE STUDY: Algae β€’ Concept: Bootstrap structs into ADTs β€’ Takeaway: Composition, orthogonality, structured abstraction β€’ Removes nothing

CONTEXT INDEPENDENCE CASE STUDY: Algae β€’ Concept: Bootstrap structs into ADTs β€’ Takeaway: Composition, orthogonality, structured abstraction β€’ Removes nothing β€’ Adds β€’ Structure DSL β€’ Types with automatic default values β€’ Manual default values β€’ Constructor helpers (ex. Foo.new)

CONTEXT INDEPENDENCE CASE STUDY: Algae β€’ Concept: Bootstrap structs into ADTs β€’ Takeaway: Composition, orthogonality, structured abstraction β€’ Removes nothing β€’ Adds β€’ Structure DSL β€’ Types with automatic default values β€’ Manual default values β€’ Constructor helpers (ex. Foo.new) β€’ Turns into vanilla Elixir

CONTEXT INDEPENDENCE CASE STUDY: Algae

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE CASE STUDY: Algae All the features!

CONTEXT INDEPENDENCE 42 CASE STUDY: Algae 77 All the features! 1234 98 32

CONTEXT INDEPENDENCE 42 CASE STUDY: Algae 77 All the features! 1234 98 32

CONTEXT INDEPENDENCE 42 CASE STUDY: Algae 77 All the features! 1234 98 32

ETHOS T H E W I S D O M TO B A L A N C E C O N S I ST E N CY, C H A N G E , A N D R E ST R A I N T πŸ“š

ETHOS T H E W I S D O M TO B A L A N C E C O N S I ST E N CY, C H A N G E , A N D R E ST R A I N T πŸ“š

The utility of a language as a tool of thought increases with the range of topics it can treat, but decreases with the amount of vocabulary and the complexity of grammatical rules which the user must keep in mind πŸŽ› KENNETH IVERSON

An extension must remain consistent with the character of the host language and broadest community standards, except where such consistency would conflict with the First Law.

ETHOS A M AT T E R O F C H A R A C T E R

ETHOS A M AT T E R O F C H A R A C T E R β€’ Ethos β€” noun. (/ˈiːθɒs/ or US: /ˈiːθoʊs/) The fundamental character or spirit of a culture; the underlying sentiment that informs the beliefs, customs, or practices of a group or society; dominant assumptions of a people or period β€’ Like all interesting things, it’s the fuzziest β€’ Feel as close to the host language as possible β€’ But also blending in features from a target

ETHOS A M AT T E R O F C H A R A C T E R 🌌 β€’ Ethos β€” noun. (/ˈiːθɒs/ or US: /ˈiːθoʊs/) πŸ€” The fundamental character or spirit of a culture; the underlying sentiment that informs the beliefs, customs, or practices of a group or society; dominant assumptions of a people or period β€’ Like all interesting things, it’s the fuzziest β€’ Feel as close to the host language as possible β€’ But also blending in features from a target πŸ”Ί πŸ’­ Host πŸ—£ πŸ“ βš™ 🎭

ETHOS A M AT T E R O F C H A R A C T E R 🌌 β€’ Ethos β€” noun. (/ˈiːθɒs/ or US: /ˈiːθoʊs/) πŸ€” The fundamental character or spirit of a culture; the underlying sentiment that informs the beliefs, customs, or practices of a group or society; dominant assumptions of a people or period β€’ Like all interesting things, it’s the fuzziest β€’ Feel as close to the host language as possible β€’ But also blending in features from a target πŸ”Ί πŸ’­ Host πŸ—£ πŸ—£ πŸ—£ πŸ“ πŸ“ πŸ“ βš™ 🎭 Target

ETHOS CASE STUDY: Exceptional’S PIPES

ETHOS CASE STUDY: Exceptional’S PIPES β€’ Concept: Flow-ability is very core to Elixir’s ethos β€’ Kernel.|>/2

ETHOS CASE STUDY: Exceptional’S PIPES β€’ Concept: Flow-ability is very core to Elixir’s ethos β€’ Kernel.|>/2 β€’ Consistent flow metaphor / punning on existing metaphor β€’ Exceptional: ~>/2 and >>>/2

ETHOS CASE STUDY: Exceptional’S PIPES β€’ Concept: Flow-ability is very core to Elixir’s ethos β€’ Kernel.|>/2 β€’ Consistent flow metaphor / punning on existing metaphor β€’ Exceptional: ~>/2 and >>>/2

ETHOS CASE STUDY: Exceptional’S PIPES β€’ Concept: Flow-ability is very core to Elixir’s ethos β€’ Kernel.|>/2 β€’ Consistent flow metaphor / punning on existing metaphor β€’ Exceptional: ~>/2 and >>>/2

ETHOS CASE STUDY: Exceptional’S PIPES β€’ Concept: Flow-ability is very core to Elixir’s ethos β€’ Kernel.|>/2 β€’ Consistent flow metaphor / punning on existing metaphor β€’ Exceptional: ~>/2 and >>>/2

ETHOS CASE STUDY: Exceptional’S PIPES β€’ Concept: Flow-ability is very core to Elixir’s ethos β€’ Kernel.|>/2 β€’ Consistent flow metaphor / punning on existing metaphor β€’ Exceptional: ~>/2 and >>>/2

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design β€’ Fully adhering to the underlying Elixir’s ethos β€’ I get the most positive feedback from Exceptional

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design β€’ Fully adhering to the underlying Elixir’s ethos β€’ I get the most positive feedback from Exceptional β€’ Exception structs are totally antithetical to the Erlang ethos β€’ Hard when you’re trying to be highly interoperable

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design β€’ Fully adhering to the underlying Elixir’s ethos β€’ I get the most positive feedback from Exceptional β€’ Exception structs are totally antithetical to the Erlang ethos β€’ Hard when you’re trying to be highly interoperable

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design β€’ Fully adhering to the underlying Elixir’s ethos β€’ I get the most positive feedback from Exceptional β€’ Exception structs are totally antithetical to the Erlang ethos β€’ Hard when you’re trying to be highly interoperable β€’ Takeaway: Provide conversion functions if you go off script

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design β€’ Fully adhering to the underlying Elixir’s ethos β€’ I get the most positive feedback from Exceptional β€’ Exception structs are totally antithetical to the Erlang ethos β€’ Hard when you’re trying to be highly interoperable β€’ Takeaway: Provide conversion functions if you go off script

ETHOS CASE STUDY: TUPLES VS EXCEPTIONS β€’ Even internal tradeoffs in Elixir’s Kernel design β€’ Fully adhering to the underlying Elixir’s ethos β€’ I get the most positive feedback from Exceptional β€’ Exception structs are totally antithetical to the Erlang ethos β€’ Hard when you’re trying to be highly interoperable β€’ Takeaway: Provide conversion functions if you go off script

ETHOS STRONG CHARACTER

ETHOS STRONG CHARACTER β€’ Languages like C, Haskell, Rust, Elm, and Golang stand for something

ETHOS STRONG CHARACTER β€’ Languages like C, Haskell, Rust, Elm, and Golang stand for something β€’ Erlang designed for a practical application: telecom switches β€’ Erlang happened to land on FP

ETHOS STRONG CHARACTER β€’ Languages like C, Haskell, Rust, Elm, and Golang stand for something β€’ Erlang designed for a practical application: telecom switches β€’ Erlang happened to land on FP β€’ Elixir doesn’t have a clear language-level raison d’Γͺtre β€’ Like tofu: very easy to port in other flavours

INTERLUDE WHEREFORE ART THOU FUNCTIONAL PROGRAMMING? 🌹

INTERLUDE W H AT ’ S S O G R E AT A B O U T F P A N Y W AY ? πŸ₯³

INTERLUDE W H AT ’ S S O G R E AT A B O U T F P A N Y W AY ? πŸ₯³ β€’ Modularity β€’ Composition β€’ Can describe general solutions via abstraction! β€’ Make the large feel like the small & fewer patterns to memorize Z β€’ Maleable code β€’ HOFs transform your programs on the fly βš— β€’ ex. Enum.map/2 can be seen as adapting every item in a structure (operational), or as transforming the functor

INTERLUDE O P E R AT I O N A L V S D E N O TAT I O N A L T H I N K I N G

INTERLUDE O P E R AT I O N A L V S D E N O TAT I O N A L T H I N K I N G β€’ Enum.map/2 can be seen through the lens of… β€’ Data β€’ A cleaner for loop (operational) β€’ Run a function on every item in a structure β€’ Programs β€’ Transforms the input program into a new program

INTERLUDE FUNCTIONAL ALCHEMY βš— @spec long_form(integer()) :: String.t()

INTERLUDE FUNCTIONAL ALCHEMY βš— @spec long_form(integer()) :: String.t() @spec long_forms([integer()]) :: [String.t()]

INTERLUDE FUNCTIONAL ALCHEMY βš— @spec long_form(integer()) :: String.t() Enum.map/2 @spec long_forms([integer()]) :: [String.t()]

INTERLUDE FUNCTIONAL ALCHEMY βš— integer() String.t() Enum.map/2 [integer()] [String.t()]

INTERLUDE W H AT ’ S S O T E R R I B L E A B O U T F P A N Y W AY ? 😱

INTERLUDE W H AT ’ S S O T E R R I B L E A B O U T F P A N Y W AY ? 😱 β€’ The Church Chasm β€’ If you have a hammer, everything looks like a nail β€’ β€œUse anonymous functions for everything! Aren’t closures amazing?!” β€’ Can focus on mechanics rather than concepts β€’ Explicit state = lots of explicit handling, β€œpass the world”, &c β€’ A tendency towards the darkest of magics

INTERLUDE {:tarpit, β€œtradeoffs”}

INTERLUDE {:tarpit, β€œtradeoffs”} β€’ Surface simplicity has a cost β€’ Complex in the large β€’ Restricted domain in the small

INTERLUDE {:tarpit, β€œtradeoffs”} β€’ Surface simplicity has a cost β€’ Takeaway: strive for β€’ Complex in the large β€’ Orthogonality β€’ Restricted domain in the small β€’ Generality β€’ Extensibility

INTERLUDE ACTOR ABYSS

INTERLUDE ACTOR ABYSS β€’ Each step is very simple

INTERLUDE ACTOR ABYSS β€’ Each step is very simple β€’ Reasoning about dynamic organisms is hard β€’ Remember to store your data for crash recovery β€’ Called collaborator may not be there

INTERLUDE ACTOR ABYSS β€’ Each step is very simple β€’ Reasoning about dynamic organisms is hard β€’ Remember to store your data for crash recovery β€’ Called collaborator may not be there

INTERLUDE ACTOR ABYSS β€’ Each step is very simple β€’ Reasoning about dynamic organisms is hard β€’ Remember to store your data for crash recovery β€’ Called collaborator may not be there β€’ Exactly why GenStage is great! β€’ Abstract this all away for many use cases β€’ More concrete than arrows & better matches the Elixir ethos

INTERLUDE ACTOR ABYSS β€’ Each step is very simple β€’ Reasoning about dynamic organisms is hard β€’ Remember to store your data for crash recovery β€’ Called collaborator may not be there β€’ Exactly why GenStage is great! β€’ Abstract this all away for many use cases β€’ More concrete than arrows & better matches the Elixir ethos β€’ Complexity grows faster than linear

INTERLUDE ACTOR ABYSS β€’ Each step is very simple β€’ Reasoning about dynamic organisms is hard β€’ Remember to store your data for crash recovery β€’ Called collaborator may not be there β€’ Exactly why GenStage is great! β€’ Abstract this all away for many use cases β€’ More concrete than arrows & better matches the Elixir ethos β€’ Complexity grows faster than linear β€’ Takeaway: provide structured abstractions

INTERLUDE LANGUAGE SPECTRUM

INTERLUDE LANGUAGE SPECTRUM Imperative Declarative

INTERLUDE LANGUAGE SPECTRUM Imperative Declarative

INTERLUDE LANGUAGE SPECTRUM Imperative Declarative

INTERLUDE LANGUAGE PYRAMID Dynamic Operational Mechanistic πŸš‚ β€’β†’β€’ Universal ↓ ↓ Denotational β€’β†’β€’ Mathematics ] Contextual Semiotic Linguistic

INTERLUDE LANGUAGE PYRAMID Dynamic Operational Mechanistic πŸš‚ β€’β†’β€’ Universal ↓ ↓ Denotational β€’β†’β€’ Mathematics Overall historical trend ] Contextual Semiotic Linguistic

INTERLUDE LANGUAGE PYRAMID Dynamic Operational Mechanistic πŸš‚ β€’β†’β€’ Universal ↓ ↓ Denotational β€’β†’β€’ Mathematics Overall historical trend ] Contextual Semiotic Linguistic

INTERLUDE LANGUAGE PYRAMID Dynamic Operational Mechanistic πŸš‚ β€’β†’β€’ Universal ↓ ↓ Denotational β€’β†’β€’ Mathematics Overall historical trend ] Contextual Semiotic Linguistic

INTERLUDE LANGUAGE PYRAMID β€’β†’β€’ Universal ↓ ↓ Denotational β€’β†’β€’ Mathematics 🌌 πŸ€” πŸ”Ί πŸ’­ πŸ—£ πŸ“ βš™ 🎭 Dynamic Operational Mechanistic πŸš‚ Overall historical trend ] Contextual Semiotic Linguistic

INTERLUDE LANGUAGE PYRAMID β€’β†’β€’ Universal ↓ ↓ Denotational β€’β†’β€’ Mathematics πŸ”Ί πŸ’­ πŸ“ βš™ Dynamic Operational Mechanistic πŸš‚ πŸ€” πŸ—£ Overall historical trend ] Contextual Semiotic Linguistic

ETHOS T H E P I P E S S T R AT E G Y

ETHOS T H E P I P E S S T R AT E G Y β€’ A break in ethos from Erlang

ETHOS T H E P I P E S S T R AT E G Y β€’ A break in ethos from Erlang β€’ Fits Elixir’s strategy β€’ Clean β€’ Easy to follow β€’ Similar to OO’s fluent interfaces

ETHOS T H E P I P E S S T R AT E G Y β€’ A break in ethos from Erlang β€’ Fits Elixir’s strategy β€’ Clean β€’ Easy to follow β€’ Similar to OO’s fluent interfaces β€’ Helps to read like English

ETHOS T H E P I P E S S T R AT E G Y β€’ A break in ethos from Erlang β€’ Fits Elixir’s strategy β€’ Tradeoffs β€’ Operational/mechanistic mode of thought β€’ Clean β€’ Cleans up a lot of code β€’ Easy to follow β€’ Focus or β€œzoom” effect πŸ”­ β€’ Similar to OO’s fluent interfaces β€’ Zooming doesn’t really apply to actors β€’ Helps to read like English

ETHOS T H E P I P E S S T R AT E G Y β€’ A break in ethos from Erlang β€’ Fits Elixir’s strategy β€’ Tradeoffs β€’ Operational/mechanistic mode of thought β€’ Clean β€’ Cleans up a lot of code β€’ Easy to follow β€’ Focus or β€œzoom” effect πŸ”­ β€’ Similar to OO’s fluent interfaces β€’ Zooming doesn’t really apply to actors β€’ Helps to read like English β€’ Takeaway: consider you metaphors

ETHOS G U E S T L A N G U A G E S Y N TA X E S

ETHOS G U E S T L A N G U A G E S Y N TA X E S

ETHOS G U E S T L A N G U A G E S Y N TA X E S β€’ Which language is this?

ETHOS G U E S T L A N G U A G E S Y N TA X E S β€’ Which language is this?

ETHOS G U E S T L A N G U A G E S Y N TA X E S β€’ Which language is this?

ETHOS G U E S T L A N G U A G E S Y N TA X E S β€’ Which language is this? β€’ Does it matter?

ETHOS G U E S T L A N G U A G E S Y N TA X E S β€’ Which language is this? β€’ Does it matter? β€’ Is this appropriate?

ETHOS G U E S T L A N G U A G E S Y N TA X E S 🌌 πŸ€” πŸ”Ί β€’ Which language is this? β€’ Does it matter? β€’ Is this appropriate? πŸ’­ πŸ—£ πŸ—£ πŸ“ πŸ“ βš™ 🎭

COMPLETENESS THE POWER OF THE DARK SIDE πŸ’ͺ

COMPLETENESS THE POWER OF THE DARK SIDE πŸ’ͺ

COMPLETENESS THE POWER OF HARMONIOUS TOOLS πŸ’ͺ

The limits of my language mean the limits of my world πŸ™Š LUDWIG WIT TGENSTEIN

An extension must introduce or integrate its concept(s) as completely as possible, as long as such constructs do not conflict with the First or Second Laws.

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators β€’ ↑1 ⍡∨.∧3 4=+/,Β―1 0 1∘.βŠ–Β―1 0 1∘.βŒ½βŠ‚β΅

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators β€’ ↑1 ⍡∨.∧3 4=+/,Β―1 0 1∘.βŠ–Β―1 0 1∘.βŒ½βŠ‚β΅

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators β€’ ↑1 ⍡∨.∧3 4=+/,Β―1 0 1∘.βŠ–Β―1 0 1∘.βŒ½βŠ‚β΅ β€’ ~60 symbols, depending

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators β€’ ↑1 ⍡∨.∧3 4=+/,Β―1 0 1∘.βŠ–Β―1 0 1∘.βŒ½βŠ‚β΅ β€’ ~60 symbols, depending β€’ β€œIdioms over libraries”

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators β€’ ↑1 ⍡∨.∧3 4=+/,Β―1 0 1∘.βŠ–Β―1 0 1∘.βŒ½βŠ‚β΅ β€’ ~60 symbols, depending β€’ β€œIdioms over libraries” β€’ More than the sum of their parts

COMPLETENESS SWEE T SPOTS NEED NOT BE SUGARY a🍭 β€’ Synergistic combinators β€’ ↑1 ⍡∨.∧3 4=+/,Β―1 0 1∘.βŠ–Β―1 0 1∘.βŒ½βŠ‚β΅ β€’ ~60 symbols, depending β€’ β€œIdioms over libraries” β€’ More than the sum of their parts Attribution: wikipedia user LucasVB β€’ What a tragedy if we only had a few of these combinators!

COMPLETENESS INCOMPLETENESS 😑

COMPLETENESS INCOMPLETENESS 😑 β€’ Often see attempts to add β€œjust the parts I care about”

COMPLETENESS INCOMPLETENESS 😑 β€’ Often see attempts to add β€œjust the parts I care about” β€’ ex. Only %Maybe{} and bind/2 in a library

COMPLETENESS INCOMPLETENESS 😑 β€’ Often see attempts to add β€œjust the parts I care about” β€’ ex. Only %Maybe{} and bind/2 in a library β€’ Could have exponentially more utility!

COMPLETENESS INCOMPLETENESS 😑 β€’ Often see attempts to add β€œjust the parts I care about” β€’ ex. Only %Maybe{} and bind/2 in a library β€’ Could have exponentially more utility! β€’ If we see FP as a modular, adaptable system of transformations, we should have identity/1 and constant/2 combinators to stub out Enum.map/2

COMPLETENSS CASE STUDY: Witchcraft

COMPLETENSS CASE STUDY: Witchcraft β€’ You can go pretty far with extension if you have a macros β€’ ex. TypeClass

COMPLETENSS CASE STUDY: Witchcraft β€’ You can go pretty far with extension if you have a macros β€’ ex. TypeClass β€’ Update, clean, and power up Kernel functions β€’ Curried, async, flipped variants

CASE STUDY: Witchcraft SOURCES β›²

CASE STUDY: Witchcraft SOURCES β›² β€’ Cat Theory β†’ Haskell & PureScript & Elm &c β†’ Witchcraft

CASE STUDY: Witchcraft SOURCES β›² β€’ Cat Theory β†’ Haskell & PureScript & Elm &c β†’ Witchcraft β€’ Clean up the type class hierarchy β€’ Haskell β€’ Purescript β€’ Fantasy Land Specification β€’ and others

CASE STUDY: Witchcraft SOURCES β›² β€’ Cat Theory β†’ Haskell & PureScript & Elm &c β†’ Witchcraft β€’ Clean up the type class hierarchy β€’ Haskell β€’ Purescript β€’ Fantasy Land Specification β€’ and others β€’ Some pipings and naming β€’ Elm

CASE STUDY: Witchcraft SOURCES β›² β€’ Cat Theory β†’ Haskell & PureScript & Elm &c β†’ Witchcraft 🌌 β€’ Clean up the type class hierarchy πŸ€” β€’ Haskell πŸ”Ί β€’ Purescript πŸ’­ β€’ Fantasy Land Specification β€’ and others β€’ Some pipings and naming β€’ Elm Elixir πŸ—£ πŸ“ βš™ 🎭

CASE STUDY: Witchcraft SOURCES β›² β€’ Cat Theory β†’ Haskell & PureScript & Elm &c β†’ Witchcraft 🌌 β€’ Clean up the type class hierarchy πŸ€” β€’ Haskell πŸ”Ί β€’ Purescript πŸ’­ β€’ Fantasy Land Specification β€’ and others β€’ Some pipings and naming β€’ Elm Elixir πŸ—£ πŸ—£ πŸ’­ πŸ—£ πŸ—£ πŸ—£ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ βš™ 🎭

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity βœ…

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! βœ…

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance βœ…

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance β€’ Cute puns are an antipattern! βœ…

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance β€’ Cute puns are an antipattern!

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance β€’ Cute puns are an antipattern!

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance β€’ Cute puns are an antipattern! β€’ Operator >>> aliases

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance β€’ Cute puns are an antipattern! β€’ Operator >>> aliases β€’ Changed lots of argument orders

CASE STUDY: Witchcraft KEEPIN’ IT WITCHY d β€’ Imported things with immediate synergy β€’ Easy with type class hierarchies β€’ Renamed many functions for clarity β€’ Sometimes very hard! β€’ Had to resort to bad puns in one instance β€’ Cute puns are an antipattern! β€’ Operator >>> aliases β€’ Changed lots of argument orders β€’ Pipable |> everything is

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/*

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly provide = (<**>)

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly provide = (<**>)

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly provide = (<**>)

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly provide = (<**>)

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly provide = (<**>)

CASE STUDY: Witchcraft liftM/liftM2/liftM3/liftM4 β†’ lift/* β€’ Arity came in handy in a few places πŸ™Œ β€’ Collaborator functions renamed for metaphors so pipes make sense 😭 β€’ Sometime have to think nonlinearly provide = (<**>)

CASE STUDY: Witchcraft TypeClass

CASE STUDY: Witchcraft TypeClass

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft TypeClass β€’ Fully desugars into β€’ Modules β€’ Protocols β€’ Tons of sugar β€’ Generates a bunch of code β€’ A completeness pattern β€’ Functions for free!

CASE STUDY: Witchcraft COMPLETENESS COROLLARY: MODULARITY

CASE STUDY: Witchcraft COMPLETENESS COROLLARY: MODULARITY β€’ Breaking up Witchcraft libs was a very good idea β€’ Balance how much each lib should do β€’ Marketed as more reusable πŸ˜‰

CASE STUDY: Witchcraft TA K E A W AY S

CASE STUDY: Witchcraft TA K E A W AY S β€’ Specs > Libraries β€’ Think about how languages flow, and other physical metaphors β€’ Naming is very important, especially with directionality β€’ Balance between source and target language audiences β€’ ie: folks coming from Haskell to Elixir, and from Elixir to these concepts

A N T I PA T T E R N S GETTING IT WRONG i

Experience is the name everyone gives to their mistakes πŸ’” O S C A R W I L D E , β€œL A DY W I N D E R M E R E ’ S FA N β€œ

A N T I PAT T E R N S TORCHES AND PITCHFORKS

A N T I PAT T E R N S TORCHES AND PITCHFORKS If you feel like this you’ve probably created a monster

A N T I PAT T E R N S MIND TRAPS πŸ•³πŸ§ 

A N T I PAT T E R N S MIND TRAPS πŸ•³πŸ§  β€’ Identify the way you tend to fail

A N T I PAT T E R N S MIND TRAPS πŸ•³πŸ§  β€’ Identify the way you tend to fail β€’ My failure mode is to enforce correctness

A N T I PAT T E R N S MIND TRAPS πŸ•³πŸ§  β€’ Identify the way you tend to fail β€’ My failure mode is to enforce correctness β€’ Harder in libraries than in application code, since you have such control β€’ Great definitional power comes with great responsibility to your users!

A N T I PAT T E R N S MIND TRAPS πŸ•³πŸ§  β€’ Identify the way you tend to fail β€’ My failure mode is to enforce correctness β€’ Harder in libraries than in application code, since you have such control β€’ Great definitional power comes with great responsibility to your users! β€’ KISS principle 😘 β€’ Common trap: getting too cute with names and metaphors β€’ Names should be descriptive of what they do, not a brand exercise

A N T I PAT T E R N S FORCE PRACTICES ON USERS

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜–

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜–

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜– βœ…

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜– β€’ Enforced prop testing at compile time β€’ Slow β€’ Detracts people from using the lib βœ…

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜– β€’ Enforced prop testing at compile time β€’ Slow β€’ Detracts people from using the lib β€’ Wanted to encourage good practice βœ…

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜– β€’ Enforced prop testing at compile time β€’ Slow β€’ Detracts people from using the lib β€’ Wanted to encourage good practice β€’ Please give user choice βœ…

A N T I PAT T E R N S FORCE PRACTICES ON USERS β€’ Overall very happy with TypeClass β€’ Contains my biggest regret πŸ˜– β€’ Enforced prop testing at compile time β€’ Slow β€’ Detracts people from using the lib β€’ Wanted to encourage good practice β€’ Please give user choice β€’ Generate test helpers βœ…

A N T I PAT T E R N S REDEFINE / OVERWRITE Kernel

A N T I PAT T E R N S REDEFINE / OVERWRITE Kernel

A N T I PAT T E R N S REDEFINE / OVERWRITE Kernel

A N T I PAT T E R N S REDEFINE / OVERWRITE Kernel

A N T I PAT T E R N S REDEFINE / OVERWRITE Kernel a

A N T I PAT T E R N S A L L T H E O P E R AT O R S

A N T I PAT T E R N S A L L T H E O P E R AT O R S β€’ Super duper handy to have πŸŽ‰

A N T I PAT T E R N S A L L T H E O P E R AT O R S β€’ Super duper handy to have πŸŽ‰ β€’ Limited number of operators in Elixir

A N T I PAT T E R N S A L L T H E O P E R AT O R S β€’ Super duper handy to have πŸŽ‰ β€’ Limited number of operators in Elixir β€’ Operator-space collisions πŸ’₯

A N T I PAT T E R N S A L L T H E O P E R AT O R S β€’ Super duper handy to have πŸŽ‰ β€’ Limited number of operators in Elixir β€’ Operator-space collisions πŸ’₯ β€’ Handy if you’re user has one lib per application, but you don’t know

A N T I PAT T E R N S A L L T H E O P E R AT O R S β€’ Super duper handy to have πŸŽ‰ β€’ Limited number of operators in Elixir β€’ Operator-space collisions πŸ’₯ β€’ Handy if you’re user has one lib per application, but you don’t know β€’ Always provide a named variant β€’ Operator πŸ˜‰

A N T I PAT T E R N S A L L T H E O P E R AT O R S β€’ Super duper handy to have πŸŽ‰ β€’ Limited number of operators in Elixir β€’ Operator-space collisions πŸ’₯ β€’ Handy if you’re user has one lib per application, but you don’t know β€’ Always provide a named variant β€’ Operator πŸ˜‰

A N T I PAT T E R N S T H E O P T I O N T O D I S A M B I G U AT E

A N T I PAT T E R N S T H E O P T I O N T O D I S A M B I G U AT E What does this do?

A N T I PAT T E R N S T H E O P T I O N T O D I S A M B I G U AT E What does this do?

A N T I PAT T E R N S T H E O P T I O N T O D I S A M B I G U AT E What does this do?

PUT TING IT ALL TOGE THER πŸ—

PUT TING IT ALL TOGE THER πŸ— LET’S PORT A THING πŸ›³

PUT TING IT ALL TOGE THER πŸ— TOY EXAMPLE 🧸

PUT TING IT ALL TOGE THER πŸ— TOY EXAMPLE 🧸 β€’ What to port? πŸ€”

PUT TING IT ALL TOGE THER πŸ— TOY EXAMPLE 🧸 β€’ What to port? πŸ€” Imperative Declarative

PUT TING IT ALL TOGE THER πŸ— TOY EXAMPLE 🧸 β€’ What to port? πŸ€” β€’ Witchcraft already exists Imperative Declarative

PUT TING IT ALL TOGE THER πŸ— TOY EXAMPLE 🧸 β€’ What to port? πŸ€” β€’ Witchcraft already exists β€’ Let’s go the opposite direction Imperative Declarative

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦†

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is 1. Totally possible

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is 1. Totally possible 2. A terrible idea 🀣

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is 1. Totally possible 2. A terrible idea 🀣 β€’ Don’t try this at home

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is 1. Totally possible 2. A terrible idea 🀣 β€’ Don’t try this at home β€’ Trained professionals s

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is 1. Totally possible 2. A terrible idea 🀣 β€’ Don’t try this at home β€’ Trained professionals s β€’ Just a toy example 🧸

PUT TING IT ALL TOGE THER πŸ— F E AT U R E S β€’ Classes β€’ Mutable instance variables β€’ Constructor β€’ Methods (static and non-static) β€’ Dot notation & chaining β€’ Duck typing πŸ¦† β€’ Turns out that this is 1. Totally possible 2. A terrible idea 🀣 β€’ Don’t try this at home β€’ Trained professionals s β€’ Just a toy example 🧸 β€’ Garnet ♦

PUT TING IT ALL TOGE THER πŸ— GOING WHOLE-HOG πŸ–

PUT TING IT ALL TOGE THER πŸ— GOING WHOLE-HOG πŸ– β€’ Data hiding β€’ All functionality behind a single interface β€’ Essentially a struct β€’ Instance variables persist between calls β€’ Not going to handle inheritance, but totally possible β€’ TypeClass does something similar

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V1 ♦

PUT TING IT ALL TOGE THER πŸ— STEPPING BACK FROM THE BRINK v

PUT TING IT ALL TOGE THER πŸ— STEPPING BACK FROM THE BRINK v β€’ Too far! Revert! Revert! β€’ πŸ€” This pattern isn’t that uncommon β€’ Aside from the dot chaining 😱 β€’ Typically use GenServer or Agent β€’ What can we step back?

PUT TING IT ALL TOGE THER πŸ— STEPPING BACK FROM THE BRINK v β€’ Too far! Revert! Revert! β€’ πŸ€” This pattern isn’t that uncommon β€’ Aside from the dot chaining 😱 β€’ Typically use GenServer or Agent β€’ What can we step back? β€’ Analysis β€’ Getter/setter sugar is fine β€’ Zero linking control β€’ Static methods are just regular functions β€’ Data hiding can just be a process β€’ Map-like interface with chaining πŸ™… β€’ Operators are cute, but names are clearer β€’ Implicit variables: not ideal IMO, but sure β€’ Vive les pipes πŸ’ͺ

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦ ❌ struct or builder

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦ ❌ struct or builder ❌ anonymous functions

PUT TING IT ALL TOGE THER πŸ— GARNET V2 ♦ ❌ struct or builder ❌ anonymous functions (Much simpler to implement)

F I N A L TA K E A W AY S πŸ“¦

F I N A L TA K E A W AY S πŸ“¦ THE HIGH LEVEL REVIEW πŸ‘€

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES β€’ Standard libs are not sacred β€’ But all lib code should feel like it belongs in there! β€’ Just because you can doesn’t mean you should

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES β€’ Standard libs are not sacred β€’ But all lib code should feel like it belongs in there! β€’ Just because you can doesn’t mean you should β€’ Library-as-language-extension (think β€œversion x.1”)

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES β€’ Standard libs are not sacred β€’ But all lib code should feel like it belongs in there! β€’ Just because you can doesn’t mean you should β€’ Library-as-language-extension (think β€œversion x.1”) β€’ Languages are more than keywords; they’re philosophies and practices

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES β€’ Standard libs are not sacred β€’ But all lib code should feel like it belongs in there! β€’ Just because you can doesn’t mean you should β€’ Library-as-language-extension (think β€œversion x.1”) β€’ Languages are more than keywords; they’re philosophies and practices β€’ Language matters less than concepts

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES β€’ Standard libs are not sacred β€’ But all lib code should feel like it belongs in there! β€’ Just because you can doesn’t mean you should β€’ Library-as-language-extension (think β€œversion x.1”) β€’ Languages are more than keywords; they’re philosophies and practices β€’ Language matters less than concepts β€’ Focus on cohesion when extending or blending

F I N A L TA K E A W AY S πŸ“¦ BIG THEMES β€’ Standard libs are not sacred β€’ But all lib code should feel like it belongs in there! β€’ Just because you can doesn’t mean you should β€’ Library-as-language-extension (think β€œversion x.1”) β€’ Languages are more than keywords; they’re philosophies and practices β€’ Language matters less than concepts β€’ Focus on cohesion when extending or blending β€’ Love your code ❀

Like punning, programming is a play on words πŸ“š AL AN J. PERLIS

THANK YOU, KRAKΓ“W zπŸŽ‰ @EXPEDE GITHUB.COM/EXPEDE H E L L O @ B R O O K LY N Z E L E N K A . C O M