SlideShare a Scribd company logo
The Next Great Functional
Programming Language
(OK, not really.)
John A. De Goes — @jdegoes
ML - 1973
Haskell - 19901
OCaml - 19962
2
Or 1987 if you count Caml.
1
Or 1985 if you count Miranda.
Haskell
Haskellz
144 quadrillion flavors.
!
Our Best FPLs Suffer from
Decades Worth of
Accretion
Individual Features were
Designed, but the FPLs
Came Into Existence
What Would a Designed
FPL Look Like Today?
?
!
[This Slide Intentionally Left Blank]
My Ideal FPL
4 Pattern Matching
4 Records
4 Modules
4 Syntax
4 Type Classes
4 Nominative Typing
4 Data
4 Recursion
! Pattern Matching
Pattern Matching
import Lens.Family.Total
import Lens.Family.Stock
total :: Either Char Int -> String -- Same as:
total = _case -- total = case
& on _Left (c -> replicate 3 c ) -- Left c -> replicate 3 c
& on _Right (n -> replicate n '!') -- Right n -> replicate n '!'
! Records
Records
val book =
("author" ->> "Benjamin Pierce") ::
("title" ->> "Types and Programming Languages") ::
("id" ->> 262162091) ::
("price" ->> 44.11) ::
HNil
scala> book("author") // Note result type ...
res0: String = Benjamin Pierce
scala> val extended = book + ("inPrint" ->> true) // Add a new field
extended: ... complex type elided ... =
Benjamin Pierce :: Types and Programming Languages :: 262162091 :: 46.11 :: true :: HNil
scala> val noId = extended - "id" // Removed a field
noId: ... complex type elided ... =
Benjamin Pierce :: Types and Programming Languages :: 46.11 :: true :: HNil
! Modules
Modules
structure ListStack :> STACK =
struct
type t = 'a list
[...]
end
Modules
data Stack f = Stack
{ makeNew :: forall a. f a,
push :: forall a. a -> f a -> f a,
pop :: forall a. f a -> Maybe (Tuple a (f a)) }
doSomeStackStuff :: forall f. Stack f -> Thing
Modules
data Stack f = Stack
{ makeNew :: forall a. f a,
push :: forall a. a -> f a -> f a,
pop :: forall a. f a -> Maybe (Tuple a (f a)) }
data ReservationSystem f = ReservationSystem
(forall g. Stack g -> { ... })
! Syntax
Syntax
Let's stop pretending programs are strings of ASCII
characters.
4 implicits
4 order of function parameters / application
4 compiler errors
4 funky looking operators
4 scopes
4 Haskell-style (fake) modules & imports
4 name clashes
4 information elision
4 ...
! Type Classes
Type Classes
Just 'records' with compiler-enforced laws.3
3
Type classes also add an implicitly applied (a : Type) -> TypeClass a function that's piecewise-
defined, but that's just syntax.
! Partiality
Partiality
If it's partial, it's not a &^@#% function.
! Nominative Typing
Nominative Typing
data Email = Email String
data DOMId = DOMId String
data Positive = Positive Float
data Negative = Negative Float
data DressSize = DressSize Float
Nominative Typing
data ??? = ??? String
data ??? = ??? String
data ??? = ??? Float
data ??? = ??? Float
data ??? = ??? Float
Let's Stop Pretending
Differences in Names
Actually Matter
Nominative Typing
Let's play a guessing game.
data ??? = ??? -- {v: Float | v > 0}
data ??? = ??? -- {v: Float | v < 0}
! Data
Data
Data: Bits-based description.
data Either a b = Left a | Right b
struct either {
int tag;
union {
void *left;
void *right;
};
};
Data
Newbies: addicted to pattern matching.
data List a = Nil | Cons a (List a)
doSomething :: forall a. List a -> Int
doSomething Nil = 0
doSomething (Cons _ l) = 1 + doSomething l
Data
Pros: addicted to folds.
fold :: forall z a. z -> (z -> a -> z) -> List a -> z
fold z _ Nil = z
fold z f (Cons a l) = fold (f z a) l
Data
Folds: Capability-based description.
fold :: forall z a. z -> (z -> a -> z) -> List a -> z
data List a = List (forall z. z -> (z -> a -> z) -> z)
Data
data List a = List (forall z. z -> (z -> a -> z) -> z)
nil = z f -> z
cons a (List as) = z f -> as (f a z) f
Array? Linked List? Vector? Skip List?4
4
Strictly more powerful than a data List (pros & cons).
! Recursion
Recursion
Goto of functional programming.5
f x = if x / 2 > x then g (2 * x) else 42
g x = if x % 1 == 0 then f (g (x + 1)) else h (x - 1)
h x = if x % 1 == 1 then f (x * 2 + 1) else g (x + 1)
5
What's hard for a machine|human to understand is also hard for a human|machine to understand.
Recursion
Induction -> Folds.
Recursion
Coinduction -> State Machines.
type Machine s a b = (s, (s, a) -> (s, b))
6
6
Except this is too weakly typed.
My Ideal FPL
My Ideal FPL
Layered like an onion.
4 Turing incomplete for 99% of program
4 Prove / optimize more
4 Turing complete 'driver'
4 Prove / optimize less
4 Possibly in a different language (e.g. Haskell)
My Ideal FPL
Structured editor.
4 Friendly FP
4 Destroys motivation for most language 'features'
My Ideal FPL
All the things are values.
4 Math functions
4 Abolish incidental complexity
4 Abolish artificial distinctions
My Ideal FPL
Proof search.
4 Turing complete
4 Levels of proof
1. Proven true
2. Evidence for truth but not proven true
3. Proven false (in general or by counterexample)
4 Massive, persistent proof databases
4 Cross-disciplinary research
4 e.g. deep learning to accelerate proof search
My Ideal FPL
Zero cost abstraction.
4 As long as we're shooting for the moon
4 (But genuinely easier w/o recursion/data)
Inspirations
4 Unison Programming Language7
4 LiquidHaskell8
4 Morte9
9
http://www.haskellforall.com/2014/09/morte-intermediate-language-for-super.html
8
http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/
7
http://unisonweb.org
THANK YOU
John A. De Goes — @jdegoes

