SlideShare uma empresa Scribd logo
1 de 101
Baixar para ler offline
Fear and Loathing
with APL
Hi, my name is Yan Cui
aka @theburningmonk
What is APL?
created at IBM in 1957, by Ken Iverson
designed to simplify math notations
“A Programming Language”
What is APL?
famed for use of special symbols
array programming
influenced Mathematica, Matlab, etc.
hey, I’m
learning
APL
what the
hell is an
APL?
have you
lost your
mind?
Conway’s Game of Life
https://www.youtube.com/watch?v=a9xAKttWgP4
“Beauty is in the Eye of the Beholder”
beauty doesn't exist on its own but is created by observers
“…We followed up with two studies on the accuracy
rates of novices using a total of six programming
languages: Ruby, Java, Perl, Python, Randomo, and
Quorum. Randomo was designed by randomly
choosing some keywords from the ASCII table (a
metaphorical placebo). To our surprise, we found that
languages using a more traditional C-style syntax
(both Perl and Java) did not afford accuracy rates
significantly higher than a language with randomly
generated keywords, …”
“An Empirical Investigation into Programming Language Syntax”
- Andreas Stefik and Susanna Siebert
“…We followed up with two studies on the accuracy
rates of novices using a total of six programming
languages: Ruby, Java, Perl, Python, Randomo, and
Quorum. Randomo was designed by randomly
choosing some keywords from the ASCII table (a
metaphorical placebo). To our surprise, we found that
languages using a more traditional C-style syntax
(both Perl and Java) did not afford accuracy rates
significantly higher than a language with randomly
generated keywords, …”
“An Empirical Investigation into Programming Language Syntax”
- Andreas Stefik and Susanna Siebert
http://bit.ly/2eM3Qvr
“A language that doesn't
affect the way you think
about programming, is not
worth knowing.”
- Alan Perlis
“in an era of mainstream programming
languages, APL is a rare opportunity to
truly challenge the way you think about
programming”
- me
Let’s learn some APL
http://tryapl.org/
2 + 2
4
4 - 1
3
+ and - works the way you expect
2 * 3
8
4 * 4
256
but * means power
2 / 3
3 3
and / means replicate
it means replicate the scalar value 3, 2 times
and returns an array of 2 elements
2 × 2
4
4 ÷ 2
2
multiplication (×) and division (÷)
just like in Maths!
x ← 42
y ← 1 2 3 4
assignment (←)
variable names are case sensitive
variables are mutable
x ← 42
x ← 1 2 3 4
x
1 2 3 4
assign multiple values at once
(kinda like pattern matching)
x y z ← 1 2 3
x
1
y
2
but the patterns must match
x y ← 1 2 3
LENGTH ERROR
x y ← 1 2 3
1 2 3 - 3 2 1
¯2 0 2
1 2 3 × 3 2 1
3 4 3
arithmetic operations work on arrays too
1 2 3 + 1
2 3 4
2 × 1 2 3
2 4 6
if one side is scalar then the other side
can be any shape
4 ⌊ 2
2
4 ⌈ 2
4
min (⌊) and max (⌈)
1 2 3 4 5 ⌈ 4
4 4 4 4 5
1 2 3 ⌈ 3 2 1
3 2 3
min (⌊) and max (⌈)
same rules apply for arrays
dyadic
2 ⌈ 4
1 2 ⌈ 3 1
monadic
⌈ 2
⌈ 1 3
⌊ 3 4.1 4.5 5.6
3 4 4 5
monadically, ⌊ means floor
⌈ 3 4.1 4.5 5.6
3 5 5 6
and ⌈ means ceiling
3 2 ⍴ 1 2 3 4 5 6
1 2
3 4
5 6
dyadically, ⍴ reshapes right hand side
rows
columns
⍴ 1 2 3
3
⍴ (3 2 ⍴ 1 2 3 4 5 6)
3 2
monadically, ⍴ returns shape of argument
3 2 ⍴ 1 2 3
1 2
3 1
2 3
⍴ recycles elements to fill space
2 2 ⍴ 1 2 3 4 5 6
1 2
3 4
and ignores additional elements
3 3 ⍴ 1 0 0 0
1 0 0
0 1 0
0 0 1
here’s a neat trick to get diagonals :-P
⍴ 2 2 ⍴ 0 1 0
2 2
⍴ (2 2 ⍴ 0 1 0)
2 2
oh, and APL is read from RIGHT-TO-LEFT
⍴ 2 2 ⍴ 0 1 0
2 2
⍴ (2 2 ⍴ 0 1 0)
2 2
oh, and APL is read from RIGHT-TO-LEFT
+/ 1 2 3
6
btw, / also means reduce
ie, reduce over the array [1, 2, 3] with the plus function
×/ 1 2 3 4 5
120
btw, / also means reduce
and here’s factorials!
Defined Functions
Avg ← { (+/ ⍵) ÷ ⍴⍵ }
anatomy of a defined function
function
name
assignment function
body
Avg ← { (+/ ⍵) ÷ ⍴⍵ }
Avg 1 2 3
anatomy of a defined function
omega ⍵ represents the right argument
Diff ← { (+/ ⍺) - (+/ ⍵) }
3 4 5 Diff 1 2 3
anatomy of a defined function
alpha ⍺ represents the left argument
Plus ← { ⍺ + ⍵ }
Plus/ 1 2 3
6
defined functions can be used with / too
Indexing an Array
Xs ← 1 2 3
Xs[2]
2
APL is one-indexed!
Xs[1 2 1]
1 2 1
Xs[2 2 ⍴ 1 2]
1 2
1 2
indices can be array too
Xs[3 2] ← 6 4
Xs
1 4 6
updating an array
⍳9
1 2 3 4 5 6 7 8 9
index generator
Booleans
1 < 2
1
1 2 3 < 3 2 1
1 0 0
1 is true, 0 is false
yup, works with arrays too ;-)
~1
0
~1 0 1
0 1 0
monadically, ~ means negate
(1 2 3 < 3 2 1) ∧ (1 1 1)
1 0 0
(1 2 3 < 3 2 1) ∨ (1 1 1)
1 1 1
logical AND ∧ and logical OR ∨
(⍳10) > 7
0 0 0 0 0 0 0 1 1 1
+/ (⍳10) > 7
3
count no. of positives
(⍳10) > 7
0 0 0 0 0 0 0 1 1 1
⍳10 > 7
?
are these two expression equivalent?
(⍳10) > 7
0 0 0 0 0 0 0 1 1 1
⍳10 > 7
1
are these two expression equivalent?
nope! remember, APL reads from RIGHT-TO-LEFT!
(⍳10) > 7
0 0 0 0 0 0 0 1 1 1
7 < ⍳10
0 0 0 0 0 0 0 1 1 1
are these two expression equivalent?
Compression
(aka filtering)
1 0 1 / 3 2 1
3 1
1 0 1 / 'iou'
i u
booleans can be used to as a mask
Values ← 1 3 5 7 9
Values > 4
0 0 1 1 1
(Values > 4) / Values
5 7 9
a LINQ-style Where can be written as
Values > 4
0 0 1 1 1
⍳⍴Values
1 2 3 4 5
(Values > 4) / (⍳⍴Values)
3 4 5
and to get the indices instead
1 2 3 ~ 3 4 3 5
1 2
‘ab’ ‘cd’ ‘ef’ ~ ‘cd’ ‘ef’
ab
dyadically, ~ means without
1 1 3 5 3 7 ∊ 1 2 3
1 1 1 0 1 0
'hello world' ∊ 'aeiou'
0 1 0 0 1 0 0 1 0 0 0
dyadically, ∊ checks for membership
Phrase ← ‘hello world’
(Phrase ∊ 'aeiou') / Phrase
eoo
which vowels appeared in a phrase?
2 2 ⍴ 1 2
1 2
1 2
∊ 2 2 ⍴ 1 2
1 2 1 2
monadically, ∊ flattens a matrix
Take & Drop
2 ↑ 1 2 3 4
1 2
2 2 ↑ (3 3 ⍴ ⍳9)
1 2
4 5
↑ to take items from an array
!?
3 3 ⍴ ⍳9
1 2 3
4 5 6
7 8 9
2 2 ↑ 3 3 ⍴ ⍳9
1 2 3
4 5 6
7 8 9
take a 2 (rows) by 2 (cols) matrix
2 ↓ 1 2 3 4
3 4
2 2 ↓ (3 3 ⍴ ⍳9)
9
↓ to drop items from an array
!?
3 3 ⍴ ⍳9
1 2 3
4 5 6
7 8 9
2 2 ↓ 3 3 ⍴ ⍳9
1 2 3
4 5 6
7 8 9
drop first 2 rows and 2 cols
¯2 ↑ 1 2 3 4
3 4
¯2 ↓ 1 2 3 4
1 2
use negative count to take/drop from
end of array
¯2 2 ↑ (3 3 ⍴ ⍳9)
?
¯2 2 ↓ (3 3 ⍴ ⍳9)
?
what about these?
http://tryapl.org/ try it out yourself
Mirrors &
Transportations
3 3 ⍴ ⍳9
1 2 3
4 5 6
7 8 9
given a matrix
3 3 ⍴ ⍳9
3 2 1
6 5 4
9 8 7
mirrors the matrix horizontally
3 3 ⍴ ⍳9
7 8 9
4 5 6
1 2 3
mirrors the matrix vertically
⍉ 3 3 ⍴ ⍳9
1 4 7
2 5 8
3 6 9
transposes the matrix⍉
Outer Products
cartesian product
1 2 3 .+ 4 5 6
5 6 7
6 7 8
7 8 9
. creates a cartesian product
1 2 3 .× 4 5 6
4 5 6
8 10 12
12 15 18
. creates a cartesian product
(⍳3) .= (⍳3)
1 0 0
0 1 0
0 0 1
. creates a cartesian product
(⍳3) .< (⍳3)
0 1 1
0 0 1
0 0 0
. creates a cartesian product
(⍳3) .⌈ (⍳3)
1 2 3
2 2 3
3 3 3
. creates a cartesian product
(⍳3) .+ (⍳3)
2 3 4
3 4 5
4 5 6
. creates a cartesian product
what about this?
http://tryapl.org/ try it out yourself
∊ (⍳3) .× (⍳5)
?
Demo Time…
Conclusions
should I learn APL?
absolutely! it’s the shock to the
system your brain needs
is it gonna help my career?
does it matter?
@theburningmonk
theburningmonk.com
github.com/theburningmonk

