SlideShare a Scribd company logo
1 of 179
Download to read offline
Yan Cui @theburningmonk
hi,I’mYanCui
http://bit.ly/1SPNPn7
ZOOZU
VAPA
BOROU
DUMBU
dark shades of blue, red, green & purple
white & some shades of yellow
some shades of green & blue
other shades of green, red & brown
“The limits of my
language means the
limits of my world.”
- Ludwig Wittgenstein
agenda
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
your
app
your
app
CSVCSVCSV
CSVCSVXML
your
app
CSVCSVCSV
CSVCSVXML
some
service
your
app
CSVCSVCSV
CSVCSVXML
some
service
DB
1. define DTO types
2. I/O
3. marshal data into DTO
4. do useful work
1. define DTO types
2. I/O
3. marshal data into DTO
4. do useful work
compiler
provideexternal
data source typed info
type providers
intellisense
tooltips
…
intellisense over S3
buckets & objects!
compile time validation
no code generation
R
FunScript
Azure
Amazon S3
CSVSQLite
SQL Server
WSDL
WorldBank
Regex
ODATA IKVM
Facebook
Apiary
XAMLFreebase
Hadoop
Oracle
Minesweeper
Don Syme
Powershell
JSON
Fizzbuzz
Mixin
RSS
Matlab
Dates
NorthPole
XML
Python
Don Syme can taste lies.
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
“…a clean design is one that
supports visual thinking so
people can meet their
informational needs with a
minimum of conscious effort.”
- Daniel Higginbotham
(www.visualmess.com)
Whilst talking with an ex-colleague, a question came up on how to implement the Stable Marriage
problem using a message passing approach. Naturally, I wanted to answer that question with Erlang!
Let’s first dissect the problem and decide what processes we need and how they need to interact with
one another.
The stable marriage problem is commonly stated as:
Given n men and n women, where each person has ranked all members of the opposite sex with a
unique number between 1 and n in order of preference, marry the men and women together such that
there are no two people of opposite sex who would both rather have each other than their current
partners. If there are no such people, all the marriages are “stable”. (It is assumed that the participants
are binary gendered and that marriages are not same-sex).
From the problem description, we can see that we need:
* a module for man
* a module for woman
* a module for orchestrating the experiment
In terms of interaction between the different modules, I imagined something along the lines of…
how we read ENGLISH
see also http://bit.ly/1KN8cd0
Whilst talking with an ex-colleague, a question came up on how to implement the Stable Marriage
problem using a message passing approach. Naturally, I wanted to answer that question with Erlang!
Let’s first dissect the problem and decide what processes we need and how they need to interact with
one another.
The stable marriage problem is commonly stated as:
Given n men and n women, where each person has ranked all members of the opposite sex with a
unique number between 1 and n in order of preference, marry the men and women together such that
there are no two people of opposite sex who would both rather have each other than their current
partners. If there are no such people, all the marriages are “stable”. (It is assumed that the participants
are binary gendered and that marriages are not same-sex).
From the problem description, we can see that we need:
* a module for man
* a module for woman
* a module for orchestrating the experiment
In terms of interaction between the different modules, I imagined something along the lines of…
2.top-to-bottom
1.left-to-right
how we read ENGLISH
see also http://bit.ly/1KN8cd0
how we read CODE
public void DoSomething(int x, int y)
{
Foo(y,
Bar(x,
Zoo(Monkey())));
}
see also http://bit.ly/1KN8cd0
how we read CODE
public void DoSomething(int x, int y)
{
Foo(y,
Bar(x,
Zoo(Monkey())));
}
2.bottom-to-top
1.right-to-left
see also http://bit.ly/1KN8cd0
Whilst talking with an ex-colleague, a question came up on
how to implement the Stable Marriage problem using a
message passing approach. Naturally, I wanted to answer
that question with Erlang!
Let’s first dissect the problem and decide what processes we
need and how they need to interact with one another.
The stable marriage problem is commonly stated as:
Given n men and n women, where each person has ranked
all members of the opposite sex with a unique number
between 1 and n in order of preference, marry the men and
women together such that there are no two people of
opposite sex who would both rather have each other than
their current partners. If there are no such people, all the
marriages are “stable”. (It is assumed that the participants
are binary gendered and that marriages are not same-sex).
From the problem description, we can see that we need:
* a module for man
* a module for woman
* a module for orchestrating the experiment
In terms of interaction between the different modules, I
imagined something along the lines of…
2.top-to-bottom
1.left-to-right
how we read ENGLISH
public void DoSomething(int x, int y)
{
Foo(y,
Bar(x,
Zoo(Monkey())));
}
2.top-to-bottom
1.right-to-left
how we read CODE
see also http://bit.ly/1KN8cd0
“…a clean design is one that
supports visual thinking so
people can meet their
informational needs with a
minimum of conscious effort.”
|>
how we read CODE
let drawCircle x y radius =
radius |> circle
|> filled (rgb 150 170 150)
|> alpha 0.5
|> move (x, y)
see also http://bit.ly/1KN8cd0
how we read CODE
let drawCircle x y radius =
radius |> circle
|> filled (rgb 150 170 150)
|> alpha 0.5
|> move (x, y)
2.top-to-bottom
1.left-to-right
see also http://bit.ly/1KN8cd0
let drawCircle x y radius =
circle radius
|> filled (rgb 150 170 150)
|> alpha 0.5
|> move (x, y)
see also http://bit.ly/1KN8cd0
let drawCircle x y radius =
circle radius
|> filled (rgb 150 170 150)
|> alpha 0.5
|> move (x, y)
see also http://bit.ly/1KN8cd0
let drawCircle x y radius =
circle radius
|> filled (rgb 150 170 150)
|> alpha 0.5
|> move (x, y)
see also http://bit.ly/1KN8cd0
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
NASA orbiter crashed
because one engineer
accidentally used miles
instead of kilometres
you’re never too smart
to make mistakes
unit-of-measure
[<Measure>]
type Pence
e.g. 42<Pence>
153<Pence>
…
10<Meter> / 2<Second> = 5<Meter/Second>
10<Meter> * 2<Second> = 20<Meter Second>
10<Meter> + 10<Meter> = 20<Meter>
10<Meter> * 10 = 100<Meter>
10<Meter> * 10<Meter> = 100<Meter2>
10<Meter> + 2<Second> // error
10<Meter> + 2 // error
10<Meter> / 2<Second> = 5<Meter/Second>
10<Meter> * 2<Second> = 20<Meter Second>
10<Meter> + 10<Meter> = 20<Meter>
10<Meter> * 10 = 100<Meter>
10<Meter> * 10<Meter> = 100<Meter2>
10<Meter> + 2<Second> // error
10<Meter> + 2 // error
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
Duck Typing
If it looks like a duck
and quacks like a
duck, it's a duck
def say_quack(duck):
duck.quack()
def say_quack(duck):
duck.quack()
Convenience
Safety
implicit
interface
implementation
type Duck interface
{
Quack()
}
see also http://bit.ly/1ER5zVs
func sayQuack(duck Duck) {
duck.Quack()
}
see also http://bit.ly/1ER5zVs
type Donald struct { }
func (d Donald) Quack()
{
fmt.Println(“quack quack!”)
}
see also http://bit.ly/1ER5zVs
type Bird struct { }
func (b Bird) Quack()
{
fmt.Println(“tweet tweet!”)
}
see also http://bit.ly/1ER5zVs
func main() {
donald := Donald{}
sayQuack(donald)
bird := Bird{}
sayQuack(bird)
}
see also http://bit.ly/1ER5zVs
quack quack!
func main() {
donald := Donald{}
sayQuack(donald)
bird := Bird{}
sayQuack(bird)
}
tweet tweet!
func main() {
donald := Donald{}
sayQuack(donald)
bird := Bird{}
sayQuack(bird)
}
type Dog struct { }
func (d Dog) Bark()
{
fmt.Println(“woof woof!”)
}
see also http://bit.ly/1ER5zVs
func main() {
dog := Dog{}
sayQuack(dog)
}
main.go:40: cannot use dog (type Dog) as type
Duck in argument to sayQuack:
Dog does not implement Duck (missing
Quack method)
see also http://bit.ly/1ER5zVs
Convenience Safety
see also http://bit.ly/1ER5zVs
patterns are observed
after the fact
see also http://bit.ly/1ER5zVs
system building is also
a process of learning
and discovery
see also http://bit.ly/1ER5zVs
implementation
package
interface package
see also http://bit.ly/1ER5zVs
encourages precise
interface definitions
see also http://bit.ly/1ER5zVs
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
Homoiconicity
…homoiconicity is a property of some
programming languages in which the program
structure is similar to its syntax, and therefore
the program’s internal representation can be
inferred by reading the text’s layout…
code is data
data is code
(let [x 1]
(inc x))
see also http://bit.ly/1PpIrjS
(let [x 1]
(inc x))
=> 2
see also http://bit.ly/1PpIrjS
list (1 2 3)
vector [1 2 3]
see also http://bit.ly/1PpIrjS
(let [x 1]
(inc x))
list
see also http://bit.ly/1PpIrjS
(let [x 1]
(inc x))
symbol
see also http://bit.ly/1PpIrjS
(let [x 1]
(inc x))
vector
see also http://bit.ly/1PpIrjS
(let [x 1]
(inc x))
list
see also http://bit.ly/1PpIrjS
form :
code as data structure
see also http://bit.ly/1PpIrjS
code data
quote
eval
see also http://bit.ly/1PpIrjS
quote
(+ 1 2)
=> 3
see also http://bit.ly/1PpIrjS
quote
(+ 1 2)
=> 3
(quote (+ 1 2))
=> (+ 1 2)
see also http://bit.ly/1PpIrjS
quote
(+ 1 2)
=> 3
(quote (+ 1 2))
=> (+ 1 2)
‘(+ 1 2)
=> (+ 1 2)
see also http://bit.ly/1PpIrjS
eval
‘(+ 1 2)
=> (+ 1 2)
(eval ‘(+ 1 2))
=> 3
see also http://bit.ly/1PpIrjS
macros
(defmacro assert-equals [actual expected]
‘(let [actual-val# ~actual]
(when-not (= actual-val# ~expected)
(throw
(AssertionError.
(str “FAIL in “ ‘~actual
“n expected: “ ‘~expected
“n actual: “ actual-val#))))))
see also http://bit.ly/1PpIrjS
(assert-equals (inc 1) 2) ; => nil
(assert-equals (inc 1) (+ 0 1))
; => AssertionError FAIL in (inc 1)
; expected: (+ 0 1)
; actual: 2
see also http://bit.ly/1PpIrjS
(assert-equals (inc 1) 2) ; => nil
(assert-equals (inc 1) (+ 0 1))
; => AssertionError FAIL in (inc 1)
; expected: (+ 0 1)
; actual: 2
see also http://bit.ly/1PpIrjS
(assert-equals (inc 1) 2) ; => nil
(assert-equals (inc 1) (+ 0 1))
; => AssertionError FAIL in (inc 1)
; expected: (+ 0 1)
; actual: 2
huh?? where? what? how?
see also http://bit.ly/1PpIrjS
(defmacro assert-equals [actual expected]
‘(let [actual-val# ~actual]
(when-not (= actual-val# ~expected)
(throw
(AssertionError.
(str “FAIL in “ ‘~actual
“n expected: “ ‘~expected
“n actual: “ actual-val#))))))
(assert-equals (inc 1) (+ 0 1))
see also http://bit.ly/1PpIrjS
(defmacro assert-equals [actual expected]
‘(let [actual-val# ~actual]
(when-not (= actual-val# ~expected)
(throw
(AssertionError.
(str “FAIL in “ ‘~actual
“n expected: “ ‘~expected
“n actual: “ actual-val#))))))
(assert-equals (inc 1) (+ 0 1))
see also http://bit.ly/1PpIrjS
(defmacro assert-equals [actual expected]
‘(let [actual-val# ~actual]
(when-not (= actual-val# ~expected)
(throw
(AssertionError.
(str “FAIL in “ ‘~actual
“n expected: “ ‘~expected
“n actual: “ actual-val#))))))
(assert-equals (inc 1) (+ 0 1))
see also http://bit.ly/1PpIrjS
(defmacro assert-equals [actual expected]
‘(let [actual-val# ~actual]
(when-not (= actual-val# ~expected)
(throw
(AssertionError.
(str “FAIL in “ ‘~actual
“n expected: “ ‘~expected
“n actual: “ actual-val#))))))
see also http://bit.ly/1PpIrjS
(defmacro assert-equals [actual expected]
‘(let [actual-val# ~actual]
(when-not (= actual-val# ~expected)
(throw
(AssertionError.
(str “FAIL in “ ‘~actual
“n expected: “ ‘~expected
“n actual: “ actual-val#))))))
‘(
see also http://bit.ly/1PpIrjS
expanded at
compile time
see also http://bit.ly/1PpIrjS
(macroexpand '(assert-equals (inc 1) (+ 0 1)))
; =>
; (let* [actual-value__16087__auto__ (inc 1)]
; (clojure.core/when-not
; (clojure.core/= actual-value__16087__auto__ (+ 0 1))
; (throw (java.lang.AssertionError.
; (clojure.core/str
; "FAIL in " (quote (inc 1))
; "nexpected: " (quote (+ 0 1))
; "n actual: " actual-value__16087__auto__)))))
see also http://bit.ly/1PpIrjS
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
GC is great
runtime cost
ownership
see also http://bit.ly/1F6WBVD
memory safety
without GC
see also http://bit.ly/1F6WBVD
ZERO
runtime cost
see also http://bit.ly/1F6WBVD
safety + speed
see also http://bit.ly/1F6WBVD
fn foo() {
// v has ownership of the vector
let v = vec![1, 2, 3];
// mutable binding
let mut v2 = vec![];
}
// vector is deallocated at the
// end of scope,
// this happens deterministically
see also http://bit.ly/1F6WBVD
immutable by default
see also http://bit.ly/1F6WBVD
// take ownership
let v = vec![1, 2, 3];
see also http://bit.ly/1F6WBVD
// take ownership
let v = vec![1, 2, 3];
// moved ownership to v2
let v2 = v;
see also http://bit.ly/1F6WBVD
// take ownership
let v = vec![1, 2, 3];
// moved ownership to v2
let v2 = v;
println!("v[0] is {}", v[0]);
// error: use of moved value: `v`
// println!("v[0] is {}", v[0]);
// ^
see also http://bit.ly/1F6WBVD
fn take(v : Vec<i32>) {
// ownership of vector transferred
// to v in this scope
}
see also http://bit.ly/1F6WBVD
// take ownership
let v = vec![1, 2, 3];
// moved ownership
take(v);
see also http://bit.ly/1F6WBVD
// take ownership
let v = vec![1, 2, 3];
// moved ownership
take(v);
println!("v[0] is {}", v[0]);
// error: use of moved value: `v`
// println!("v[0] is {}", v[0]);
// ^
see also http://bit.ly/1F6WBVD
see also http://bit.ly/1F6WBVD
let me buy
your book
see also http://bit.ly/1F6WBVD
sure thing!
see also http://bit.ly/1F6WBVD
thanks
see also http://bit.ly/1F6WBVD
BURN!!!
>:D
see also http://bit.ly/1F6WBVD
but I
still need it..
:’(
see also http://bit.ly/1F6WBVD
borrowing
see also http://bit.ly/1F6WBVD
// note we're taking a reference,
// &Vec<i32>, instead of Vec<i32>
fn take(v : &Vec<i32>) {
// no need to deallocate the vector
// after we go out of scope here
}
see also http://bit.ly/1F6WBVD
// take ownership
let v = vec![1, 2, 3];
// notice we're passing a reference,
// &v, instead of v
take(&v); // borrow ownership
println!("v[0] is {}", v[0]);
// v[0] is 1
see also http://bit.ly/1F6WBVD
let me
borrow your
book
see also http://bit.ly/1F6WBVD
sure thing!
see also http://bit.ly/1F6WBVD
thanks
see also http://bit.ly/1F6WBVD
I’m done,
here you go
see also http://bit.ly/1F6WBVD
thanks
see also http://bit.ly/1F6WBVD
immutable by default
see also http://bit.ly/1F6WBVD
fn take(v : &Vec<i32>) {
v.push(5);
}
let v = vec![];
take(&v);
// cannot borrow immutable borrowed
// content `*v` as mutable
// v.push(5);
// ^
see also http://bit.ly/1F6WBVD
fn take(v : &mut Vec<i32>) {
v.push(5);
}
let mut v = vec![];
take(&mut v);
println!("v[0] is {}", v[0]);
// v[0] is 5
see also http://bit.ly/1F6WBVD
there are 2 rules to BORROWING
Rule 1.
the borrower’s scope must not
outlast the owner
see also http://bit.ly/1F6WBVD
Rule 2.
one of the following, but not both:
2.1 0 or more refs to a resource
2.2 exactly 1 mutable ref
see also http://bit.ly/1F6WBVD
data race
There is a ‘data race’ when two or more pointers
access the same memory location at the same
time, where at least one of them is writing, and
the operations are not synchronised.
see also http://bit.ly/1F6WBVD
data race
a. two or more pointers to the same resource
b. at least one is writing
c. operations are not synchronised
see also http://bit.ly/1F6WBVD
Data Race Conditions
a. two or more pointers to the same resource
b. at least one is writing
c. operations are not synchronised
Borrowing Rules
one of the following, but not both:
2.1 0 or more refs to a resource
2.2 exactly 1 mutable ref
see also http://bit.ly/1F6WBVD
Data Race Conditions
a. two or more pointers to the same resource
b. at least one is writing
c. operations are not synchronised
Borrowing Rules
one of the following, but not both:
2.1 0 or more refs to a resource
2.2 exactly 1 mutable ref
see also http://bit.ly/1F6WBVD
see also http://bit.ly/1F6WBVD
Dependent Types
Uniqueness Types
Bit Syntax
Borrowed Pointers
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Signals
Macros
Unit-of-Measure
Actor Model
seen generics?
aka parametric polymorphism
List<T>
List<T>
List<int> List<Cat>
List<string>
what if…
types that depend on
arbitrary values?
Vect n a
vector of n elements of type a
zipWith :
(a -> b -> c)
-> Vect n a
-> Vect n b
-> Vect n c
zipWith f [] [] = []
zipWith f (x :: xs) (y :: ys) =
f x y :: zipWith f xs ys
Type Driven Development
“Make illegal states unrepresentable”
- Yaron Minsky
Type Provider Pipes
Statically Resolved TP
Implicit Interface
Implementation
Borrowed Pointers Dependent Types
Uniqueness Types
Bit Syntax
Signals
Macros
Unit-of-Measure
Actor Model
10,000 hours to be
good at something
see also http://bit.ly/1KN7SLq
10,000 hours to be
good at something
see also http://bit.ly/1KN7SLq
10,000 hours to reach
top of an ultra-
competitive field
see also http://bit.ly/1KN7SLq
the first 20 hours -
how to learn anything
see also http://bit.ly/1KN7SLq
Practice Time
Howgoodyouare
see also http://bit.ly/1KN7SLq
1.Deconstruct the skill
see also http://bit.ly/1KN7SLq
1.Deconstruct the skill
2.Learn enough to self-correct
see also http://bit.ly/1KN7SLq
1.Deconstruct the skill
2.Learn enough to self-correct
3.Remove practice barriers
see also http://bit.ly/1KN7SLq
1.Deconstruct the skill
2.Learn enough to self-correct
3.Remove practice barriers
4.Practice at least 20 hrs
see also http://bit.ly/1KN7SLq
learn a new paradigm
not a new syntax
see also http://bit.ly/1IzXVSo
“Programming languages
have a devious influence:
they shape our thinking
habits.”
- Edsger W. Dijkstra
logic programming
stack-oriented
programming
array programming
“A language that doesn't
affect the way you think
about programming, is not
worth knowing.”
- Alan Perlis
see also http://bit.ly/1IzXVSo
see also http://bit.ly/1IzXVSo
“Learning is an act of creation
itself, because something
happens in you that wasn't
there before.”
- Alan Kay
@theburningmonk
theburningmonk.com
github.com/theburningmonk

More Related Content

Similar to Tour of language landscape (BuildStuff)

CMPSC 461 Programming Language ConceptsSpring 2018Pro.docx
CMPSC 461 Programming Language ConceptsSpring 2018Pro.docxCMPSC 461 Programming Language ConceptsSpring 2018Pro.docx
CMPSC 461 Programming Language ConceptsSpring 2018Pro.docxclarebernice
 
F# Eye for the C# Guy
F# Eye for the C# GuyF# Eye for the C# Guy
F# Eye for the C# Guygueste3f83d
 
Large Components in the Rearview Mirror
Large Components in the Rearview MirrorLarge Components in the Rearview Mirror
Large Components in the Rearview MirrorMichelle Brush
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiFlorent Batard
 
Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against YouC4Media
 
Evolve Your Code
Evolve Your CodeEvolve Your Code
Evolve Your CodeRookieOne
 
Beginning text analysis
Beginning text analysisBeginning text analysis
Beginning text analysisBarry DeCicco
 
Why you should document your code
Why you should document your codeWhy you should document your code
Why you should document your codeLennon Manchester
 
Respond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docx
Respond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docxRespond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docx
Respond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docxronak56
 
Respond to Discussion minimum 150 WordsThroughout my life I have.docx
Respond to Discussion minimum 150 WordsThroughout my life I have.docxRespond to Discussion minimum 150 WordsThroughout my life I have.docx
Respond to Discussion minimum 150 WordsThroughout my life I have.docxronak56
 
Types and Immutability: why you should care
Types and Immutability: why you should careTypes and Immutability: why you should care
Types and Immutability: why you should careJean Carlo Emer
 
Crash-course in Natural Language Processing
Crash-course in Natural Language ProcessingCrash-course in Natural Language Processing
Crash-course in Natural Language ProcessingVsevolod Dyomkin
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By DesignAll Things Open
 
Named entity recognition (ner) with nltk
Named entity recognition (ner) with nltkNamed entity recognition (ner) with nltk
Named entity recognition (ner) with nltkJanu Jahnavi
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
 
Platforms and the Semantic Web
Platforms and the Semantic WebPlatforms and the Semantic Web
Platforms and the Semantic WebDanny Ayers
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesomeAndrew Hull
 
Hasktut
HasktutHasktut
Hasktutkv33
 

Similar to Tour of language landscape (BuildStuff) (20)

CMPSC 461 Programming Language ConceptsSpring 2018Pro.docx
CMPSC 461 Programming Language ConceptsSpring 2018Pro.docxCMPSC 461 Programming Language ConceptsSpring 2018Pro.docx
CMPSC 461 Programming Language ConceptsSpring 2018Pro.docx
 
F# Eye for the C# Guy
F# Eye for the C# GuyF# Eye for the C# Guy
F# Eye for the C# Guy
 
Large Components in the Rearview Mirror
Large Components in the Rearview MirrorLarge Components in the Rearview Mirror
Large Components in the Rearview Mirror
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 
Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
 
Evolve Your Code
Evolve Your CodeEvolve Your Code
Evolve Your Code
 
Beginning text analysis
Beginning text analysisBeginning text analysis
Beginning text analysis
 
Why you should document your code
Why you should document your codeWhy you should document your code
Why you should document your code
 
Respond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docx
Respond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docxRespond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docx
Respond_HomeworkAstronomy.docxRespond to forum. 150 word mini.docx
 
Respond to Discussion minimum 150 WordsThroughout my life I have.docx
Respond to Discussion minimum 150 WordsThroughout my life I have.docxRespond to Discussion minimum 150 WordsThroughout my life I have.docx
Respond to Discussion minimum 150 WordsThroughout my life I have.docx
 
Types and Immutability: why you should care
Types and Immutability: why you should careTypes and Immutability: why you should care
Types and Immutability: why you should care
 
Crash-course in Natural Language Processing
Crash-course in Natural Language ProcessingCrash-course in Natural Language Processing
Crash-course in Natural Language Processing
 
Clojure: Simple By Design
Clojure: Simple By DesignClojure: Simple By Design
Clojure: Simple By Design
 
Named entity recognition (ner) with nltk
Named entity recognition (ner) with nltkNamed entity recognition (ner) with nltk
Named entity recognition (ner) with nltk
 
Seven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many ProgrammersSeven Ineffective Coding Habits of Many Programmers
Seven Ineffective Coding Habits of Many Programmers
 
C 2
C 2C 2
C 2
 
Platforms and the Semantic Web
Platforms and the Semantic WebPlatforms and the Semantic Web
Platforms and the Semantic Web
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
Hasktut
HasktutHasktut
Hasktut
 
UXD lesson 1 - Intro To UX
UXD lesson 1 - Intro To UXUXD lesson 1 - Intro To UX
UXD lesson 1 - Intro To UX
 

More from Yan Cui

How to win the game of trade-offs
How to win the game of trade-offsHow to win the game of trade-offs
How to win the game of trade-offsYan Cui
 
How to choose the right messaging service
How to choose the right messaging serviceHow to choose the right messaging service
How to choose the right messaging serviceYan Cui
 
How to choose the right messaging service for your workload
How to choose the right messaging service for your workloadHow to choose the right messaging service for your workload
How to choose the right messaging service for your workloadYan Cui
 
Patterns and practices for building resilient serverless applications.pdf
Patterns and practices for building resilient serverless applications.pdfPatterns and practices for building resilient serverless applications.pdf
Patterns and practices for building resilient serverless applications.pdfYan Cui
 
Lambda and DynamoDB best practices
Lambda and DynamoDB best practicesLambda and DynamoDB best practices
Lambda and DynamoDB best practicesYan Cui
 
Lessons from running AppSync in prod
Lessons from running AppSync in prodLessons from running AppSync in prod
Lessons from running AppSync in prodYan Cui
 
Serverless observability - a hero's perspective
Serverless observability - a hero's perspectiveServerless observability - a hero's perspective
Serverless observability - a hero's perspectiveYan Cui
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functionsYan Cui
 
How serverless changes the cost paradigm
How serverless changes the cost paradigmHow serverless changes the cost paradigm
How serverless changes the cost paradigmYan Cui
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncYan Cui
 
Build social network in 4 weeks
Build social network in 4 weeksBuild social network in 4 weeks
Build social network in 4 weeksYan Cui
 
Patterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsPatterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsYan Cui
 
How to bring chaos engineering to serverless
How to bring chaos engineering to serverlessHow to bring chaos engineering to serverless
How to bring chaos engineering to serverlessYan Cui
 
Migrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsMigrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsYan Cui
 
Building a social network in under 4 weeks with Serverless and GraphQL
Building a social network in under 4 weeks with Serverless and GraphQLBuilding a social network in under 4 weeks with Serverless and GraphQL
Building a social network in under 4 weeks with Serverless and GraphQLYan Cui
 
FinDev as a business advantage in the post covid19 economy
FinDev as a business advantage in the post covid19 economyFinDev as a business advantage in the post covid19 economy
FinDev as a business advantage in the post covid19 economyYan Cui
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold startsYan Cui
 
What can you do with lambda in 2020
What can you do with lambda in 2020What can you do with lambda in 2020
What can you do with lambda in 2020Yan Cui
 
A chaos experiment a day, keeping the outage away
A chaos experiment a day, keeping the outage awayA chaos experiment a day, keeping the outage away
A chaos experiment a day, keeping the outage awayYan Cui
 
How to debug slow lambda response times
How to debug slow lambda response timesHow to debug slow lambda response times
How to debug slow lambda response timesYan Cui
 

More from Yan Cui (20)

How to win the game of trade-offs
How to win the game of trade-offsHow to win the game of trade-offs
How to win the game of trade-offs
 
How to choose the right messaging service
How to choose the right messaging serviceHow to choose the right messaging service
How to choose the right messaging service
 
How to choose the right messaging service for your workload
How to choose the right messaging service for your workloadHow to choose the right messaging service for your workload
How to choose the right messaging service for your workload
 
Patterns and practices for building resilient serverless applications.pdf
Patterns and practices for building resilient serverless applications.pdfPatterns and practices for building resilient serverless applications.pdf
Patterns and practices for building resilient serverless applications.pdf
 
Lambda and DynamoDB best practices
Lambda and DynamoDB best practicesLambda and DynamoDB best practices
Lambda and DynamoDB best practices
 
Lessons from running AppSync in prod
Lessons from running AppSync in prodLessons from running AppSync in prod
Lessons from running AppSync in prod
 
Serverless observability - a hero's perspective
Serverless observability - a hero's perspectiveServerless observability - a hero's perspective
Serverless observability - a hero's perspective
 
How to ship customer value faster with step functions
How to ship customer value faster with step functionsHow to ship customer value faster with step functions
How to ship customer value faster with step functions
 
How serverless changes the cost paradigm
How serverless changes the cost paradigmHow serverless changes the cost paradigm
How serverless changes the cost paradigm
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSync
 
Build social network in 4 weeks
Build social network in 4 weeksBuild social network in 4 weeks
Build social network in 4 weeks
 
Patterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applicationsPatterns and practices for building resilient serverless applications
Patterns and practices for building resilient serverless applications
 
How to bring chaos engineering to serverless
How to bring chaos engineering to serverlessHow to bring chaos engineering to serverless
How to bring chaos engineering to serverless
 
Migrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 stepsMigrating existing monolith to serverless in 8 steps
Migrating existing monolith to serverless in 8 steps
 
Building a social network in under 4 weeks with Serverless and GraphQL
Building a social network in under 4 weeks with Serverless and GraphQLBuilding a social network in under 4 weeks with Serverless and GraphQL
Building a social network in under 4 weeks with Serverless and GraphQL
 
FinDev as a business advantage in the post covid19 economy
FinDev as a business advantage in the post covid19 economyFinDev as a business advantage in the post covid19 economy
FinDev as a business advantage in the post covid19 economy
 
How to improve lambda cold starts
How to improve lambda cold startsHow to improve lambda cold starts
How to improve lambda cold starts
 
What can you do with lambda in 2020
What can you do with lambda in 2020What can you do with lambda in 2020
What can you do with lambda in 2020
 
A chaos experiment a day, keeping the outage away
A chaos experiment a day, keeping the outage awayA chaos experiment a day, keeping the outage away
A chaos experiment a day, keeping the outage away
 
How to debug slow lambda response times
How to debug slow lambda response timesHow to debug slow lambda response times
How to debug slow lambda response times
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Tour of language landscape (BuildStuff)

  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10. ZOOZU VAPA BOROU DUMBU dark shades of blue, red, green & purple white & some shades of yellow some shades of green & blue other shades of green, red & brown
  • 11.
  • 12.
  • 13. “The limits of my language means the limits of my world.” - Ludwig Wittgenstein
  • 15. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 16.
  • 17. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 22. 1. define DTO types 2. I/O 3. marshal data into DTO 4. do useful work
  • 23. 1. define DTO types 2. I/O 3. marshal data into DTO 4. do useful work
  • 27.
  • 28.
  • 32. R FunScript Azure Amazon S3 CSVSQLite SQL Server WSDL WorldBank Regex ODATA IKVM Facebook Apiary XAMLFreebase Hadoop Oracle Minesweeper Don Syme Powershell JSON Fizzbuzz Mixin RSS Matlab Dates NorthPole XML Python
  • 33. Don Syme can taste lies.
  • 34. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 35. “…a clean design is one that supports visual thinking so people can meet their informational needs with a minimum of conscious effort.” - Daniel Higginbotham (www.visualmess.com)
  • 36. Whilst talking with an ex-colleague, a question came up on how to implement the Stable Marriage problem using a message passing approach. Naturally, I wanted to answer that question with Erlang! Let’s first dissect the problem and decide what processes we need and how they need to interact with one another. The stable marriage problem is commonly stated as: Given n men and n women, where each person has ranked all members of the opposite sex with a unique number between 1 and n in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than their current partners. If there are no such people, all the marriages are “stable”. (It is assumed that the participants are binary gendered and that marriages are not same-sex). From the problem description, we can see that we need: * a module for man * a module for woman * a module for orchestrating the experiment In terms of interaction between the different modules, I imagined something along the lines of… how we read ENGLISH see also http://bit.ly/1KN8cd0
  • 37. Whilst talking with an ex-colleague, a question came up on how to implement the Stable Marriage problem using a message passing approach. Naturally, I wanted to answer that question with Erlang! Let’s first dissect the problem and decide what processes we need and how they need to interact with one another. The stable marriage problem is commonly stated as: Given n men and n women, where each person has ranked all members of the opposite sex with a unique number between 1 and n in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than their current partners. If there are no such people, all the marriages are “stable”. (It is assumed that the participants are binary gendered and that marriages are not same-sex). From the problem description, we can see that we need: * a module for man * a module for woman * a module for orchestrating the experiment In terms of interaction between the different modules, I imagined something along the lines of… 2.top-to-bottom 1.left-to-right how we read ENGLISH see also http://bit.ly/1KN8cd0
  • 38. how we read CODE public void DoSomething(int x, int y) { Foo(y, Bar(x, Zoo(Monkey()))); } see also http://bit.ly/1KN8cd0
  • 39. how we read CODE public void DoSomething(int x, int y) { Foo(y, Bar(x, Zoo(Monkey()))); } 2.bottom-to-top 1.right-to-left see also http://bit.ly/1KN8cd0
  • 40. Whilst talking with an ex-colleague, a question came up on how to implement the Stable Marriage problem using a message passing approach. Naturally, I wanted to answer that question with Erlang! Let’s first dissect the problem and decide what processes we need and how they need to interact with one another. The stable marriage problem is commonly stated as: Given n men and n women, where each person has ranked all members of the opposite sex with a unique number between 1 and n in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than their current partners. If there are no such people, all the marriages are “stable”. (It is assumed that the participants are binary gendered and that marriages are not same-sex). From the problem description, we can see that we need: * a module for man * a module for woman * a module for orchestrating the experiment In terms of interaction between the different modules, I imagined something along the lines of… 2.top-to-bottom 1.left-to-right how we read ENGLISH public void DoSomething(int x, int y) { Foo(y, Bar(x, Zoo(Monkey()))); } 2.top-to-bottom 1.right-to-left how we read CODE see also http://bit.ly/1KN8cd0
  • 41. “…a clean design is one that supports visual thinking so people can meet their informational needs with a minimum of conscious effort.”
  • 42. |>
  • 43. how we read CODE let drawCircle x y radius = radius |> circle |> filled (rgb 150 170 150) |> alpha 0.5 |> move (x, y) see also http://bit.ly/1KN8cd0
  • 44. how we read CODE let drawCircle x y radius = radius |> circle |> filled (rgb 150 170 150) |> alpha 0.5 |> move (x, y) 2.top-to-bottom 1.left-to-right see also http://bit.ly/1KN8cd0
  • 45. let drawCircle x y radius = circle radius |> filled (rgb 150 170 150) |> alpha 0.5 |> move (x, y) see also http://bit.ly/1KN8cd0
  • 46. let drawCircle x y radius = circle radius |> filled (rgb 150 170 150) |> alpha 0.5 |> move (x, y) see also http://bit.ly/1KN8cd0
  • 47. let drawCircle x y radius = circle radius |> filled (rgb 150 170 150) |> alpha 0.5 |> move (x, y) see also http://bit.ly/1KN8cd0
  • 48. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 49. NASA orbiter crashed because one engineer accidentally used miles instead of kilometres
  • 50. you’re never too smart to make mistakes
  • 53. 10<Meter> / 2<Second> = 5<Meter/Second> 10<Meter> * 2<Second> = 20<Meter Second> 10<Meter> + 10<Meter> = 20<Meter> 10<Meter> * 10 = 100<Meter> 10<Meter> * 10<Meter> = 100<Meter2> 10<Meter> + 2<Second> // error 10<Meter> + 2 // error
  • 54. 10<Meter> / 2<Second> = 5<Meter/Second> 10<Meter> * 2<Second> = 20<Meter Second> 10<Meter> + 10<Meter> = 20<Meter> 10<Meter> * 10 = 100<Meter> 10<Meter> * 10<Meter> = 100<Meter2> 10<Meter> + 2<Second> // error 10<Meter> + 2 // error
  • 55.
  • 56. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 57. Duck Typing If it looks like a duck and quacks like a duck, it's a duck
  • 62. type Duck interface { Quack() } see also http://bit.ly/1ER5zVs
  • 63. func sayQuack(duck Duck) { duck.Quack() } see also http://bit.ly/1ER5zVs
  • 64. type Donald struct { } func (d Donald) Quack() { fmt.Println(“quack quack!”) } see also http://bit.ly/1ER5zVs
  • 65. type Bird struct { } func (b Bird) Quack() { fmt.Println(“tweet tweet!”) } see also http://bit.ly/1ER5zVs
  • 66. func main() { donald := Donald{} sayQuack(donald) bird := Bird{} sayQuack(bird) } see also http://bit.ly/1ER5zVs
  • 67. quack quack! func main() { donald := Donald{} sayQuack(donald) bird := Bird{} sayQuack(bird) }
  • 68. tweet tweet! func main() { donald := Donald{} sayQuack(donald) bird := Bird{} sayQuack(bird) }
  • 69. type Dog struct { } func (d Dog) Bark() { fmt.Println(“woof woof!”) } see also http://bit.ly/1ER5zVs
  • 70. func main() { dog := Dog{} sayQuack(dog) } main.go:40: cannot use dog (type Dog) as type Duck in argument to sayQuack: Dog does not implement Duck (missing Quack method) see also http://bit.ly/1ER5zVs
  • 71. Convenience Safety see also http://bit.ly/1ER5zVs
  • 72. patterns are observed after the fact see also http://bit.ly/1ER5zVs
  • 73. system building is also a process of learning and discovery see also http://bit.ly/1ER5zVs
  • 75. encourages precise interface definitions see also http://bit.ly/1ER5zVs
  • 76.
  • 77. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 78. Homoiconicity …homoiconicity is a property of some programming languages in which the program structure is similar to its syntax, and therefore the program’s internal representation can be inferred by reading the text’s layout…
  • 79. code is data data is code
  • 80. (let [x 1] (inc x)) see also http://bit.ly/1PpIrjS
  • 81. (let [x 1] (inc x)) => 2 see also http://bit.ly/1PpIrjS
  • 82. list (1 2 3) vector [1 2 3] see also http://bit.ly/1PpIrjS
  • 83. (let [x 1] (inc x)) list see also http://bit.ly/1PpIrjS
  • 84. (let [x 1] (inc x)) symbol see also http://bit.ly/1PpIrjS
  • 85. (let [x 1] (inc x)) vector see also http://bit.ly/1PpIrjS
  • 86. (let [x 1] (inc x)) list see also http://bit.ly/1PpIrjS
  • 87. form : code as data structure see also http://bit.ly/1PpIrjS
  • 88. code data quote eval see also http://bit.ly/1PpIrjS
  • 89. quote (+ 1 2) => 3 see also http://bit.ly/1PpIrjS
  • 90. quote (+ 1 2) => 3 (quote (+ 1 2)) => (+ 1 2) see also http://bit.ly/1PpIrjS
  • 91. quote (+ 1 2) => 3 (quote (+ 1 2)) => (+ 1 2) ‘(+ 1 2) => (+ 1 2) see also http://bit.ly/1PpIrjS
  • 92. eval ‘(+ 1 2) => (+ 1 2) (eval ‘(+ 1 2)) => 3 see also http://bit.ly/1PpIrjS
  • 94. (defmacro assert-equals [actual expected] ‘(let [actual-val# ~actual] (when-not (= actual-val# ~expected) (throw (AssertionError. (str “FAIL in “ ‘~actual “n expected: “ ‘~expected “n actual: “ actual-val#)))))) see also http://bit.ly/1PpIrjS
  • 95. (assert-equals (inc 1) 2) ; => nil (assert-equals (inc 1) (+ 0 1)) ; => AssertionError FAIL in (inc 1) ; expected: (+ 0 1) ; actual: 2 see also http://bit.ly/1PpIrjS
  • 96. (assert-equals (inc 1) 2) ; => nil (assert-equals (inc 1) (+ 0 1)) ; => AssertionError FAIL in (inc 1) ; expected: (+ 0 1) ; actual: 2 see also http://bit.ly/1PpIrjS
  • 97. (assert-equals (inc 1) 2) ; => nil (assert-equals (inc 1) (+ 0 1)) ; => AssertionError FAIL in (inc 1) ; expected: (+ 0 1) ; actual: 2 huh?? where? what? how? see also http://bit.ly/1PpIrjS
  • 98. (defmacro assert-equals [actual expected] ‘(let [actual-val# ~actual] (when-not (= actual-val# ~expected) (throw (AssertionError. (str “FAIL in “ ‘~actual “n expected: “ ‘~expected “n actual: “ actual-val#)))))) (assert-equals (inc 1) (+ 0 1)) see also http://bit.ly/1PpIrjS
  • 99. (defmacro assert-equals [actual expected] ‘(let [actual-val# ~actual] (when-not (= actual-val# ~expected) (throw (AssertionError. (str “FAIL in “ ‘~actual “n expected: “ ‘~expected “n actual: “ actual-val#)))))) (assert-equals (inc 1) (+ 0 1)) see also http://bit.ly/1PpIrjS
  • 100. (defmacro assert-equals [actual expected] ‘(let [actual-val# ~actual] (when-not (= actual-val# ~expected) (throw (AssertionError. (str “FAIL in “ ‘~actual “n expected: “ ‘~expected “n actual: “ actual-val#)))))) (assert-equals (inc 1) (+ 0 1)) see also http://bit.ly/1PpIrjS
  • 101. (defmacro assert-equals [actual expected] ‘(let [actual-val# ~actual] (when-not (= actual-val# ~expected) (throw (AssertionError. (str “FAIL in “ ‘~actual “n expected: “ ‘~expected “n actual: “ actual-val#)))))) see also http://bit.ly/1PpIrjS
  • 102. (defmacro assert-equals [actual expected] ‘(let [actual-val# ~actual] (when-not (= actual-val# ~expected) (throw (AssertionError. (str “FAIL in “ ‘~actual “n expected: “ ‘~expected “n actual: “ actual-val#)))))) ‘( see also http://bit.ly/1PpIrjS
  • 103. expanded at compile time see also http://bit.ly/1PpIrjS
  • 104. (macroexpand '(assert-equals (inc 1) (+ 0 1))) ; => ; (let* [actual-value__16087__auto__ (inc 1)] ; (clojure.core/when-not ; (clojure.core/= actual-value__16087__auto__ (+ 0 1)) ; (throw (java.lang.AssertionError. ; (clojure.core/str ; "FAIL in " (quote (inc 1)) ; "nexpected: " (quote (+ 0 1)) ; "n actual: " actual-value__16087__auto__))))) see also http://bit.ly/1PpIrjS
  • 105.
  • 106. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 110. memory safety without GC see also http://bit.ly/1F6WBVD
  • 111. ZERO runtime cost see also http://bit.ly/1F6WBVD
  • 112. safety + speed see also http://bit.ly/1F6WBVD
  • 113. fn foo() { // v has ownership of the vector let v = vec![1, 2, 3]; // mutable binding let mut v2 = vec![]; } // vector is deallocated at the // end of scope, // this happens deterministically see also http://bit.ly/1F6WBVD
  • 114. immutable by default see also http://bit.ly/1F6WBVD
  • 115. // take ownership let v = vec![1, 2, 3]; see also http://bit.ly/1F6WBVD
  • 116. // take ownership let v = vec![1, 2, 3]; // moved ownership to v2 let v2 = v; see also http://bit.ly/1F6WBVD
  • 117. // take ownership let v = vec![1, 2, 3]; // moved ownership to v2 let v2 = v; println!("v[0] is {}", v[0]); // error: use of moved value: `v` // println!("v[0] is {}", v[0]); // ^ see also http://bit.ly/1F6WBVD
  • 118. fn take(v : Vec<i32>) { // ownership of vector transferred // to v in this scope } see also http://bit.ly/1F6WBVD
  • 119. // take ownership let v = vec![1, 2, 3]; // moved ownership take(v); see also http://bit.ly/1F6WBVD
  • 120. // take ownership let v = vec![1, 2, 3]; // moved ownership take(v); println!("v[0] is {}", v[0]); // error: use of moved value: `v` // println!("v[0] is {}", v[0]); // ^ see also http://bit.ly/1F6WBVD
  • 122. let me buy your book see also http://bit.ly/1F6WBVD
  • 123. sure thing! see also http://bit.ly/1F6WBVD
  • 126. but I still need it.. :’( see also http://bit.ly/1F6WBVD
  • 128. // note we're taking a reference, // &Vec<i32>, instead of Vec<i32> fn take(v : &Vec<i32>) { // no need to deallocate the vector // after we go out of scope here } see also http://bit.ly/1F6WBVD
  • 129. // take ownership let v = vec![1, 2, 3]; // notice we're passing a reference, // &v, instead of v take(&v); // borrow ownership println!("v[0] is {}", v[0]); // v[0] is 1 see also http://bit.ly/1F6WBVD
  • 130. let me borrow your book see also http://bit.ly/1F6WBVD
  • 131. sure thing! see also http://bit.ly/1F6WBVD
  • 133. I’m done, here you go see also http://bit.ly/1F6WBVD
  • 135. immutable by default see also http://bit.ly/1F6WBVD
  • 136. fn take(v : &Vec<i32>) { v.push(5); } let v = vec![]; take(&v); // cannot borrow immutable borrowed // content `*v` as mutable // v.push(5); // ^ see also http://bit.ly/1F6WBVD
  • 137. fn take(v : &mut Vec<i32>) { v.push(5); } let mut v = vec![]; take(&mut v); println!("v[0] is {}", v[0]); // v[0] is 5 see also http://bit.ly/1F6WBVD
  • 138. there are 2 rules to BORROWING
  • 139. Rule 1. the borrower’s scope must not outlast the owner see also http://bit.ly/1F6WBVD
  • 140. Rule 2. one of the following, but not both: 2.1 0 or more refs to a resource 2.2 exactly 1 mutable ref see also http://bit.ly/1F6WBVD
  • 141. data race There is a ‘data race’ when two or more pointers access the same memory location at the same time, where at least one of them is writing, and the operations are not synchronised. see also http://bit.ly/1F6WBVD
  • 142. data race a. two or more pointers to the same resource b. at least one is writing c. operations are not synchronised see also http://bit.ly/1F6WBVD
  • 143. Data Race Conditions a. two or more pointers to the same resource b. at least one is writing c. operations are not synchronised Borrowing Rules one of the following, but not both: 2.1 0 or more refs to a resource 2.2 exactly 1 mutable ref see also http://bit.ly/1F6WBVD
  • 144. Data Race Conditions a. two or more pointers to the same resource b. at least one is writing c. operations are not synchronised Borrowing Rules one of the following, but not both: 2.1 0 or more refs to a resource 2.2 exactly 1 mutable ref see also http://bit.ly/1F6WBVD
  • 146.
  • 147. Dependent Types Uniqueness Types Bit Syntax Borrowed Pointers Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Signals Macros Unit-of-Measure Actor Model
  • 152. types that depend on arbitrary values?
  • 153. Vect n a vector of n elements of type a
  • 154. zipWith : (a -> b -> c) -> Vect n a -> Vect n b -> Vect n c
  • 155. zipWith f [] [] = [] zipWith f (x :: xs) (y :: ys) = f x y :: zipWith f xs ys
  • 157. “Make illegal states unrepresentable” - Yaron Minsky
  • 158. Type Provider Pipes Statically Resolved TP Implicit Interface Implementation Borrowed Pointers Dependent Types Uniqueness Types Bit Syntax Signals Macros Unit-of-Measure Actor Model
  • 159. 10,000 hours to be good at something see also http://bit.ly/1KN7SLq
  • 160. 10,000 hours to be good at something see also http://bit.ly/1KN7SLq
  • 161. 10,000 hours to reach top of an ultra- competitive field see also http://bit.ly/1KN7SLq
  • 162.
  • 163. the first 20 hours - how to learn anything see also http://bit.ly/1KN7SLq
  • 164. Practice Time Howgoodyouare see also http://bit.ly/1KN7SLq
  • 165. 1.Deconstruct the skill see also http://bit.ly/1KN7SLq
  • 166. 1.Deconstruct the skill 2.Learn enough to self-correct see also http://bit.ly/1KN7SLq
  • 167. 1.Deconstruct the skill 2.Learn enough to self-correct 3.Remove practice barriers see also http://bit.ly/1KN7SLq
  • 168. 1.Deconstruct the skill 2.Learn enough to self-correct 3.Remove practice barriers 4.Practice at least 20 hrs see also http://bit.ly/1KN7SLq
  • 169.
  • 170. learn a new paradigm not a new syntax see also http://bit.ly/1IzXVSo
  • 171. “Programming languages have a devious influence: they shape our thinking habits.” - Edsger W. Dijkstra
  • 175. “A language that doesn't affect the way you think about programming, is not worth knowing.” - Alan Perlis
  • 178. “Learning is an act of creation itself, because something happens in you that wasn't there before.” - Alan Kay