More Related Content

PDF
MTL Versus Free
PDF
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
PDF
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
PDF
First-Class Patterns
PDF
All Aboard The Scala-to-PureScript Express!
PDF
Post-Free: Life After Free Monads
PDF
Orthogonal Functional Architecture
PDF
Halogen: Past, Present, and Future
MTL Versus Free
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
First-Class Patterns
All Aboard The Scala-to-PureScript Express!
Post-Free: Life After Free Monads
Orthogonal Functional Architecture
Halogen: Past, Present, and Future

What's hot (20)

PDF
Scalaz 8: A Whole New Game
PDF
Big picture of category theory in scala with deep dive into contravariant and...
PDF
The Death of Final Tagless
PDF
Blazing Fast, Pure Effects without Monads — LambdaConf 2018
PDF
Functor, Apply, Applicative And Monad
PDF
Contravariant functors in scala
PDF
Advanced Tagless Final - Saying Farewell to Free
PDF
The Design of the Scalaz 8 Effect System
PDF
One Monad to Rule Them All
PDF
GUL UC3M - Introduction to functional programming
PDF
T3chFest 2016 - The polyglot programmer
PDF
Core csharp and net quick reference
PDF
Introduction to functional programming using Ocaml
PDF
O caml2014 leroy-slides
PDF
Monoids, Monoids, Monoids - ScalaLove 2020
PDF
Scalaz 8 vs Akka Actors
PDF
Testing in the World of Functional Programming
PDF
Why functional programming and category theory strongly matters
PDF
Why Haskell
PDF
Principled Error Handling with FP
Scalaz 8: A Whole New Game
Big picture of category theory in scala with deep dive into contravariant and...
The Death of Final Tagless
Blazing Fast, Pure Effects without Monads — LambdaConf 2018
Functor, Apply, Applicative And Monad
Contravariant functors in scala
Advanced Tagless Final - Saying Farewell to Free
The Design of the Scalaz 8 Effect System
One Monad to Rule Them All
GUL UC3M - Introduction to functional programming
T3chFest 2016 - The polyglot programmer
Core csharp and net quick reference
Introduction to functional programming using Ocaml
O caml2014 leroy-slides
Monoids, Monoids, Monoids - ScalaLove 2020
Scalaz 8 vs Akka Actors
Testing in the World of Functional Programming
Why functional programming and category theory strongly matters
Why Haskell
Principled Error Handling with FP
Ad

Similar to The Next Great Functional Programming Language (20)