Mais conteúdo relacionado

Mais procurados

Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Philip Schwarz
 
Functional programming with haskell
Functional programming with haskellFunctional programming with haskell
Functional programming with haskellfaradjpour
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...Philip Schwarz
 
Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?Netguru
 
Introduction to Functional Languages
Introduction to Functional LanguagesIntroduction to Functional Languages
Introduction to Functional Languagessuthi
 
Sierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and Scala
Sierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and ScalaSierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and Scala
Sierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and ScalaPhilip Schwarz
 
The Functional Programming Triad of fold, scan and iterate
The Functional Programming Triad of fold, scan and iterateThe Functional Programming Triad of fold, scan and iterate
The Functional Programming Triad of fold, scan and iteratePhilip Schwarz
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...Philip Schwarz
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4Philip Schwarz
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...Philip Schwarz
 
Basic Sorting algorithms csharp
Basic Sorting algorithms csharpBasic Sorting algorithms csharp
Basic Sorting algorithms csharpMicheal Ogundero
 
Reasoning about laziness
Reasoning about lazinessReasoning about laziness
Reasoning about lazinessJohan Tibell
 
Scala 3 enum for a terser Option Monad Algebraic Data Type
Scala 3 enum for a terser Option Monad Algebraic Data TypeScala 3 enum for a terser Option Monad Algebraic Data Type
Scala 3 enum for a terser Option Monad Algebraic Data TypePhilip Schwarz
 
