►
From YouTube: Array programming: a short J tutorial
A
Okay,
this
is
a
talk
that
I
was
a
workshop,
that
I
was
going
to
run
at
a
kid.
I've
contributed,
20
20
on
array
programming
and
the
J
language
in
particular,
but
unfortunately
didn't
get
enough
upvotes
to
be
selected
for
the
program,
so
I
decided
to
move
it
to
a
remote
talk.
Instead,
I'm
Shawn,
McGivern
I'm
a
back-end
engineer
at
gate,
lab
I.
Don't
have
any
particular
expertise
in
this
I've
just
been
playing
around
with
it
for
a
couple
months
and
I
thought
it
was
kind
of
fun
and
interesting.
A
So
I
wanted
to
share
it
with
some
other
people.
So
yeah,
let's
get
started.
I
talked
a
lot,
so
brevity
isn't
really
expected
from
me.
But
you
know
the
array
programming
as
a
sort
of
concept
and
the
way
I'm
defining
it
in
this
talk
is
like
basically
sort
of
the
lineage
of
programming
languages
from
APL
and
those
tend
to
have
extremely
short
programs.
A
For
a
few
reasons.
Sometimes
people
might
say
it's
unreadable,
but
you
know
clearly
people
are
able
to
do
productive
work
in
these
languages
as
well.
So
I
think
it's
interesting
to
sort
of
tease
out
why
that
might
be
what
might
work
in
other
languages.
What
might
not
work
in
other
languages
and
sort
of
you
know
engage
with
it
rather
than
just
rejecting
it
out
of
hand.
So
I'm
going
to
talk
a
bit
about
like
what
array
programming
is
as
I
see
it
and
again
I'm,
not
an
expert
and
then
we'll
do
a
quick
J
tutorial.
A
I
am
NOT
going
to
end
up
this
workshop
with
a
suggestion
that
you
write
any
actual
application
in
J,
because
I
don't
know
why
you
would
necessarily
want
to
do
that,
but
I
don't
think
all
programming
necessarily
needs
to
be
for
applications
as
such,
so
oh
yeah,
and
then
why?
So
you
know
I
find
this
fun.
A
So
I'll
start
with
the
bottom
one,
because
actually
that's
the
most
important
one
and
I'll
go
into
that
a
bit
more
later,
so
there's
a
strong
focus
on
notation
and
that
sort
of
comes
from
sort
of
a
mathematical
background
so
like
if
you
think
a
lot
of
things
here
will
probably
make
more
sense,
if
you
think
of
them
in
a
mathematical
notation
sense
than
if
you
do
in
a
sort
of
traditional
programming
language
sense.
Perhaps
that
means
that
everything
and
sorry,
obviously
the
other
thing
is
I'm
calling
these
array
programming
languages.
A
That
means
that
everything
is
an
array,
so
you
might
say
you
know
in
Ruby
everything's
an
object
like
you
know
you
can.
You
can
try
and
call
methods
on
nil
and
they
will
blow
up,
but
you
can
at
least
like
it's
valid
to
try
that
in
this
everything
is
an
array,
and
that
means
multi
dint
multi-dimensional
array
so
from
the
notation,
because
it's
coming
from
mathematics
like
you
know,
there
are
operations
defined
on
matrices
for
instances
which
are
two-dimensional,
arrays,
so
there's
automatic
application
of
different
functions
and
operators
to
different
types,
different
dimensionalities
of
array.
A
A
If
you
were
trying
to
use
notation
to
help
you
think,
then
what
would
that
notation
look
like
and
the
problem
is
Kenneth
Everson
is
looking
at
solving.
You
know
mostly
mathematical
problems,
which
is
why
the
notation
looks
like
it
does,
because
it
comes
from
mathematics
and
you
know
it's
influenced
by
it.
But
and
I
will
do
a
terrible
job
of
summarizing
it.
A
So
please
just
read
the
paper,
but
the
basic
idea
is
that
there's
this
tension
between
computer
programming
languages,
which
have
notation,
but
the
notation
is
designed
for
a
computer
to
interpret
and
mathematical
notation,
which
is
quite
natural
in
a
lot
of
cases-
and
you
know
quite
concise,
but
is
also
not
possible
for
a
computer
to
interpret
it.
So
you
can
think
about
it
as
an
attempt
to
create
an
executable,
mathematical
notation,
and
that
might
be
the
the
easiest
way
in
I
guess
so.
A
Don't
worry
like
I
studied
mathematics,
I'm,
not
great
at
mathematics
anymore,
because
I
don't
have
to
use
it
the
first
time,
so
you
don't
need
to
you.
Don't
need
to
know
mathematical
concepts
like
to
learn
these
languages
I'm
just
talking
about
this
in
a
sort
of
background
sense.
So
let's
take
a
look
at
some
APL.
This
is
a
classic
video.
You
may
have
already
seen
it.
This
is
the
game
of
life,
which
is
hopefully
everybody
knows
what
that
is.
A
So
when
you
say
take
the
positions
in
these
languages,
boolean
so
normally
0
or
1.
So
this
isn't
2
3,
4,
5,
&
8,
because
this
is
the
first
iteration
after
that.
But
this
would
be
if
you
took
the
positions
of
1,
2
3,
4,
7,
&
8
in
this
one,
then
we
next
move
that
into
a
5
by
7
matrix,
to
give
the
padding
around
the
edge
and
shift
that
to
horizontally
and
1
vertically
to
Center
it.
And
then
here
is
the
actual
sort
of
application
of
life.
A
I'm
not
gonna,
go
into
too
much
detail
there,
like
I,
said
important
things
to
note
here
in
APL,
the
curly
braces
mean
a
function
and
the
Omega
is
the
argument
to
that
function.
So
you
don't
name
the
arguments
you
just
get
given.
You
can
just
use
Omega
in
there
and
then
we'll
see
this
a
lot
later.
So
this
is
a
common
pattern
to
all
the
languages
plus
slash
basically
means
sum:
it's
two
characters:
it's
plus
and
slash:
it's
not
a
single
operator,
so
it's
more
general
but
yeah.
A
So
this
is
something
twice
which
I'll
go
into
in
a
bit
more
detail
later,
but
that's
what
APL
looks
like
and
one
of
the
issues
I
think
people
had
with
APL
is
that
it's
got
a
different
character
say
like
it's
hard
to
type.
There
were
special
I
believe
special
APL
keyboards.
Now
you
can
type
it
in
no
using
regular,
keyboards
easily,
but
I
think
that
was
kind
of
a
barrier
to
adoption.
A
So
in
the
family
tree
there
are
kind
of
these
parallel
lineages
and
they're,
both
a
skew,
bastes,
okay,
I'm
gonna
start
the
bottom
again,
K
and
Q
come
from
I
think
something
called
a
plus.
So
these
come
out
of
like
banking,
investment,
banking,
and
these
were
created
by
Arthur
Whitney,
who
worked
with
Kenneth
even
when
he
was
younger.
A
These
are
commercial
languages.
There
are
some
open-source
variants
of
K
written
by
other
people,
but
for
the
most
part
they
are
languages
you
have
to
pay
to
use,
which
is
why
I
started
J,
they're
known
for
being
very
fast.
You
will
sometimes
see,
like
you
know,
when
someone
posts,
like
an
article
like
oh
I,
rewrote
their
word
counting
in
my
favorite
language
and
it's
faster
than
the
C
version,
and
then
someone
posts
a
Q
version.
That's
like
one
line
and
they'll
say
oh
well.
This
is
actually
faster,
so
you'll
occasionally
see
like
the
one
line.
A
Queueing
K
pop
up
in
comments
to
articles
like
that
I
don't
have
a
huge
amount
of
knowledge.
There.
I
can
say
that
the
different
versions
of
K
are
actually
different
languages
kind
of
like
pearl,
so
there's
a
k5
and
a
k-6
and
the
k7,
and
they
all
have
slightly
different
features.
So
from
what
I
understand
that
the
Whitney
just
rewrites
the
entire
language,
every
time
there's
a
new
version
rather
than
start
from
the
previous
versions.
A
It
was
initially
also
a
commercial
language,
but
it's
been
open
source
since
2011
or
dual
license
since
2011
and
the
big
distinction
I
would
say,
between
J
and
K,
beyond
sort
of
like
other
design.
Differences
is
that
Jays
back
standard
vocabulary,
which
you
can
think
of
as
like
the
standard
library,
but
not
exactly,
is
huge
and
case
is
much
much
smaller,
so
there's
sort
of
a
maximalist
minimalist
attention
between
them.
A
I'd
say
if
you
can
read
one,
you
can
probably
get
a
grasp
on
the
other,
but
there
are
definitely
sort
of
fundamental
things
that
work
differently
and
from
what
I've
seen
things
like.
Defying
new
functions
are
much
nicer
in
K
than
they
are
in
jail,
although
NJ,
it's
not
bad,
it's
just
that
k
I
think
has
a
more
consistent
way
of
doing
that.
A
So
that's,
basically
all
the
intro.
Let's
take
a
look
at
some
J.
So
at
any
point
from
this
point,
if
you
have
J
installed
like
feel
free
to
like
type,
this
I
also
put
the
link
to
the
slides
in
the
invite.
So
you
can
just
copy
and
paste
it
like
one
of
the
Vantage
of
these
programs
really
really
short.
Is
it
shouldn't
take
long
to
type
this
in
a
console?
So
if
you've
got
J
installed
on
Mac
OS,
you
can
start
a
J
console
by
typing
Jake
on
and
yeah.
A
A
First
of
all
by
convention
there
are
three
spaces
before
user
inputs,
and
then
outputs
is
unand
nted,
so
that's
kind
of
backwards
to
a
lot
of
languages.
But
again
these
have
kind
of
like
been
their
own
sort
of
parallel
branch
of
language
design.
So
they
kind
of
do
a
few
things.
Weirdly
like
that.
J
also
have
this
thing
where
it's
again
kind
of
like
pearl.
Actually,
it
kind
of
uses
linguistic
terms
for
a
lot
of
things.
So
we
don't
talk
about
functions.
A
We
talk
about
verbs,
adverbs
and
conjunctions,
which
can
be
a
bit
confusing
at
first,
but
I
found
it
easier
to
just
stick
with
the
official
terms
rather
than
try
and
translate
backwards
and
forwards.
So
this
first
line
or
sentence
is
saying:
give
us
the
first
12
positive
integers
so
like
in
the
APL
example.
At
the
start,
this
I
dot
works
like
iota
did
there
it
gives
a
sequence
of
12
numbers.
This
one
starts
at
0
instead
of
1,
so
I'm,
adding
1
to
the
sequence.
A
So
here,
I
dot
is
a
verb
that
takes
one
argument
which
is
12
plus
is
a
verb
that
takes
two
arguments
which
is
1
and
I.
Don't
12
equals
:
is
a
fairly
obviously
an
assignment,
hopefully
equals
dot
is
local,
but
for
this
we're
just
going
to
use
global
assignment.
So
you
don't
really
need
to
worry
about
that.
This
is
a
verb
which
we'll
go
into
later,
but
basically
just
means
display
the
output.
So
that
gives
us
the
first
12
numbers.
A
Sentence
we
have
a
comment
which
starts
with
n
B
again
slight
parallel
evolution
of
programming
languages,
but
also
when
you
see
the
standard
vocabulary,
you
realize
that
basically,
every
every
non
letter
or
number
and
every
non
alphanumeric
symbol
on
the
keyboard
is
already
taken
to
mean
something
else.
So
you
kind
of
have
to
use
something
like
NB
to
me
in
a
comment
because
they're
all
they're
all
in
use
otherwise,
and
so
we've
we've
given
our
list.
A
name
of
a
plus
slash
means
sum
here
plus,
is
a
verb
like
the
verb
here.
A
That
takes
two
arguments.
One
on
the
left,
one
on
the
right
and
slash,
is
an
adverb
that
makes
it
possible
to
apply
that
over
the
entire
array
and
that
you
can
think
of
that
as
like
reduce,
but
we'll
go
into
that
in
a
bit
more
in
a
second.
So
that's
the
sum
of
the
array,
and
then
this
will
make
sense.
Is
the
mean?
So
it's
the
sum
divided
by
the
count
of
the
array
and
that's
a
fork,
which
is
one
of
the
things
that
J
has
that
I?
A
Don't
think
a
house,
but
it's
quite
interesting,
but
not
necessarily
generalizable
but
yeah.
All
of
these
are
words.
Words
make
a
sentence
like
I
said:
J
refers
to
these
as
parts
of
speech,
so
the
J
wiki
is
generally
the
best
place
to
learn
about
stuff,
and
it
will.
It
has
quite
a
big
sort
of
parts
of
speech
section
where
it
talks
about
the
intricacies
of
each
of
these
I'm
just
going
to
take
a
second
drink,
some
water.
But
if
anybody
has
any
questions,
feel
free
to
speak
up
or
ask
in
the
chat.
Yes,.
B
A
Go
on
to
that
on
the
next
slide,
but
yes,
that's
a
good
question
because
it's
kind
of
mysterious
there.
Oh
sorry,
it's
not
on
the
next
slide.
It
must
be
on
the
slide
after
so
this
is
just
walking
through
some
other
stuff.
So
I
will
get
to
that,
though
I
promise
my
site
so
just
repeating
the
first
sentence
from
the
previous
slide
and
some
things
to
note
here,
the
there
is
no
operator
precedence
like
if
you
try.
A
What's
a
good
example,
two
times
three
plus
one
in
your
console
that
will
not.
That
will
not
give
you
seven.
That
will
give
you
eight
and
if
I
can
do
math
in
my
head
correctly,
because
it's
the
three
plus
one
is
on
the
right
hand
side.
So
that
gets
evaluated
first
then
multiplied
by
two.
So
any
any
change
to
the
default
execution
order.
You
can
use
parenthesis
and
there
are
also
a
couple
of
other
tricks
you
can
use,
but
I'm
not
going
to
use
them
here
because
they
there's
already
plenty
to
go
through.
A
A
A
So
it
adds
1
to
1,
sorry
0
to
0,
1,
2,
1,
2,
2,
2,
etc
and,
like
I
said,
because
there's
no
precedence
I
have
to
put
braces
around
here,
because
otherwise
this
would
be
I
dot,
12,
plus
12
and
then
I
dot,
but
I
dot
doesn't
take.
The
results
of
that
would
be
a
list
and
I
dot
doesn't
take
a
list,
so
you
would
get
an
error.
So
that's
why
I
had
to
put
parentheses
around
this
side,
but
not
around
this
side.
A
A
Something
I
wanted
to
call
out
here
because
it
might
be
obvious,
and
it
might
not
is
here-
I've
added
a
single
atom
one
to
a
list
12
and
it
adds
the
atom
to
every
item
in
the
list.
Here,
I've
added
a
list
of
length
12
to
a
list
of
length
12
and
it
adds
the
items
pairwise.
So
at
the
start,
when
I
was
talking
about
automatic
application,
this
is
the
kind
of
thing
I
meant
like.
A
Hopefully,
both
of
these
are
fairly
obvious
when
you
meet
them,
but
if
you
think
about
them
in
terms
of
other
programming
languages,
that
might
not
actually
be
how
you
do
this.
Those
two
operations
because
they're
different
things,
if
you're
used
to
thinking
about
arrays
as
like
things
that
you
need
to
unpack
and
manually
like
loop
over
or
manually,
do
some
operation
on,
even
if
you've
got
higher
order.
Even
if
you've
got
like
you
know,
convenience
facilities
for,
like
you
know,
reducing
and
folding
over
arrays,
you
might
not
have
that
quite
look
the
same
way.
A
So
what
does
anybody
think
adding
an
array
of
one
length
to
an
array
of
a
different
length
would
do
so.
This
is
an
Assam
rather
than
array
added
to
an
array.
This
is
an
array
of
length,
12
added
to
a
length
of
the
route
array
of
length
12.
You
could
try
that
out
in
your
console
and
tell
me
what
it
says
as
well.
If
you
want.
A
Exactly
right,
Sebastian,
so
J's
error
messages
are
terrible,
I
should
say
length,
error
is
one
of
the
errors
you
will
get
like
domain
error
is
another
one,
but
like
basically
they're
no
they're
not
very
helpful.
This
one.
This
one
isn't
too
bad
because
I
sort
of
like
led
into
like
what
the
issue
would
be,
but
it
can
be
quite
hard
to
figure
out
what's
going
on
so
yeah,
because
the
dimensions
don't
match
in
any
way,
there's
no
sort
of
sensible
option
for
J
to
pick
as
a
default
here.
So
it
just
sort
of
goes
with.
A
A
So,
for
instance,
let
me
just
type
this
up.
So
if
you
type
$1
1
in
your
console,
you
will
get
one,
but
that
will
be
a
list
of
length
one.
So
if
you
then
type
parenthesis
$1
1,
plus
I
dot
12,
you
will
get
a
length
error
because
then
you're
trying
to
add
a
list
of
length
1
to
a
list
of
length,
12,
so
yeah
thanks
for
calling
that
out,
then
I
did
definitely
oversimplify
that
part.
A
So,
while
almost
everything
is
an
array,
there
are
atomic
types
that
aren't
and
you
can
think
of
those
as
an
array
with
dimension
0,
which
is
the
way
Jay
sometimes
puts
it.
I
might
help
later
on.
So
some
languages,
omona
and
tutorial
takes
like
a
whole
blog
post.
This
one.
It's
got
its
own
definitions
for
things
because
it
means
you
know.
Parallel
evolution
again
so
verb
is,
you
can
think
of
as
a
function.
A
They
only
take
a
maximum
of
two
arguments,
one
on
the
left,
one
on
the
right,
but
the
arguments
can
obviously
be
arrays
and
a
monad
is
just
a
verb.
That
only
has
a
right
argument,
so
sometimes
I
might
say
Mona
they
put
the
Attic
here.
I
will
try
not
to
because
they're
not
sort
of
natural
terms
that
if
I
do
what
I
mean
by
monadic
is
we're
only
using
the
right-hand
argument,
which
is
by
convention
called
Y
like
in
the
APL
example.
A
A
Getting
back
to
the
right
square
bracket
that
might
is
asked
about
earlier,
so
by
default
assignment,
doesn't
display
the
value,
but
it
does
return.
The
value
which
is
a
little
bit
confusing
right
square
brace,
is
basically
an
identity.
Verb,
they're
also
left
square
brace
does
the
same
thing
in
this
case.
They
have
another
use,
but
but
Alex
cope
for
what
I'm
talking
about
here.
But
here's
a
few
examples
of
just
like
what's
happening
with
in
a
console
session
when
you
use
or
don't
use
the
right
square
brace.
A
A
So
yeah
I
talked
a
bit
about
the
verbs,
so
we
had
I
dot
plus
multiply
an
adverb,
as
you
might
expect
from
the
name,
is
like
a
higher-order
function.
So
it's
a
it's
a
verb
that
operates
on
a
verb
rather
than
all
now
so
slash
is
the
one
I
mentioned
earlier.
It
works,
kind
of
like
reduce,
so
plus,
slash
is
the
sun.star.
Slash
is
the
product
and
in
this
case,
right
angle,
brackets
and
dot
is
the
greatest
of
the
two
arguments.
So
obviously
this
just
gives
you
the
last
argument.
A
A
So
so
far
we've
been
looking
at
single
dimensional
arrays
just
a
list,
but
now
we
can
look
at
tables
as
well
or
matrices.
So
I
mentioned
shape
earlier.
Shape
is
just
the
dimensions
of
an
array,
so
I
got
12
has
shape
12
because
it's
a
one-dimensional
array
with
12
items
here,
we're
using
dollar,
which
I
mentioned
earlier
to
like
kernel,
a1
into
a
list
just
containing
1
to
reshape
a
noun.
So
three
four
means
a
three
by
four
table:
dollar
a
obviously
reshapes
a
into
a
three
by
four
table
and
yeah.
A
So
each
of
the
numbers
is
an
atom,
so
they
can't
be
reshaped
because
they
have
no
shape
that
any
array
or
list
has
a
shape,
and
this
is
what
we
mean
when
we
say
the
shape
of
a
list.
Sorry
of
an
array
list
just
means
one
dimensional
array
get
my
terms
mixed
up,
so
plus
slash
also
works
here
and
it
gives
column
sums
so
one
plus
five
plus
nine
is
15.
A
2,
plus
6
plus
10
is
18,
etc,
and
that
just
works
automatically
like
I
said
so
you
can
just
sort
of
sum
anything
and
like
it
will.
It
will
give
you
the
right
shape
of
result
compared
to
the
shape
of
what
you
put
in
that
won't
always
work,
but
for
most
verbs
J
can
automatically
apply
it
to
the
right
level,
I
guess
or
the
right
dimensions
of
the
objects.
D
B
A
D
A
So
it's
yeah
it
just
it
just
wraps
around,
so
it
doesn't
use
any
knowledge
about
its
I
dot.
Twelve.
It
just
starts
from
the
beginning
again
and
similarly,
if
you
did
like
3x3,
hopefully
that
would
be
more
obvious
anyway,
but
if
you
did
3x3
you
would
just
lose
the
last
four
items.
Three
items
can't
count
because
yeah
so
yeah,
that's
that's
a
good
observation,
so
reshaping
automatically
keeps
filling
whatever
you're
reshaping
to
make
up
the
new
shape
you
can't
have.
A
Actually
on
that
topic,
one
thing
I
forgot
to
mention
was
that
arrays
in
j
have
to
be
have
to
all
have
the
same
type.
You
can't
put
a
string
in
an
array
with
a
number
or
you
can,
but
you
have
to
then
what's
called
box
the
awesomes
which
I
won't
go
into
in
this
talk,
because
it's
a
bit
more
involved
than
we
need
to
get
into,
but
like
you
can
basically
think
that
it's
like
you
know
boxing
in
Java
or
whatever
like,
where,
instead
of
a
primitive
type,
you
have
a
object
wrapper.
A
So
that
gives
you
column
sums.
What,
if
you
wanted
row
sums
well
sort
of
one
obvious
answer:
is
you
could
transpose
the
table,
and
so
you
wouldn't
necessarily
know
that
pipe
go
on
its
transpose.
But
if
you
try
pipe
coal
on
why
you
will
see,
but
it
is
and
then,
if
you
sum
that
obviously
you'll
get
the
column
sums
of
the
transposed
table,
which
is
the
row
sums
of
the
original
table
and
then
operate
on
the
one
cells
with
explicit
rank.
A
A
There
is
this
conjunction
double
quote,
so
a
conjunction
is
like
an
adverb,
but
it's
dyadic,
I,
think
I'm
right
and
say
so,
like
an
adverb.
Just
has
one
argument:
a
connection
has
to
the
vertical
modifiers
in
the
more
general
sense.
I
might
have
that
definition
wrong
by
the
way.
Don't
don't
trust
it.
A
And
so
the
rank
of
an
operation
is
these
subtly?
Sorry,
let
me
go
back
a
second.
The
rank
is
the
length
of
the
list
of
the
shape,
so
an
atom
has
rank
zero.
Like
I
said
it's
zero
dimensional
a
has
rank
one,
because
its
shape
is
just
12.
B
has
rank.
Oh
sorry,
I
rename
these
from
b2
why
it
started
from
way
to
B,
but
I
missed
these
two.
Those
are
supposed
to
be
B's
there.
A
A
A
This
makes
some
have
rank
one,
so
it
makes
it
operate
on
the
one
cells
or
the
one
dimensional
arrays
within
beam,
and
by
default
it
has
infinite
ranks,
so
it
just
goes
as
high
as
it
can
and
then
takes
the
the
highest
order
of
thing.
It
can
slice
up
and
sums
those
there's.
This
thing
you
can
use
B
dot.
So
if
you
do
plus
slash
B
dot
0,
you
will
get
a
list
of
ranks,
they
will
all
be
underscore.
A
So
what
that's
saying
is
underscore
is
infinity
and
it's
saying
that
the
monadic
rank
is
infinity
and
dialect
rank
is
infinity
on
the
left
and
infinity
on
the
right.
So
that's
why
there's
three
underscores
so
saying
that
out
loud,
you
know
it
is
super
tough,
but
once
you
know
what
that
means,
it's
not
too
bad,
I
promise.
A
Yeah
so
plus
/b.
Well,
maybe
I've
got
these
the
wrong
way
around.
Actually,
no
I
mean
sorry.
Let
me
just
check
sorry.
Yes,
so
column
sums
row
sums
column,
sums
work
like
plus
slash
the
list
of
the
first
row,
plus
the
list
of
the
second
followed
by
the
list
of
the
second
row,
followed
by
the
list
of
the
third
row.
A
The
way
you
construct
an
array
in
J
is
just
by
adding
spaces.
The
way
you
combine
two
arrays
is
with
the
comma.
The
reason
I
have
the
comma
colon
here
is
because
I
need
a
particular
shape
of
output
array,
and
you
don't
really
need
to
worry
about
that.
But
basically,
this
is
how
you,
how
you
can
pose
things
so
+
/
by
default.
If
we
go
back
to
what
B
looks
like.
Is
this
Plus
this
Plus
this
which,
like
we
said
before,
operates
pairwise?
A
A
A
A
So
it's
the
same
as
saying
like
when
you
have
one
it's
the
same
as
same
plus
1,
which
is
1
I'm,
surprisingly
for
2
&
3,
and
obviously
this
isn't
a
three-dimensional
array,
because
the
rank
of
sum
is
infinite
by
the
they
just
work
the
same,
as
was
what
it
would
be
anyway.
It's
just
saying
like
apply
it
on
the
highest
order
of
thing.
You
can
so
I
think
there's
a
case
for
saying
that
with
rank
three,
it
should
be
an
error,
because
the
the
actual
array
doesn't
have
rank
three
but
I
think.
A
A
So
really,
the
point
here
as
well
is
that
you
can
set
an
explicit
rank
with
this.
Double
quote
conjunction,
so
you
can
say:
I
want
some
to
be
of
rank
one,
but
by
default
every
verb
has
a
rank,
and
also
every
array
has
a
rank.
So
J
can
use
those
two
ranks
to
figure
out
what
some
of
a
matrix
means
or
what
some
of
a
three-dimensional
ray
means,
because
it
can
use
the
two
ranks
and
apply
it
to
the
correct
size
of
what
we
call
self.
A
A
B
C
But,
for
example,
when
you
try
to
where
they
were
filled
up
with
shapes
they're
like
a
into
like
three
for
one
right,
it
will
like
the
shape
change
and
then
the
the
round
stones
make
sense
again
like
if
you
keep
reshaping
it
with
the
island
EXO
dimension
as
a
one
level.
The
way
which
is
retrieved
that
make
made
friends
they
I,
don't
know
the
rank
operation
at
the
Sun.
Again.
Sorry,.
C
Into
three
for
one,
if
you
check
with
Richard,
then
the
ransom
makes
sense.
Again.
Yes,
like
you
need
to
like
imagine
that
you
are
like
just
keeping
the
same
values
before
just
is
more.
How
do
you
reject
that
or
how
the
shaping
makes
sense
for
the
new
abrasion
I
think
it's
implied,
Abra
I'm,
not
sure
I'm,
just
squeezed
about
it.
Yeah.
A
A
So
when
I
talked
about
automatic
application
at
the
start,
this
is
kind
of
what
I
meant
like
you,
have
a
rank
for
your
function
and
you
have
a
rank
for
your
input
to
the
function
and
you
find
the
common
shape
and
rank
of
thing
between
those
two
and
you
apply
it
to
those
two
and
then
you
get
the
results
depending
on
what
those
are
applied
to.
So,
if
you
want
the
total
sum
of
the.
A
B
A
A
Okay,
so
timewise
I
probably
need
to
be
moving
on,
and
so
I
mentioned
conjunctions
before
so
yeah,
oh
okay,
right
I,
probably
was
right.
Conjunction
is
a
modifier
that
takes
two
arguments
as
opposed
to
one
for
an
adverb.
It
takes
one
argument
that
has
to
be
a
verb
for
a
conjunction.
It
doesn't
because
you
can
see
here
that
one
is
not
other
it's
an
atom,
but
this
is
a
verb.
So.
A
A
A
Sum
with
Rank
1
plus
colon
is
double
I'm,
just
showing
that
here
right
angle,
brace
colon
is
increment
I'm,
just
showing
that
here,
so
you
can
increment
by,
like
obviously
just
applying
one
after
the
other
here
I'm
doing
one
with
a
conjunction
which
is
at
I
said
it
works
like
compose,
that's
actually
wrong.
It
does
kind
of
void
like
compose,
but
the
closer
one
to
like
sort
of
traditional
compose
function
is
at
:
and
you'll
see
that
there
are
a
lot
of
these
sort
of
digraph.
A
So
like
a
lot
of
verbs
that
are
one
character
by
default
like
plus
and
slash,
and
then
there
are
some
that
are
too
like
plus
Coulomb
and
angle
brackets
:.
There
is
logic
in
the
way
they
are
put
together,
but
I'm
not
equipped
to
describe
that
logic.
So
I
will
just
say
you
have
to
just
sort
of
get
a
sense
for
what
makes
sense
and
what
doesn't
but
yeah.
So
this
isn't
very
interesting
because
it
does
the
same
thing
as
just
applying
them
one
after
the
other.
A
The
interesting
thing
you
can
think
about
is
like
well
what,
if
I
wanted
to
like,
assign
this
to
something
or
put
it
somewhere
else
like
where
I
didn't
immediately?
Have
the
nothing
on
the
right
hand,
side
that
I
wanted
to
apply
it
to,
but
I
just
wanted
a
single
verb.
That
does
both
for
some
reason.
Then
that's
where
you
would
use
composition
like
you
would
in
any
other
language
where
you
would
compose
two
functions.
A
A
A
These
show
up
in
a
bunch
of
places
and
sort
of
idiomatic,
je
use
of
them
quite
a
lot.
The
fortunate
/
unfortunate
thing
is
that,
if
you
put
say
four
verbs
in
a
row,
you
would
this
would
still
work.
You
would
get
and
I
always
forget
which
way
around
it
is.
You
would
either
get
a
fork
where
the
this
one
is
the
hook
from
here
or
the
other
way
around.
A
My
account
remember,
I
can
never
remember
which
way
it
consumes
those
to
construct
this
trade,
but
because
this
is
just
constructing
a
new
verb
that
works
like
this,
and
this
is
just
constructing
a
new
verb
that
works
like
this.
You
can
think
of
them
as
just
ways
of
constructing
verbs
without
using
explicit
composition
operators,
but
it
can
be
very
confusing
when
you
read
something
and
is
a
thing
that
made
me
think
about
syntax,
highlighting
and
just
in
general,
because
in
je
syntax,
highlighting
you
know,
built
in
like
words,
isn't
super
useful.
A
If
there
was
a
way
syntax
highlighting
could
highlight
what's
a
hook,
what's
a
fork
what's
connected
to
what
like
what's
composing
automatically
in
that
way,
that
would
actually
be
really
useful
and
I
think
there
are
some
tools
in
J
to
do
that,
but
they're
not
so
much
since
our
eyes.
You
know
they
draw
you
like
a
tree
of
the
evaluation.
A
I
have
to
put
this
in
parentheses,
but
if
you
take
this
and
just
assign
it
to
something
like
I,
don't
know
mean
so
if
you
don't
mean
equals
colon
and
then
put
in
plus
slash
percent
hash
side.
If
you
then
do
mean
a
it
will
just
work,
so
we
didn't
really
cover
like
constructing
your
own
verbs,
but
that's
one
way
you
can
quite
easily
construct
your
own
verb
and
probably
the
easiest
way
to
make
it
clear
to
somebody
that
this
is
a
fork
is
to
just.
A
Assign
the
verb,
the
forks
or
something
without
any
nouns
involved,
because
then
it's
obvious
to
somebody
that
this
has
to
be
a
composition
of
functions
and
in
general,
J
style
varies
for
what's
called
tacit
style.
So
when
you
construct
verbs,
you
don't
generally
use
explicit
arguments
if
possible,
you
just
construct
Forks
and
compositions
and
hooks
that
know
where
their
arguments
are
and
insert
them
in
the
right
places
kind
of
like
in
Haskell.
A
So
that's
why
you
might
use
this,
but
I
didn't
want
to
really
have
time
to
like
talk
too
much
about
that.
I
did
want
to
talk
a
bit
about
the
vocabulary,
because
if
you
want
to
go
forward,
this
is
going
to
be
very
useful.
So,
first
of
all,
I'm
just
going
to
do
an
unfair
deliberately
unfair
comparison
between
the
J
vocabulary
and
the
K
break
February.
So
this
is
the
J
vocabulary.
These
are
all
the
standard
words
that
you
need
to
know.
As
you
can
see
there
are.
You
know
plenty,
this
is
the
j4k
vocabulary.
A
That's
it
this
20
primitives,
six
operators,
slash
adverbs
and
three
system
functions,
which
sort
of
indicates
the
difference
in
style
between
Arthur
Whitney,
Kenneth,
Eva.
So
right.
So
the
way
to
read
this
really
quickly.
I'm,
not
expecting
you
to
remember
all
this,
but
just
so
you
know.
So
it's
got
a
key
up
here.
So
purple
suburbs,
blue,
two
adverbs
greens,
conjunctions
now
so
it's
just
got
the
Infinity
indeterminant
one
was
just
there
for
use.
A
A
So
probably
works
like
you'd
expect.
So
if
you
give
it
one
arguments
that
argument
has
so,
if
you're
in
the
monadic
case,
it
has
rank
zero
and
it
works
as
negate.
If
you
give
it
two
arguments
and
it's
dyadic,
both
arguments
have
rank
zero
and
it
works
as
so.
That's
what
this
is
saying.
So
it's
giving
you
the
monadic
case
and
the
dyadic
case.
A
Not
all
of
them
have
both
and
not
all
of
them
have
the
same
rank
for
both
so,
for
instance,
shape
which
we
read
it
earlier.
So
that's
what
I
called
reshape.
The
left
argument
has
to
have
Rank
1,
because
a
shape
is
a
list
of
dimensions
like
you
can't
have
a
two-dimensional
list
of
dimensions
that
doesn't
make
sense,
and
the
right
argument
has
rank
infinity
because
it
can
be
anything
and
then
to
get
the
shape
of
something.
B
A
Things
are
grouped
and
there
is
sort
of
some
logic,
so
you
can
see
here.
You've
got
less
than
then
you've
got
less
the
minimum
of
like
with
the
dots
and
then
you've
got
less
than
or
equal
to
with
a
colon,
and
similarly
that's
decrement
and
increment
in
the
monadic
form.
So
like
the
dots
and
colons
like
generally
follow
down
here
so
like
you,
have
hash
hash,
dot,
:
and
they
generally
relate
in
some
way.
A
A
You
just
do
have
to
like
read
them
and
like
learn
it
down
here
or
a
bunch
of
the
composition
and
conjunctions
so
yeah
earlier
I
mentioned
that
and
this
one's
actually
called
at,
but
it's
at
:
and
this
one's
called
the
top
and
it's
at
which
I
was
find
quite
confusing
when
I'm
trying
to
like
do
my
internal
monologue,
so
I
think
work
out
what
something
means.
So
a
couple
of
other
verbs
here.
A
So
alphabet
is
all
the
ASCII
bytes
and
that's
a
boxed
empty
list
which
is
useful
for
some
things,
but
we
don't
need
to
go
into
so
those
those
are
two
nouns
you
can
see
there,
but
most
of
these
going
to
be
verbs,
adverbs
and
conjunctions
right.
Sorry,
I
realize
I'm
out
of
time,
but
I'm
gonna
keep
going
for
a
little
bit
if
that's
okay,
so
one
thing
you
might
be
wondering
is
why
wouldn't
I
just
name
these
things
like
their
names
on
here?
A
So
instead
using
plus
slash
I,
might
say
sum
equals
golems
or
slash,
and
there
are
a
couple
of
answers
to
that.
First
of
all,
with
the
focus
on
notation,
the
idea
is
that
you
shouldn't
need
that
I.
Think
that's
debatable,
but
that's
the
idea
like
because,
if
you
see
plus
slash,
you
immediately
know
that
that
means
some,
unlike
when
I
was
doing
the
APL
earlier.
I,
don't
really
understand
the
APL,
but
I
know
immediately
that
that
means
some,
because
it
means
some
in
APL.
It
means
some
in
K
and
it
means
some
in
J.
A
The
other
reason
is
that
actually
impacts
performance,
so
you
can
create
a
table
with
a
million
random
numbers.
So
if
I
was
on
both
thousand
table
with
a
million
random
numbers
between
1
and
0
using
this-
and
this
looks
quite
complicated,
but
it
will
it
just
takes
a
sentence
as
a
string
and
it
will
tell
you
the
time
and
space
usage
of
that
string.
A
So
if
you
want
to
sum
the
table,
you
can
do
plus
/
+
/
or
you
can
do
this,
which
is
+
/
composed
with
comma,
which
just
means
like
unravel.
Oh
I,
think
it
means
Ravel
because
rather
than
unravel,
mean
the
same
thing,
but
like
basically
means
like
flatten
out
that
table.
So
some
of
the
flatten
table
is
what
you
can
read
this
as
and
again
feel
free
to
try
this
out
locally
and
but
if
you
do
it
using
the
initial
like
just
the
standard
vocabulary,
it's
faster
and
uses
less
space.
Then
it
is.
A
A
The
other
thing
here
is
this
F
dots
adverb.
So
what
this
can
do
is
this
can
take
our
names
and
it's
called
fix.
It
converts
them
into
like
the
canonical
form.
So
if
you
want
to
build
up
something,
you
know
just
sort
of
exploring
and
then
like
get
it
back
into
like
what
it
would
be,
if
you
hadn't
used
your
own
names,
you
can
use
that
and
you
can
see
here
that
with
the
fixed
version,
it's
basically
the
same
speed.
A
It's
actually
slightly
faster,
but
that's
probably
a
measurement
error
does
use
a
lot
more
space
again.
If
you
tried
this
out
locally
just
with
without
the
C
on
the
end,
the
space
is
mostly
used
in
actually
figuring
out
what
the
sentence
is
rather
than
summing
things,
so
it
takes
more
sense,
more
space
to
some
story
to
fix
that
sentence
into
like
canonical
form.
Then
it
does
to
some
the
items
in
the
list.
A
A
And
yeah,
that's
all
I've
got
the
next.
Two
slides
are
just
a
bunch
of
links.
If
you
want
to
learn
more
stuff
and
there's
a
bunch
of
J
stuff
there
and
then
some
case
stuff,
then
there's
a
site
NSL
comm,
which
stands
for
those
thinking
loops.
The
idea
is
that,
like
when
you're
programming
with
arrays,
you
shouldn't
need
explicit
loops,
you
should
yeah.
B
B
A
A
A
One
thing,
I
found
quite
fun
last
year,
was
sort
of
going
through
admin
encoded
in
this,
because
advent
of
code
was
basically
last
year
was
late.
There
was
some
problems
that
were
working
on
this
in
code,
machine
that
they
defined
and
they
were
like
every
second
day
and
then
the
problems.
The
other
days
were
like
all,
basically
perfect.
For
array
programming.