PDF
Introduction to Functional Languages
KEY
An Introduction to Functional Programming using Haskell
PDF
Functional Programming and Haskell - TWBR Away Day 2011
PPS
Presentation of GetTogether on Functional Programming
PDF
01. haskell introduction
PDF
Is there a perfect data-parallel programming language? (Experiments with More...
PPT
Functional Programming - Past, Present and Future
PPT
Functional Programming Past Present Future
PPT
haskell5.ppt is a marketing document lol
PDF
Scala Functional Patterns
PDF
Functional programming with haskell
PPTX
Can programming be liberated from the von neumann style?
PDF
A taste of Functional Programming
PPTX
Good functional programming is good programming
KEY
Five Languages in a Moment
PDF
10. haskell Modules
PDF
Why Haskell Matters
PDF
02. haskell motivation
PDF
The Fuss about || Haskell | Scala | F# ||
PDF
[FLOLAC'14][scm] Functional Programming Using Haskell
Introduction to Functional Languages
An Introduction to Functional Programming using Haskell
Functional Programming and Haskell - TWBR Away Day 2011
Presentation of GetTogether on Functional Programming
01. haskell introduction
Is there a perfect data-parallel programming language? (Experiments with More...
Functional Programming - Past, Present and Future
Functional Programming Past Present Future
haskell5.ppt is a marketing document lol
Scala Functional Patterns
Functional programming with haskell
Can programming be liberated from the von neumann style?
A taste of Functional Programming
Good functional programming is good programming
Five Languages in a Moment
10. haskell Modules
Why Haskell Matters
02. haskell motivation
The Fuss about || Haskell | Scala | F# ||
[FLOLAC'14][scm] Functional Programming Using Haskell
Ad

More from John De Goes (16)

PDF
Refactoring Functional Type Classes
PDF
Error Management: Future vs ZIO
PDF
Atomically { Delete Your Actors }
PDF
Scalaz Stream: Rebirth
PDF
Scalaz Stream: Rebirth
PDF
ZIO Schedule: Conquering Flakiness & Recurrence with Pure Functional Programming
PDF
ZIO Queue
PDF
Streams for (Co)Free!
PDF
Getting Started with PureScript
PPTX
SlamData - How MongoDB Is Powering a Revolution in Visual Analytics
PPTX
The Dark Side of NoSQL
PDF
Quirrel & R for Dummies
PDF
In-Database Predictive Analytics
PDF
Analytics Maturity Model
PDF
Rise of the scientific database
PDF
Fun with automata
Refactoring Functional Type Classes
Error Management: Future vs ZIO
Atomically { Delete Your Actors }
Scalaz Stream: Rebirth
Scalaz Stream: Rebirth
ZIO Schedule: Conquering Flakiness & Recurrence with Pure Functional Programming
ZIO Queue
Streams for (Co)Free!
Getting Started with PureScript
SlamData - How MongoDB Is Powering a Revolution in Visual Analytics
The Dark Side of NoSQL
Quirrel & R for Dummies
In-Database Predictive Analytics
Analytics Maturity Model
Rise of the scientific database
Fun with automata

Recently uploaded (20)

PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administraation Chapter 3
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPT
Introduction Database Management System for Course Database
PDF
top salesforce developer skills in 2025.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
System and Network Administration Chapter 2
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Softaken Excel to vCard Converter Software.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Digital Strategies for Manufacturing Companies
System and Network Administraation Chapter 3
VVF-Customer-Presentation2025-Ver1.9.pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Introduction Database Management System for Course Database
top salesforce developer skills in 2025.pdf
history of c programming in notes for students .pptx
Odoo POS Development Services by CandidRoot Solutions
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Which alternative to Crystal Reports is best for small or large businesses.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
System and Network Administration Chapter 2
Wondershare Filmora 15 Crack With Activation Key [2025
How Creative Agencies Leverage Project Management Software.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025

The Next Great Functional Programming Language

  • 1. The Next Great Functional Programming Language (OK, not really.) John A. De Goes — @jdegoes
  • 2. ML - 1973 Haskell - 19901 OCaml - 19962 2 Or 1987 if you count Caml. 1 Or 1985 if you count Miranda.
  • 5. Our Best FPLs Suffer from Decades Worth of Accretion
  • 6. Individual Features were Designed, but the FPLs Came Into Existence
  • 7. What Would a Designed FPL Look Like Today?
  • 8. ?
  • 9. !
  • 11. My Ideal FPL 4 Pattern Matching 4 Records 4 Modules 4 Syntax 4 Type Classes 4 Nominative Typing 4 Data 4 Recursion
  • 13. Pattern Matching import Lens.Family.Total import Lens.Family.Stock total :: Either Char Int -> String -- Same as: total = _case -- total = case & on _Left (c -> replicate 3 c ) -- Left c -> replicate 3 c & on _Right (n -> replicate n '!') -- Right n -> replicate n '!'
  • 15. Records val book = ("author" ->> "Benjamin Pierce") :: ("title" ->> "Types and Programming Languages") :: ("id" ->> 262162091) :: ("price" ->> 44.11) :: HNil scala> book("author") // Note result type ... res0: String = Benjamin Pierce scala> val extended = book + ("inPrint" ->> true) // Add a new field extended: ... complex type elided ... = Benjamin Pierce :: Types and Programming Languages :: 262162091 :: 46.11 :: true :: HNil scala> val noId = extended - "id" // Removed a field noId: ... complex type elided ... = Benjamin Pierce :: Types and Programming Languages :: 46.11 :: true :: HNil
  • 17. Modules structure ListStack :> STACK = struct type t = 'a list [...] end
  • 18. Modules data Stack f = Stack { makeNew :: forall a. f a, push :: forall a. a -> f a -> f a, pop :: forall a. f a -> Maybe (Tuple a (f a)) } doSomeStackStuff :: forall f. Stack f -> Thing
  • 19. Modules data Stack f = Stack { makeNew :: forall a. f a, push :: forall a. a -> f a -> f a, pop :: forall a. f a -> Maybe (Tuple a (f a)) } data ReservationSystem f = ReservationSystem (forall g. Stack g -> { ... })
  • 21. Syntax Let's stop pretending programs are strings of ASCII characters. 4 implicits 4 order of function parameters / application 4 compiler errors 4 funky looking operators 4 scopes 4 Haskell-style (fake) modules & imports 4 name clashes 4 information elision 4 ...
  • 23. Type Classes Just 'records' with compiler-enforced laws.3 3 Type classes also add an implicitly applied (a : Type) -> TypeClass a function that's piecewise- defined, but that's just syntax.
  • 25. Partiality If it's partial, it's not a &^@#% function.
  • 27. Nominative Typing data Email = Email String data DOMId = DOMId String data Positive = Positive Float data Negative = Negative Float data DressSize = DressSize Float
  • 28. Nominative Typing data ??? = ??? String data ??? = ??? String data ??? = ??? Float data ??? = ??? Float data ??? = ??? Float
  • 29. Let's Stop Pretending Differences in Names Actually Matter
  • 30. Nominative Typing Let's play a guessing game. data ??? = ??? -- {v: Float | v > 0} data ??? = ??? -- {v: Float | v < 0}
  • 32. Data Data: Bits-based description. data Either a b = Left a | Right b struct either { int tag; union { void *left; void *right; }; };
  • 33. Data Newbies: addicted to pattern matching. data List a = Nil | Cons a (List a) doSomething :: forall a. List a -> Int doSomething Nil = 0 doSomething (Cons _ l) = 1 + doSomething l
  • 34. Data Pros: addicted to folds. fold :: forall z a. z -> (z -> a -> z) -> List a -> z fold z _ Nil = z fold z f (Cons a l) = fold (f z a) l
  • 35. Data Folds: Capability-based description. fold :: forall z a. z -> (z -> a -> z) -> List a -> z data List a = List (forall z. z -> (z -> a -> z) -> z)
  • 36. Data data List a = List (forall z. z -> (z -> a -> z) -> z) nil = z f -> z cons a (List as) = z f -> as (f a z) f Array? Linked List? Vector? Skip List?4 4 Strictly more powerful than a data List (pros & cons).
  • 38. Recursion Goto of functional programming.5 f x = if x / 2 > x then g (2 * x) else 42 g x = if x % 1 == 0 then f (g (x + 1)) else h (x - 1) h x = if x % 1 == 1 then f (x * 2 + 1) else g (x + 1) 5 What's hard for a machine|human to understand is also hard for a human|machine to understand.
  • 40. Recursion Coinduction -> State Machines. type Machine s a b = (s, (s, a) -> (s, b)) 6 6 Except this is too weakly typed.
  • 42. My Ideal FPL Layered like an onion. 4 Turing incomplete for 99% of program 4 Prove / optimize more 4 Turing complete 'driver' 4 Prove / optimize less 4 Possibly in a different language (e.g. Haskell)
  • 43. My Ideal FPL Structured editor. 4 Friendly FP 4 Destroys motivation for most language 'features'
  • 44. My Ideal FPL All the things are values. 4 Math functions 4 Abolish incidental complexity 4 Abolish artificial distinctions
  • 45. My Ideal FPL Proof search. 4 Turing complete 4 Levels of proof 1. Proven true 2. Evidence for truth but not proven true 3. Proven false (in general or by counterexample) 4 Massive, persistent proof databases 4 Cross-disciplinary research 4 e.g. deep learning to accelerate proof search
  • 46. My Ideal FPL Zero cost abstraction. 4 As long as we're shooting for the moon 4 (But genuinely easier w/o recursion/data)
  • 47. Inspirations 4 Unison Programming Language7 4 LiquidHaskell8 4 Morte9 9 http://www.haskellforall.com/2014/09/morte-intermediate-language-for-super.html 8 http://goto.ucsd.edu/~rjhala/liquid/haskell/blog/ 7 http://unisonweb.org
  • 48. THANK YOU John A. De Goes — @jdegoes