Open addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashingOpen addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashingSangeethaSasi1
 

Mais procurados (20)

Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - with ...
 
Functional programming with haskell
Functional programming with haskellFunctional programming with haskell
Functional programming with haskell
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
 
Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?
 
Introduction to Functional Languages
Introduction to Functional LanguagesIntroduction to Functional Languages
Introduction to Functional Languages
 
Sierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and Scala
Sierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and ScalaSierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and Scala
Sierpinski Triangle - Polyglot FP for Fun and Profit - Haskell and Scala
 
The Functional Programming Triad of fold, scan and iterate
The Functional Programming Triad of fold, scan and iterateThe Functional Programming Triad of fold, scan and iterate
The Functional Programming Triad of fold, scan and iterate
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part ...
 
Stack queue
Stack queueStack queue
Stack queue
 
Csharp_List
Csharp_ListCsharp_List
Csharp_List
 
Haskell
HaskellHaskell
Haskell
 
LEC3-DS ALGO(updated).pdf
LEC3-DS  ALGO(updated).pdfLEC3-DS  ALGO(updated).pdf
LEC3-DS ALGO(updated).pdf
 
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4
Folding Unfolded - Polyglot FP for Fun and Profit - Haskell and Scala - Part 4
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
 
Basic Sorting algorithms csharp
Basic Sorting algorithms csharpBasic Sorting algorithms csharp
Basic Sorting algorithms csharp
 
U3.stack queue
U3.stack queueU3.stack queue
U3.stack queue
 
Reasoning about laziness
Reasoning about lazinessReasoning about laziness
Reasoning about laziness
 
Monad Fact #4
Monad Fact #4Monad Fact #4
Monad Fact #4
 
Scala 3 enum for a terser Option Monad Algebraic Data Type
Scala 3 enum for a terser Option Monad Algebraic Data TypeScala 3 enum for a terser Option Monad Algebraic Data Type
Scala 3 enum for a terser Option Monad Algebraic Data Type
 
Open addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashingOpen addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashing
 

Semelhante a Fear and loathing with APL (oredev)

PERL for QA - Important Commands and applications
PERL for QA - Important Commands and applicationsPERL for QA - Important Commands and applications
PERL for QA - Important Commands and applicationsSunil Kumar Gunasekaran
 
Distributive Property
Distributive PropertyDistributive Property
Distributive PropertyJessca Lundin
 
Section 8: Symmetric Groups
Section 8: Symmetric GroupsSection 8: Symmetric Groups
Section 8: Symmetric GroupsKevin Johnson
 
Functional Concepts for OOP Developers
Functional Concepts for OOP DevelopersFunctional Concepts for OOP Developers
Functional Concepts for OOP Developersbrweber2
 
Algorithim lec1.pptx
Algorithim lec1.pptxAlgorithim lec1.pptx
Algorithim lec1.pptxrediet43
 
Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examplesgreatqadirgee4u
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In RubyRoss Lawley
 
Oct8 - 131 slid
Oct8 - 131 slidOct8 - 131 slid
Oct8 - 131 slidTak Lee
 
A Scala Corrections Library
A Scala Corrections LibraryA Scala Corrections Library
A Scala Corrections LibraryPaul Phillips
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxssuser01e301
 
Advanced s and s algorithm.ppt
Advanced s and s algorithm.pptAdvanced s and s algorithm.ppt
Advanced s and s algorithm.pptLegesseSamuel
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxDevaraj Chilakala
 
one main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersone main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersAjay Chimmani
 
Alegebra Powers Substitution
Alegebra Powers SubstitutionAlegebra Powers Substitution
Alegebra Powers SubstitutionPassy World
 
Split and list technique for solving hard problems
Split and list technique for solving hard problemsSplit and list technique for solving hard problems
Split and list technique for solving hard problemsRohit Kumar Singh
 

Semelhante a Fear and loathing with APL (oredev) (20)

PERL for QA - Important Commands and applications
PERL for QA - Important Commands and applicationsPERL for QA - Important Commands and applications
PERL for QA - Important Commands and applications
 
Distributive Property
Distributive PropertyDistributive Property
Distributive Property
 
Section 8: Symmetric Groups
Section 8: Symmetric GroupsSection 8: Symmetric Groups
Section 8: Symmetric Groups
 
Functional Concepts for OOP Developers
Functional Concepts for OOP DevelopersFunctional Concepts for OOP Developers
Functional Concepts for OOP Developers
 
Algorithim lec1.pptx
Algorithim lec1.pptxAlgorithim lec1.pptx
Algorithim lec1.pptx
 
Slope
Slope Slope
Slope
 
MA3696 Lecture 5
MA3696 Lecture 5MA3696 Lecture 5
MA3696 Lecture 5
 
Stacks Implementation and Examples
Stacks Implementation and ExamplesStacks Implementation and Examples
Stacks Implementation and Examples
 
Thinking Functionally In Ruby
Thinking Functionally In RubyThinking Functionally In Ruby
Thinking Functionally In Ruby
 
Oct8 - 131 slid
Oct8 - 131 slidOct8 - 131 slid
Oct8 - 131 slid
 
RubyConf Argentina 2011
RubyConf Argentina 2011RubyConf Argentina 2011
RubyConf Argentina 2011
 
A Scala Corrections Library
A Scala Corrections LibraryA Scala Corrections Library
A Scala Corrections Library
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 
Ruby Gotchas
Ruby GotchasRuby Gotchas
Ruby Gotchas
 
Advanced s and s algorithm.ppt
Advanced s and s algorithm.pptAdvanced s and s algorithm.ppt
Advanced s and s algorithm.ppt
 
INTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptxINTRODUCTION TO MATLAB presentation.pptx
INTRODUCTION TO MATLAB presentation.pptx
 
8.1 Powerpoint
8.1 Powerpoint8.1 Powerpoint
8.1 Powerpoint
 
one main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to othersone main advantage of bubble sort as compared to others
one main advantage of bubble sort as compared to others
 
Alegebra Powers Substitution
Alegebra Powers SubstitutionAlegebra Powers Substitution
Alegebra Powers Substitution
 
Split and list technique for solving hard problems
Split and list technique for solving hard problemsSplit and list technique for solving hard problems
Split and list technique for solving hard problems
 

Mais de 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
 

Mais de 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
 

Último

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Fear and loathing with APL (oredev)

  • 2. Hi, my name is Yan Cui aka @theburningmonk
  • 3. What is APL? created at IBM in 1957, by Ken Iverson designed to simplify math notations “A Programming Language”
  • 4. What is APL? famed for use of special symbols array programming influenced Mathematica, Matlab, etc.
  • 8. Conway’s Game of Life https://www.youtube.com/watch?v=a9xAKttWgP4
  • 9.
  • 10. “Beauty is in the Eye of the Beholder” beauty doesn't exist on its own but is created by observers
  • 11. “…We followed up with two studies on the accuracy rates of novices using a total of six programming languages: Ruby, Java, Perl, Python, Randomo, and Quorum. Randomo was designed by randomly choosing some keywords from the ASCII table (a metaphorical placebo). To our surprise, we found that languages using a more traditional C-style syntax (both Perl and Java) did not afford accuracy rates significantly higher than a language with randomly generated keywords, …” “An Empirical Investigation into Programming Language Syntax” - Andreas Stefik and Susanna Siebert
  • 12. “…We followed up with two studies on the accuracy rates of novices using a total of six programming languages: Ruby, Java, Perl, Python, Randomo, and Quorum. Randomo was designed by randomly choosing some keywords from the ASCII table (a metaphorical placebo). To our surprise, we found that languages using a more traditional C-style syntax (both Perl and Java) did not afford accuracy rates significantly higher than a language with randomly generated keywords, …” “An Empirical Investigation into Programming Language Syntax” - Andreas Stefik and Susanna Siebert
  • 14. “A language that doesn't affect the way you think about programming, is not worth knowing.” - Alan Perlis
  • 15. “in an era of mainstream programming languages, APL is a rare opportunity to truly challenge the way you think about programming” - me
  • 16.
  • 17.
  • 18. Let’s learn some APL http://tryapl.org/
  • 19. 2 + 2 4 4 - 1 3 + and - works the way you expect
  • 20. 2 * 3 8 4 * 4 256 but * means power
  • 21. 2 / 3 3 3 and / means replicate it means replicate the scalar value 3, 2 times and returns an array of 2 elements
  • 22. 2 × 2 4 4 ÷ 2 2 multiplication (×) and division (÷) just like in Maths!
  • 23. x ← 42 y ← 1 2 3 4 assignment (←) variable names are case sensitive
  • 24. variables are mutable x ← 42 x ← 1 2 3 4 x 1 2 3 4
  • 25. assign multiple values at once (kinda like pattern matching) x y z ← 1 2 3 x 1 y 2
  • 26. but the patterns must match x y ← 1 2 3 LENGTH ERROR x y ← 1 2 3
  • 27. 1 2 3 - 3 2 1 ¯2 0 2 1 2 3 × 3 2 1 3 4 3 arithmetic operations work on arrays too
  • 28. 1 2 3 + 1 2 3 4 2 × 1 2 3 2 4 6 if one side is scalar then the other side can be any shape
  • 29. 4 ⌊ 2 2 4 ⌈ 2 4 min (⌊) and max (⌈)
  • 30. 1 2 3 4 5 ⌈ 4 4 4 4 4 5 1 2 3 ⌈ 3 2 1 3 2 3 min (⌊) and max (⌈) same rules apply for arrays
  • 31.
  • 32.
  • 33. dyadic 2 ⌈ 4 1 2 ⌈ 3 1 monadic ⌈ 2 ⌈ 1 3
  • 34. ⌊ 3 4.1 4.5 5.6 3 4 4 5 monadically, ⌊ means floor
  • 35. ⌈ 3 4.1 4.5 5.6 3 5 5 6 and ⌈ means ceiling
  • 36.
  • 37. 3 2 ⍴ 1 2 3 4 5 6 1 2 3 4 5 6 dyadically, ⍴ reshapes right hand side rows columns
  • 38. ⍴ 1 2 3 3 ⍴ (3 2 ⍴ 1 2 3 4 5 6) 3 2 monadically, ⍴ returns shape of argument
  • 39. 3 2 ⍴ 1 2 3 1 2 3 1 2 3 ⍴ recycles elements to fill space
  • 40. 2 2 ⍴ 1 2 3 4 5 6 1 2 3 4 and ignores additional elements
  • 41. 3 3 ⍴ 1 0 0 0 1 0 0 0 1 0 0 0 1 here’s a neat trick to get diagonals :-P
  • 42. ⍴ 2 2 ⍴ 0 1 0 2 2 ⍴ (2 2 ⍴ 0 1 0) 2 2 oh, and APL is read from RIGHT-TO-LEFT
  • 43. ⍴ 2 2 ⍴ 0 1 0 2 2 ⍴ (2 2 ⍴ 0 1 0) 2 2 oh, and APL is read from RIGHT-TO-LEFT
  • 44. +/ 1 2 3 6 btw, / also means reduce ie, reduce over the array [1, 2, 3] with the plus function
  • 45. ×/ 1 2 3 4 5 120 btw, / also means reduce and here’s factorials!
  • 47. Avg ← { (+/ ⍵) ÷ ⍴⍵ } anatomy of a defined function function name assignment function body
  • 48. Avg ← { (+/ ⍵) ÷ ⍴⍵ } Avg 1 2 3 anatomy of a defined function omega ⍵ represents the right argument
  • 49. Diff ← { (+/ ⍺) - (+/ ⍵) } 3 4 5 Diff 1 2 3 anatomy of a defined function alpha ⍺ represents the left argument
  • 50. Plus ← { ⍺ + ⍵ } Plus/ 1 2 3 6 defined functions can be used with / too
  • 52. Xs ← 1 2 3 Xs[2] 2 APL is one-indexed!
  • 53. Xs[1 2 1] 1 2 1 Xs[2 2 ⍴ 1 2] 1 2 1 2 indices can be array too
  • 54. Xs[3 2] ← 6 4 Xs 1 4 6 updating an array
  • 55.
  • 56. ⍳9 1 2 3 4 5 6 7 8 9 index generator
  • 58. 1 < 2 1 1 2 3 < 3 2 1 1 0 0 1 is true, 0 is false yup, works with arrays too ;-)
  • 59. ~1 0 ~1 0 1 0 1 0 monadically, ~ means negate
  • 60. (1 2 3 < 3 2 1) ∧ (1 1 1) 1 0 0 (1 2 3 < 3 2 1) ∨ (1 1 1) 1 1 1 logical AND ∧ and logical OR ∨
  • 61. (⍳10) > 7 0 0 0 0 0 0 0 1 1 1 +/ (⍳10) > 7 3 count no. of positives
  • 62. (⍳10) > 7 0 0 0 0 0 0 0 1 1 1 ⍳10 > 7 ? are these two expression equivalent?
  • 63. (⍳10) > 7 0 0 0 0 0 0 0 1 1 1 ⍳10 > 7 1 are these two expression equivalent? nope! remember, APL reads from RIGHT-TO-LEFT!
  • 64. (⍳10) > 7 0 0 0 0 0 0 0 1 1 1 7 < ⍳10 0 0 0 0 0 0 0 1 1 1 are these two expression equivalent?
  • 66. 1 0 1 / 3 2 1 3 1 1 0 1 / 'iou' i u booleans can be used to as a mask
  • 67. Values ← 1 3 5 7 9 Values > 4 0 0 1 1 1 (Values > 4) / Values 5 7 9 a LINQ-style Where can be written as
  • 68. Values > 4 0 0 1 1 1 ⍳⍴Values 1 2 3 4 5 (Values > 4) / (⍳⍴Values) 3 4 5 and to get the indices instead
  • 69. 1 2 3 ~ 3 4 3 5 1 2 ‘ab’ ‘cd’ ‘ef’ ~ ‘cd’ ‘ef’ ab dyadically, ~ means without
  • 70.
  • 71. 1 1 3 5 3 7 ∊ 1 2 3 1 1 1 0 1 0 'hello world' ∊ 'aeiou' 0 1 0 0 1 0 0 1 0 0 0 dyadically, ∊ checks for membership
  • 72. Phrase ← ‘hello world’ (Phrase ∊ 'aeiou') / Phrase eoo which vowels appeared in a phrase?
  • 73. 2 2 ⍴ 1 2 1 2 1 2 ∊ 2 2 ⍴ 1 2 1 2 1 2 monadically, ∊ flattens a matrix
  • 75. 2 ↑ 1 2 3 4 1 2 2 2 ↑ (3 3 ⍴ ⍳9) 1 2 4 5 ↑ to take items from an array !?
  • 76. 3 3 ⍴ ⍳9 1 2 3 4 5 6 7 8 9
  • 77. 2 2 ↑ 3 3 ⍴ ⍳9 1 2 3 4 5 6 7 8 9 take a 2 (rows) by 2 (cols) matrix
  • 78. 2 ↓ 1 2 3 4 3 4 2 2 ↓ (3 3 ⍴ ⍳9) 9 ↓ to drop items from an array !?
  • 79. 3 3 ⍴ ⍳9 1 2 3 4 5 6 7 8 9
  • 80. 2 2 ↓ 3 3 ⍴ ⍳9 1 2 3 4 5 6 7 8 9 drop first 2 rows and 2 cols
  • 81. ¯2 ↑ 1 2 3 4 3 4 ¯2 ↓ 1 2 3 4 1 2 use negative count to take/drop from end of array
  • 82. ¯2 2 ↑ (3 3 ⍴ ⍳9) ? ¯2 2 ↓ (3 3 ⍴ ⍳9) ? what about these? http://tryapl.org/ try it out yourself
  • 84. 3 3 ⍴ ⍳9 1 2 3 4 5 6 7 8 9 given a matrix
  • 85. 3 3 ⍴ ⍳9 3 2 1 6 5 4 9 8 7 mirrors the matrix horizontally
  • 86. 3 3 ⍴ ⍳9 7 8 9 4 5 6 1 2 3 mirrors the matrix vertically
  • 87. ⍉ 3 3 ⍴ ⍳9 1 4 7 2 5 8 3 6 9 transposes the matrix⍉
  • 90. 1 2 3 .+ 4 5 6 5 6 7 6 7 8 7 8 9 . creates a cartesian product
  • 91. 1 2 3 .× 4 5 6 4 5 6 8 10 12 12 15 18 . creates a cartesian product
  • 92. (⍳3) .= (⍳3) 1 0 0 0 1 0 0 0 1 . creates a cartesian product
  • 93. (⍳3) .< (⍳3) 0 1 1 0 0 1 0 0 0 . creates a cartesian product
  • 94. (⍳3) .⌈ (⍳3) 1 2 3 2 2 3 3 3 3 . creates a cartesian product
  • 95. (⍳3) .+ (⍳3) 2 3 4 3 4 5 4 5 6 . creates a cartesian product
  • 96. what about this? http://tryapl.org/ try it out yourself ∊ (⍳3) .× (⍳5) ?
  • 99. should I learn APL? absolutely! it’s the shock to the system your brain needs
  • 100. is it gonna help my career? does it matter?