00:00:10.440
good morning that was a very sweet introduction thank you
00:00:17.880
um can we switch across ah perfect you'll notice I changed the word
00:00:23.800
limerance because nobody knew what it meant
00:00:30.160
an just in case you want to know is that kind of stage of courtship of of where
00:00:39.640
you really really really fancy somebody else and you really really want them to
00:00:45.559
fancy you so it's the kind of predatory part of
00:00:50.920
courtship um so it's like infatuation but more dangerous so
00:00:58.640
anyway so I don't know about you I go to a fair number of conferences I think this
00:01:05.640
conference has had the highest percentage of really killer talks of any
00:01:21.119
to uh so I mean just thank thank you guys it's been it's been a blasted so
00:01:26.799
I'll come back if I'm invited um all right so let's see if we can get this to work yay why do I want to talk about
00:01:34.799
this well there's a couple of reasons firstly the languages we use are our
00:01:42.560
tools and I mean obviously that used to say tools maketh the man but you can't
00:01:48.759
say that anymore so I had tools maketh the person but then that kind of
00:01:54.759
excluded um bo uh Bonos and certain cids like crows
00:02:00.439
and uh octopus and I couldn't remember if octopus was seph seapods or not so I
00:02:06.039
just changed it to user um but tools affect what you do floro said we become
00:02:12.879
tools of our tools which is a little bit scary
00:02:19.800
and the language we use is actually the language it actually affects us it
00:02:25.239
affects us a lot there's another reason I wanted to
00:02:30.760
do this recently um I've been kind of getting unhappy with the state of the
00:02:39.400
way I think about programming that's a weird thing to say I I am moving away from objectoriented
00:02:47.959
programming because I think we're using it wrong but I'm not 100% sure I know
00:02:53.560
why I think we're using it wrong so I was sitting there trying to analyze why
00:02:59.159
do I have this feeling right what is it makes me think this and I realized that
00:03:05.040
it's actually an accumulation of all of the languages
00:03:11.519
that I've been using and things that they have told me as I was developing as
00:03:17.799
a developer so as kind of an Indulgence to
00:03:24.319
me I thought I'd like to go through and actually have a look at some of those languages and explain why why they make
00:03:31.200
a difference to me I'm not trying to sell you on languages I'm not trying to sell you on my point of view right this
00:03:38.000
is purely me being like selfish and just talking about me for a while um however
00:03:45.439
I do think there's a message here and we'll get to that a bit later on the other reason I want to do this is I
00:03:52.239
really want to say thank you thank you to an environment which has let me play
00:04:00.079
for so long so without any Ado I have a list here of just a sampling of
00:04:07.000
languages and the impact that they had on
00:04:12.760
me matter of AC oh let's go back so we're going to go back in time oh
00:04:19.799
whoa that's don't stand close to that and look at it oh we're going to go back in time to 1972 matter of Interest how
00:04:27.960
many people were born in you know before 1 2 3 4 yeah five excellent
00:04:36.280
okay that makes me feel young um 1972 I
00:04:41.639
was in secondary school in England and uh it was the end of the summer term and
00:04:49.000
they'd run out of content for me so they sent me across the road to the local Technical College who were just
00:04:55.000
experimenting with a course on programming so I did I had nothing else to do so I
00:05:01.800
went across the road I was going to be a mathematician um and uh that was pretty
00:05:08.000
set you know I was doing all math aels and this kind of stuff I went across the road and sat in this little Hut and
00:05:15.919
started programming now let me just give you a bit of History here tell you how I started programming I started using basic which
00:05:24.000
as you all know stands for beginners allpurpose symbolic instruction code
00:05:30.160
whoa I know and we were coding in an incredibly
00:05:36.199
sophisticated IDE which was an ASR 33
00:05:42.319
teletype it was offline because it was expensive to be dialed into a computer
00:05:48.600
so you prepare your programs by punching them onto paper
00:05:53.800
tape and you do that offline and type type type type once you
00:05:59.280
were ready ready you picked up a telephone and you dialed the computer's
00:06:07.240
modem and then you took the handset and stuck it into that thing over there which is called an acoustic coupler
00:06:13.639
that's a modem and the two computers would whistle back and forth at each other
00:06:18.680
until they were talking you would then take the paper tape and you would feed it into the reader on the ASL 33 and
00:06:27.400
that would then send you a program up to the Mainframe which in this case was an
00:06:33.039
i ICL 1904a and it would look at your program laugh and send back all the error
00:06:40.199
messages just just for your edification we were
00:06:45.759
starting off using 110 board 110 bits per second so little quiz to get you
00:06:53.199
warmed up you using 110 board
00:06:58.360
connection and and you want to transfer a
00:07:04.960
gigabyte how long is it going to take you okay show of hands how long how many
00:07:10.000
people think this going take maybe about a day five
00:07:19.280
days two no no let's not do uh a
00:07:24.599
month one year
00:07:32.599
105 days so you know it's you're in the right order of magnitude
00:07:39.680
there yeah it was not the speediest way of developing code it is not really the environment expect to fall in
00:07:47.599
love but as everybody does in basic this is the equivalent of hello world it's
00:07:53.800
hello me and I fell in love
00:08:00.280
and I totally changed what I was going to do for the rest of my life and I still don't know quite
00:08:08.440
why but I think it's because I found a way of expressing
00:08:14.159
myself I found a way of making my
00:08:19.280
thoughts more concrete I'm not an artist I can't draw
00:08:24.319
I can't play an instrument so this was actually for me a really enabling
00:08:32.800
technology so it is fair to say that the basic
00:08:38.399
programming language is the most influential language in my life because it changed
00:08:45.200
my life did I use it going forward hell
00:08:50.959
no um I went to college um I once once I
00:08:56.880
discovered this I looked around there weren't many places in the UK UK at the time offering computer science U but
00:09:02.680
Imperial College had just started a course the previous year so I went along
00:09:08.000
and joined that it was incredible because these people had no idea what
00:09:14.079
they were doing it was the very because I was in the second cohort to go through
00:09:21.680
and they didn't know how to teach computer science and that was great because they experimented on this they
00:09:27.600
tried all sorts of things and so we got to play with all sorts of things our
00:09:32.880
primary programming language was Pascal but we tried probably I would
00:09:38.040
guess we probably did over a dozen different languages during those three years one of the most significant ones
00:09:44.279
for me was a language called simil similar 67 the' 67 actually means 1967
00:09:52.519
which is when the first version was produced
00:09:58.120
similar in many ways would be considered an advanced language
00:10:04.240
today it's widely held to be the first oo language but that wasn't really its
00:10:09.519
purpose but it was it was just kind of incidental similar was designed to help
00:10:15.519
people write discrete event simulations that's when you have entities that have
00:10:21.279
to move through a system and they cue for resources and then move on to the next resource and the next one and the
00:10:26.600
next one and they had a problem they need to be able to get data and code
00:10:32.279
like lumped together and so they said what should we do I know we'll invent an entire new paragram programming object
00:10:39.160
orientation and so this is a similar
00:10:44.200
program
00:10:50.720
hello there we go so that's a that's a base class you'll notice it actually
00:10:56.320
just says class animal it's got a slightly funky Syntax for the virtual
00:11:01.720
procedure there because you can rename procedures as you make them virtual but that's a virtual procedure which means
00:11:07.399
this is a base class you can't instantiate it directly here is a a
00:11:13.680
subass notice that they do something which we don't do and it's this is better they prefix it with the name of
00:11:21.760
the parent class not suffix it because when you think about it that's like a type declaration
00:11:30.200
right our class cat is of type animal it makes a lot more sense that way around
00:11:36.760
anyway and we implement the virtual uh function in there and then we do the same thing down here for
00:11:45.800
dog if we want to run that code this is a bit funky and uh pets is
00:11:53.040
an array indexed from one to three of references to an animal
00:11:59.839
so similar you explicitly say whether something's a reference or not and then the somewhat phallic
00:12:07.200
operator in the middle there is the assign of reference operator so we
00:12:13.279
create three objects notice we're using New Right add a couple of parentheses
00:12:20.480
this could be any language you use today from Ruby where it be Don and then we just iterate through it
00:12:27.680
and make our pets speak and out it
00:12:33.440
comes similar that's really irrelevant to simul is such a profoundly deep
00:12:39.639
language it has so many things that we cannot do today built into it you can
00:12:45.800
choose how your object construction goes you can basically wrap Constructors in all sorts of weird ways which is
00:12:52.440
incredible classes the implementation of classes is fantastic a class is a
00:12:58.600
closure over its instance methods and that's how
00:13:04.560
they share instance variables really elegant really really
00:13:10.839
elegant um it's got co- routining built in which is really
00:13:16.240
nice um type inspection compile time and runtime and it's got a very interesting
00:13:23.120
um well it's not just inheritance it's how initialization takes place it's it's a it's a very interesting
00:13:29.639
language so for me simula opened my
00:13:36.000
eyes excuse me it opened my eyes to a totally different way of thinking about
00:13:41.399
programming up until then I've been doing procedural programming in Pascal
00:13:46.560
and portran and all those kind of languages and now suddenly I came across a brand new way of organizing my
00:13:53.040
thoughts the idea of having state that is local inside an object the idea of
00:13:59.240
the state and the actions being tied together I mean that's really cool the fact you can actually explicitly make
00:14:06.079
your abstraction and create hierarchies of abstraction was really neat and then
00:14:11.279
lastly because it is simulation language it's actually event Loop driven just
00:14:16.519
like say JavaScript is so this language was way ahead of its time and it really
00:14:23.360
profoundly changed me and the way I programmed going forward and even then when I was writing
00:14:30.120
you know more procedural languages I would tend to do it with one eye on simul and the way simul would do
00:14:40.279
things so one of my goals here is to use languages or to come up with at least
00:14:45.399
one or two languages that Matts hasn't heard of um so have you heard of Apt yay
00:14:53.920
success I can go home all right apt with said they tried all sorts
00:15:01.079
of uh experiments on us one of them was they uh had a professor whose specialty
00:15:09.199
was machine tooling and uh we went and we did a
00:15:15.240
semester learning how to program big CNC machines you know the
00:15:20.519
ones that cut out large chunks of metal and back then they were programmed using
00:15:25.680
paper tape and uh there was like a lowlevel set of instructions of paper tape there
00:15:31.399
was a compiler that would produce those lowlevel instructions one of those compilers was called apt I have no idea
00:15:37.480
what it stands for so let's imagine we wanted to cut out that
00:15:45.519
piece what we would start by doing is defining we'd write an app program and
00:15:50.680
we'd start off by defining a geometry so we would say okay let's have a point called P1 at 50/50 and another
00:15:59.240
Point called P2 at minus 50 minus 50 so far so good this is where it gets fun L1
00:16:06.839
is a line that passes through P1 parallel to the Y
00:16:15.240
AIS L2 is a line that goes through P2 perpendicular to
00:16:22.319
L1 is that getting cool line three is the same kind of
00:16:29.680
thing parallel to line one and then line four again is perpendicular to line one
00:16:34.800
so we Define all our geometry in terms of other things we create two circles
00:16:40.800
and they are bounded by uh L was it L1
00:16:45.920
L2 and L2 L3 L4 remember we're doing CN C so we have
00:16:54.319
a z axis as well Z axis and we're defining two planes one of the material
00:17:01.839
and the other which is the embedded into the material plane and then the scary
00:17:07.919
part is we actually tell the machine to move so we tell the machine to load up
00:17:13.079
tool one with cutter number 20 the spindle speed is 3,000 RPM clockwise
00:17:19.120
Direction please and we're going to go to the start point and we are at
00:17:25.280
7070 and rapidly we're going to go to L1 and then down to plane two so we come
00:17:32.160
across the surface then dig down into plane two so at that point we have our
00:17:37.640
little cutter head there it comes to here and now it's going to follow these
00:17:43.799
instructions and cut out our
00:17:52.799
shape and it handles all of the geometry
00:17:57.960
required to to make sure that what I've defined here is the outer side of the thing and so it makes in the appropriate
00:18:05.440
places and that's really cool really really
00:18:15.080
cool uh apt was first created in
00:18:20.520
1956 um and it is actually still used today which is incredible I suspect it
00:18:25.600
looks a little bit different for me apt was again an eye opener first of all
00:18:33.000
it was the first genuinely domain specific language I used you could argue
00:18:38.280
that similar was kind of a domain specific language or simulation but apt really was you know I'm a machine tool
00:18:45.159
and that's what I'm going to be able to do it was also the first time I had used
00:18:51.280
constraint-based programming this idea of here's a line that goes through this point perpendicular to this thing that
00:18:58.280
was really cool because suddenly I realized I didn't actually have to tell
00:19:03.320
the computer how to do something but instead I could tell it what I wanted to
00:19:09.640
happen and that was wow that's cool and most cool of all I got to play
00:19:17.520
with a massive big scary industrial milling machine uh which spray a lot of oil I
00:19:26.679
can tell you all right so that was my college days
00:19:33.159
mostly um I started a PhD program and I gave it up because to be honest with you
00:19:39.520
I wasn't convinced I was having fun and I went and joined a um nowadays you call
00:19:45.480
it a uh startup back then it was a sweat shop um and the first projects we took
00:19:53.640
were mostly on PDP 11s
00:20:00.559
that is what a pdp11 processor an 1170 looks like it's a classic classic
00:20:07.600
computer it's got switches that toggle up and down and lights that flash and it's just cool even cooler is the fact
00:20:15.039
I've got that in my office it's not actually a pdp11 it's actually a 2/3
00:20:21.480
size um Recreation of a
00:20:26.880
pdp1 and it works it actually has all the little toggle
00:20:32.720
switches work all the little leads work it even has a key lock on it so you can you know stop people playing with it
00:20:39.640
inside it is a Raspberry Pi that runs a uh PDP 1170 emulator including
00:20:47.440
everything the io the memory management everything else ironically they had to
00:20:52.799
slow it down because it ran too fast but anyway that's a pdpl
00:21:01.120
11 it is a 16-bit uh computer with an 8bit bite and
00:21:07.440
you have to say that because not all computers were 8bit bytes back then it had 64k of directly accessible memory of
00:21:14.600
which 56k was usable eight registers two
00:21:19.640
of them had special purpose the rest were for you uh memory mapped IO so
00:21:25.240
there were no IO instructions you did IO by writing to certain Reg registers in memory and it was probably the most
00:21:32.559
popular microcomputer of the' 70s and to my mind it has the most
00:21:40.360
elegant architecture of any machine ever produced I could do an entire day on the
00:21:49.520
pdp1 but I'm not going to don't worry one of the things that is stunning
00:21:56.440
about the pdp11 is you're writing in assembler you're telling it individual machine instructions what to do and yet
00:22:04.480
the code you write can be as compact as it would have been in C or any other
00:22:10.120
language so here's a function or a sub routine that uh decides whether or not a
00:22:16.240
string is a paland Drome um we start off we have the
00:22:22.000
registers right are just things we can use for Scratch values they can point to memory they can have values in them so
00:22:28.520
on Entry register zero points to the string that we want to find out is a
00:22:33.640
palum that first little chunk of three lines there finds the end of the string and at the end of it R1 is pointing one
00:22:41.039
character past the end of the string so now what we're going to do is we're going to go through the string looking
00:22:46.960
at successive characters one at the start one at the end if they're the same
00:22:52.480
we're going to add one to the start to subtract one from the end and do the comparison again until our poin is Miss
00:22:58.559
meet and if they meet then it's pandrum but the amazing
00:23:04.880
thing is that little instruction there cmpb compare compare
00:23:14.640
bite most instructions that reference values in the pdp1 can reference them in
00:23:20.679
seven different ways including I want the value in that register I want the
00:23:25.840
value at the memory location pointed to by that register what this guy's doing is saying my first to find my first
00:23:33.799
operand go to the bite pointed to by r0 load it into the oper round and now
00:23:40.279
increment r0 now next one I'm going to go and look
00:23:46.960
in uh the memory reference by R1 but before I do it I want to decrement R1 so
00:23:52.640
I'm going to pre-decrement it then go fetch it so I've now loaded the two bytes and move those registers toward
00:23:59.720
each other one by to each end and I did that in one
00:24:07.360
instruction if they are not equal then it's not a palindrome and we exit
00:24:12.919
otherwise if the pointers have met then we're done and it is a pound Drome and
00:24:18.960
will we just try again just to show you how influential
00:24:24.640
pdp1 was if you're a c programmer
00:24:29.840
you'll recognize something like this right and if you ignore the kind of nambi pambi you know sort of wussy
00:24:37.039
version of C called C++ and go back to the real C right tell me hello what is
00:24:43.840
hello there somebody knows I know mattz knows
00:24:50.080
because he's a c programmer it's a
00:24:55.799
sorry it's a point you to the first car of
00:25:01.399
what yeah it's a Memory it's a string and it's just a sequence of characters
00:25:07.640
but in C the convention is a string ends with a null bite with a bite of zeros
00:25:14.240
and that way you don't have to encode the length in a string I don't know but I have a theory
00:25:20.799
that that's because of the pdp1 which was very big at Bell Labs at the time so the code that equivalent to this
00:25:29.159
is I'm going to move um the location of the buffer into R zero the location of greet into R1 and call string copy okay
00:25:37.200
so far so good string copy in pdp11
00:25:42.320
assembler is effectively two instructions we just move a bite
00:25:50.720
reference by oh oh that should be r0 and R1 sorry but move a a bite from there to
00:25:56.679
there increment both registers if the bite we moved was Zero stop
00:26:02.080
otherwise go around and do it again like I say it is incredibly
00:26:08.559
elegant but on top of that it was such an
00:26:14.480
education because when they arrive they you have to plug things into
00:26:19.640
them you have to plug the peripherals in you have to wire wrap connectors to configure things you get very familiar
00:26:26.360
and very comfortable messing around with with hardware and diagnosing Hardware problems um and the fact that you're
00:26:34.200
writing an assembler means that you really have to understand the code that you're you're doing so I actually was
00:26:41.360
forced to think really hard about the algorithms I was using and you know how
00:26:46.600
to make them work efficiently in a very limited environment and as a result of that you
00:26:52.960
actually get pretty good at performance and anticipating what performance is going to be like
00:27:01.080
okay next remember these are just languages
00:27:06.200
that kind of like maybe go o prologue how many people have played
00:27:12.440
with Pro prologue oh my word fantastic was that at school or was that in your
00:27:18.840
job at school yeah okay so prologue is a really weird
00:27:24.399
language in that it is really really cool and nobody really uses it
00:27:30.120
um prologue is designed to uh explore
00:27:36.600
logical programs so one of the things it has is facts and a fact is simply an
00:27:44.840
assertion um the names are totally irrelevant they're just symbols so I'm saying that Paris is a city and Rome is
00:27:52.600
a city and I can have multiple atoms they're called uh in one of these
00:27:59.200
assertions so I can say um the capital of France is
00:28:06.320
Paris then you can make queries on those so I can
00:28:12.519
say is Rome a city and what you're actually doing is challenging
00:28:18.440
prog effectively to find the opposite of that if it can prove that that's not
00:28:25.039
true then it can say no otherwise it says yes probably true now in this case yeah it's a known fact Rome is a
00:28:32.720
city I can take it further I can use variables is X a city so prologue says
00:28:40.039
well I'm going to have to work out what values I can give X to make this true and it'll say oh if x is Paris then
00:28:48.080
yeah this is true but it doesn't stop there and it says also oh by the way if
00:28:53.720
x is wrong then it's also true
00:29:00.840
I don't have to supply all or no parameters so here I can say the capital
00:29:06.279
of uh bah is C which is a variable so it's going to have to go and search and it'll
00:29:12.200
find that Saro satisfies that condition I can do it the other way
00:29:19.039
around right what country has Sara as a capital it tells me or I can just go Hog
00:29:26.960
Wild and say you know are there x's and y's such that X has a capital Y and
00:29:33.919
it'll report all of them so on its own that's kind of cool but
00:29:39.039
useless but then you take it a step further and you add rules and a rule looks like
00:29:46.200
this so this is effectively well no it's a rule so part one of this rule says
00:29:52.840
that a is bigger than b so bigger than is my rule if a is bigger than b that's
00:30:01.279
this one over here so if it's immediately bigger than then it's bigger
00:30:06.360
than and then we have a recursive step that says a is bigger than b if a is
00:30:12.880
bigger than some other value C and C is bigger than
00:30:18.159
b and it goes through and it works it all out now if you are an erlang
00:30:26.399
programmer this is going to look really familiar the syntax right we call these
00:30:31.799
things atoms we have full stops at the end of
00:30:37.679
Clauses this thing in um uh prologue is called a
00:30:44.320
reduction because we're basically taking facts and reducing them down a
00:30:49.799
bit all of these things made their way into earling because Joe Armstrong Les
00:30:59.200
was a really big fan of prologue and in fact the first version of erlang was actually parallel
00:31:06.120
prologue so he was attempting to program telephone exchanges using
00:31:12.399
prologue and they gave up I believe because it was it turned out to be slow and and um unpredictable but I may be
00:31:19.960
wrong about that so again it's all about me prologue
00:31:26.120
and me again was eye openening it was just so much fun to work out how I could
00:31:33.480
express stuff where I didn't actually have to tell the computer how to do the work I just have to set up a whole bunch
00:31:39.399
of relationships and let it do it for me is it efficient hell
00:31:45.840
no right you can it's depending on like the order in which you write some of the rules it can take a second or it can
00:31:52.159
take the lifetime of the universe to run the program but that's part of the joy it also got me really comfortable
00:31:59.159
with backtracking backtracking because obviously that's how it's doing what it's doing it's searching that space of
00:32:05.039
facts and if it finds a contradiction it has to go back up and try and search
00:32:11.000
again so prologue was a big language for me everyone's going to grow in the next
00:32:18.279
one sequel I possibly and the only human being on the planet who loves squel
00:32:28.080
oh I have a fellow deviant there oh two three okay let's all form a
00:32:35.720
club yeah look at that yeah SQL Anonymous or
00:32:41.240
something I think SQL is just
00:32:47.519
gorgeous um and to do this talk I was just thinking okay so how can I
00:32:52.600
illustrate some really really stupid Sequel and at the time I was looking at the pragmatic book bookshelf royalty
00:32:59.960
system and we have a part of the schema looks a bit like this so the skools of
00:33:05.919
the things we sell like a PDF of a book or paper book whatever else uh we have
00:33:13.480
uh a table that says for any particular order how much royalty they get off that
00:33:18.840
sco we have for every particular scho some fixed costs so like uh copy edit or
00:33:25.480
printing or whatever else is a fixed cost and then we have income and as income
00:33:31.679
arrives it's kind of accumulated over here and then once a month we run
00:33:37.240
actually a fairly small amount of code that goes through and for all of the new income assigns it to
00:33:44.919
particular people that's the royalty payments and that is currently maybe 100
00:33:51.919
150 lines of Ruby and I told okay what would happen if I tried to do it pure SQL
00:33:57.960
it turns out it's not too hard it's not the prettiest sequel in the
00:34:03.120
world but you can actually do the entire calculation and get the correct result
00:34:09.960
just using SQL admittedly there are three levels of
00:34:15.800
nested query but surprisingly it actually doesn't run
00:34:23.000
slowly I love that I just it just to me it's just so cool thinking in sets and
00:34:29.599
in terms of set operations is just kind of like a a new way of looking at
00:34:36.159
it so I would actually call SQL is a DSL
00:34:41.320
for set set manipulation and I really love
00:34:47.480
dsls it is declarative 90% of the time 99% of the time according to the slide
00:34:54.000
so I don't have to be telling it how to do something I tell it what I want done I describe to it the conditions that
00:35:01.520
will make me happy and then bless it it goes away and tries to make me happy and
00:35:08.480
who could want more the other thing I love about SQL is people constantly come and say so how
00:35:15.160
much money did we make of uh ebooks that went through Channel 27 in the month of
00:35:22.240
May and June right and I don't have the time to write like a nice G why for that
00:35:28.359
so I just slap a little bit of squel in and out comes the answer so it's nice that way we have
00:35:36.680
been I've been using SQL now for I don't know 30 years or so and we're still
00:35:44.440
friends all right one more matz wake up
00:35:49.960
pick do you know pick he knows pick damn all right pick came about um from
00:35:58.599
Bell Labs as so many good things did as part of their documenters workbench when they first developed Unix that needed a
00:36:05.040
way to describe apis and stuff you know that now as the man system you can type
00:36:10.480
man solar by something and it gives you information about that thing well the source that is used to describe that is
00:36:17.800
a format called enof and if you have a look at it it's got like commands that
00:36:22.960
start with a DOT and then text and everything else but the cool thing about end is like everything else in Unix you
00:36:29.960
can pipe things into it and so you can have a whole bunch of pre-processors which are separate programs and you feed
00:36:36.359
your original Source in one end and it goes through and it does all of the pre-processing and in the end you feed
00:36:42.119
it into enof and you get the picture it's all trough now so pick is one of these
00:36:47.680
pre-processors it draws pictures so a basic picture could look like
00:36:54.040
this box with label import an arrow box box labeled process and arrow box
00:36:59.160
labeled output all right you say mermaid can do that sure it can but it couldn't do it
00:37:05.079
in 1974 we can make it a little bit more
00:37:12.359
complicated a box right called the event stream uh a box with a corner radius of
00:37:17.760
0.1 finite State machine an arrow new state and then this is where it gets fun
00:37:24.240
Arrow sorry align with an arrow at both ends down from the last box which is
00:37:30.400
that second line there so we've now drawn the arrow down and it now knows
00:37:35.640
we're going down Direction box same actions means the same parameters as the
00:37:42.079
last box you drew so it's got the same border radius as that one we can take it
00:37:48.119
a little bit further I'll draw a spline it's going to be a dashed line
00:37:54.000
I'll get to chop in a second I want to go from the last Arrow which in normally by default means the center but I'm
00:38:01.119
going to go um from the center of the arrow up 7 across to the center of the
00:38:07.240
other Arrow but still up point 7 and then down to the arrow and then when I say chop it actually cuts the start and
00:38:14.160
end of the line short so I don't overwrite the
00:38:20.000
text and I can put colors and everything else into it as well it's a really sweet
00:38:25.960
little tool for drawing pictures pictures or it's a horrendous tool for
00:38:32.119
drawing pictures nowadays you'd probably do that in I don't know
00:38:38.800
what um but one of the nice things about this is It's a plain text
00:38:45.400
format so making changes to it Global changes is really easy and because it's
00:38:52.319
part of a pipeline you can pre-process stuff to generate pick and then generate your out output and we did that a lot uh
00:39:00.000
back when I had my own company I was doing documentation for clients we we had a set of standard pick macros you
00:39:06.480
can see you can actually find macros in it and we Ed those for drawing all sorts of diagrams and we just had a
00:39:12.800
pre-process is that then generated pick and then it went into
00:39:19.000
trough one of my favorite things with pick is I can draw a line between those
00:39:24.079
two boxes and then I can put a circle at one quarter of the way between the
00:39:29.960
start and the end and then I could have said a half but I just like the symmetry of two quarters and then three
00:39:36.520
quarters and that's kind of pragmatic that's the kind of thing you actually want to do when you're drawing pictures
00:39:42.480
so it's really nice and of course you can go
00:39:47.640
crazy this is a little bit of pick that just draw circles
00:39:59.359
all right so yet another DSL okay look at the circle look at the
00:40:06.920
Circle buy more books buy more books all right um it's
00:40:16.680
another DSL and it's another constraint-based language you may have noticed a patent
00:40:22.760
here if I can get the computer to do the work for me I'm really happy so it's containt based it integrates via
00:40:31.240
pipelines as opposed to apis which makes it infinitely more flexible to
00:40:38.119
use uh it's a really good example of do what I mean because 90% of the time you can say
00:40:44.920
draw a line from the first box to the third box and put a dot halfway between
00:40:50.040
them and it just works and I actually still use it not as
00:40:55.920
much as I used to but I still use it on occasion I'm getting towards the end
00:41:03.040
don't worry
00:41:09.079
xslt oh I have some fans yay
00:41:14.839
okay xslt um I came into through necessity so
00:41:21.400
at the pragmatic bookshelf we write our books nowadays in lockdown in the old
00:41:26.560
days it was in markup language called PML and it might you know literally a
00:41:33.319
book I mean it'll be like a a a hash chapter one at the top but apart from that you know a book could look like
00:41:39.800
that it wouldn't sell very many but we then um we give all of our
00:41:45.960
authors the tool chain so if they want to they can actually build all of their books locally um the only requirement is
00:41:52.079
you have Java installed because all of our tools are written in Ruby and they all run under J Ruby so if you have Java
00:41:59.079
installed it just runs so we start off with a pipeline huh just like trough
00:42:04.760
right we have independent processes that are just pre-processing all of our data
00:42:09.920
there's about a dozen of them in our tool chain that do various things to manipulate and it runs in parallel which
00:42:16.800
is kind of cool and the result is it produces an XML file and the XML file
00:42:22.880
kind of looks a little bit like HTML but it's got some special stuff that we need and then I had the problem I needed to
00:42:29.559
take that file and generate a nice looking PDF from it and the technology use to create PDFs
00:42:37.000
from XML is called fo formatting
00:42:42.359
objects formatting objects are ugly ugly as Sin um nobody wants to
00:42:49.359
be writing those by hand so I need is a technology that will translate one to the other and that's where xslt comes in
00:42:56.599
XSL T is a transformation language fundamentally for XML but it'll work
00:43:02.559
with plain text and stuff as well so I can take this feed it through
00:43:08.040
our xslt processor it produces that and then I feed that through something
00:43:13.359
called an f a formatting object processor and I actually end up with a
00:43:20.440
book and it's actually pretty easy um if you look at our um input and output here
00:43:29.119
let's just take a small part here that M uh enter that has to become fo colon
00:43:36.200
inline font style equals italic enter fo inline and to achieve that in xslt you
00:43:45.599
write a patent match they call it a template but really
00:43:51.400
it's a patent match and the patent match looks like this
00:43:57.920
this a template it's matching that is a effectively a CSS selector so that's
00:44:04.480
matching an EMP tag whenever it finds an M tag it's now
00:44:11.079
going to do whatever is in the body here if it doesn't start XSL colon it just outputs it to the Stream So we output fo
00:44:20.359
inline falic was italic and now we call ourselves recursively we call the entire
00:44:26.680
match recursively so if it was allowed by the syntax I could have an entire book in
00:44:34.319
that M tag and it would work and basically the thing that
00:44:41.440
generates our printed books from our XML files is couple of thousand lines of
00:44:50.839
xslt and it turns out to be really nice to maintain it's a really easy way to make
00:45:00.000
changes so xslt it's a functional language it's
00:45:05.839
immutable it works purely by transforming things in a functional way
00:45:11.079
it's also a DSL yay um it is it operates through the
00:45:16.680
recursive application of Transformations and as we'll see in a minute that's a big
00:45:22.760
deal it is ugly but it's powerful and to be honest with you I can live with ugly
00:45:29.079
if it does what I need interestingly it's also built into every browser you've
00:45:34.880
got so should you ever find yourself and it works with HTML so should you ever
00:45:40.280
find yourself needing to do some weird transformation on HML HTML is being sent down from the server you can actually do
00:45:47.119
it in browser very very simply using xslt and I think
00:45:54.440
xslt was probably for me the thing that most completed my kind of
00:46:01.640
transformation from an O programmer into a transform things
00:46:10.040
programmer but we're talking about languages that really influence me um and there are a few
00:46:16.640
more you may have heard of this one uh I'm not going to tell you all
00:46:22.920
about the features of Ruby because you probably know more than I do about them
00:46:29.119
so I'm going to go straight to the Ruby and me slide I think the first major thing
00:46:36.599
about Ruby is it works the way I think or possibly Ruby has trained me to
00:46:45.280
think the way I should to use Ruby I'm not too sure which but I don't
00:46:51.559
care and Ruby makes me feel good when I get
00:46:57.359
done and that's nice because I have to get the work done and I've been using Ruby now since
00:47:06.400
1998 which I think was that 6 I can't remember 04 you're right
00:47:14.760
point4 and you know what I actually have some original code there and it still
00:47:20.119
runs which is I can't think of another environment with a section maybe of C
00:47:25.480
where that would be true and that's 100% down to this gentleman
00:47:34.400
now am I
00:47:39.720
running all right now so Ruby is my my
00:47:44.760
my love I guess Ruby is the language I keep coming back to that doesn't mean I don't every now and then go out and have
00:47:51.319
aairs um so I like elixir a
00:47:59.480
lot Elixir has some things which I think are incredibly elegant it has pipelines
00:48:05.559
so it takes the value on the left hand side of the pipeline and feeds it into the function on the right hand side as
00:48:11.480
the first parameter that's very nice it means I can express Transformations
00:48:16.680
remember I like Transformations um it has macros in fact
00:48:22.040
in uh Elixir almost all of the built-in control structure don't actually exist
00:48:28.319
in the syntax if statements and things like that are not syntactic elements
00:48:33.680
they're actually function calls using macros and that means that the case
00:48:39.400
statement here normally you would write case some expression do and then your
00:48:45.119
matches but if I put it in a pipeline then the first parameter which is the
00:48:50.640
expression gets passed in from the previous operation so it just integrates beautifully into my pipeline like that
00:48:58.720
and it runs on the beam which means I get a whole bunch of you know decent performance high up time code that runs
00:49:05.319
a distributed environment so for me Elixir showed me
00:49:11.200
eye openening macros and the power of immutability and
00:49:19.640
pipelines so I talk about love each of these languages as it says
00:49:25.799
has at some point captivated me and
00:49:31.480
has changed the way I think I've adapted to them and every now and then they've
00:49:37.240
adapted to me and I also have this thing where I
00:49:44.000
will have temporary infatuations in fact I'm encouraging myself to have that I go out and I try
00:49:49.720
and look for languages and just play with them and see what I think if I'm
00:49:54.839
still interested at the end of the day I'll play a bit more otherwise I'll just move on that's how I found Ruby Ruby was
00:50:01.640
a download on a uset group ask your parents um which uh it came I think it's
00:50:08.440
like 15 separate parts that you had to combine together and then unar and then
00:50:14.200
build and I did that and I pretty much it was a bit like basic actually the
00:50:20.680
first time I redefined plus I went ah this is my language
00:50:28.400
just really quickly my current infatuation is a language called
00:50:34.160
Unison Unison is a purely functional language
00:50:39.280
it has strict typing um immutable code immutable code I'll come back to that in a second um
00:50:46.839
its state is managed in many languages you use monads to handle this in uh
00:50:52.319
Unison you have abilities which other languages called effects or algebraic
00:50:58.480
effects um in unison adding something like distributed code or Distributing an
00:51:04.880
algorithm is simply a question of adding an effect to it and it's all handled for
00:51:12.599
you so here's a little simple bit of using Code it doubles a
00:51:18.200
number and remember I talked about immutable code when you write source files like
00:51:24.920
this in unison Unison calls them scratch files because you delete them after You' finished instead what happens is you
00:51:32.280
take the code Unison is going to compile it and at some point in that process produce effectively an a now the as is a
00:51:39.839
data structure here's the thing you take a data structure and find a hash which it
00:51:46.160
does and then it says double is the
00:51:51.720
code that corresponds to that hash all right
00:51:57.079
right now we take this code and we store it up in the
00:52:02.880
cloud and it's content addressable it's accessed by hash and our program still thinks of it
00:52:10.000
in terms of double and we have a mapping from double to that hash so whenever I call Double I get that code but here's
00:52:17.559
the thing if someone comes along and changes double and makes it multiply by three it'll have a different hash so I
00:52:24.520
will still use that version of it so there's no
00:52:31.799
dependency checking there's no build tool required it just finds the right
00:52:37.000
version because that's all there is if somebody else writes a function called
00:52:42.040
times two it uses different variable names different function name but guess what
00:52:48.880
it's got the same hash and so in the cloud it's the same function
00:52:57.359
and in fact you can even search for functions by giving it the signature that you want and it'll come back and tell you oh someone's already written
00:53:05.920
that I talked about abilities well an ability in unison is basically an
00:53:11.880
annotation which causes it to wrap code in a kind of stateful wrapper so all I
00:53:18.880
need to do to make this um map ruce distributed is ADD remote as an ability
00:53:27.640
to that line I mean honestly it's a bit more complicated than that but not in
00:53:34.920
practice am I using Unison in production hell no but it's a blast to think about what
00:53:41.680
you can do with it for me it's had the highest density of new ideas of anything I've seen for a
00:53:48.599
long time and if you already got limited time I would strongly recommend Unison as being where you spend it I think
00:53:55.760
Unison gives some ideas about the future of programming and I'll talk about that in just a
00:54:01.599
second oh actually should I'll talk about it now what is the future of programming I'm glad you
00:54:09.839
asked I have been wanting to use the Shimmer effect ever since I started using keynote in fact you know
00:54:21.079
what okay I don't know but I have a theory I have a feeling
00:54:28.799
how many minutes two okay I've got 107 more
00:54:34.960
slides all right I think the future we're not going
00:54:40.720
to program the way we program now I think the future is going to be
00:54:45.880
producing clouds of functions think about the Unison model and throwing
00:54:51.240
functions into the cloud these functions will be invoked by
00:54:57.240
Patent matching in that way if you've ever looked at Blackboard systems like Linda
00:55:03.280
it's going to be similar to that our code is going to execute because it's the thing it does when it sees this
00:55:09.920
particular pattern of data come in take that data and throw it back out into
00:55:15.119
this big pool of data and then some other function is going to go oh I can handle that and eventually will all get
00:55:23.359
done state is obviously going to invol evolve in this system and it's going to evolve in maybe unpredictable
00:55:32.200
ways but that state change creates patent matching which keeps the process
00:55:39.079
going and we evolve it by uh evolving immutable code so the existing code
00:55:46.359
we've written is still going to be there it's still going to be referenced by people that wanted to use it but I can
00:55:51.839
change it in future and it will just pick it up the next time it has to get run
00:55:58.319
so this is my
00:56:04.400
journey I cannot emphasis emphasize enough how much I have benefited from
00:56:11.200
the work of others right my entire career has been
00:56:16.400
built on the shoulder the shoulders of people way smarter and probably way more dedicated
00:56:24.559
than I am and I am profoundly profoundly grateful
00:56:31.440
to all of those people I've tried to give back when I can but my contribution is nowhere close to what they have
00:56:38.799
done each of the languages I've talked about has changed the way I think they
00:56:44.119
have changed me as a person and each of them has brought me
00:56:50.839
some kind of joy and that's why I keep doing what I'm doing
00:56:57.480
and some of them like Ruby like basic have actually changed my life totally
00:57:04.200
it's gone in a totally different direction to the way I was expecting so that's my
00:57:11.520
journey the whole point of this entire thing is this
00:57:16.839
slide what's your journey are
00:57:21.960
you kind of I'm a Ruby programmer not that's what I
00:57:27.559
do or are you prepared to take the occasional risk and explore other things
00:57:34.760
it doesn't mean you're turning your back on your first love it's just bringing a bit of spice to the
00:57:42.520
arrangement yeah are you prepared to Look Backwards most of the things I
00:57:47.839
talked about here are at least 40 years old they implemented these things on
00:57:54.400
machines that I mean you can't get computers that small
00:58:00.960
nowadays right there's no comparison right the average cell phone probably has more computing power than
00:58:07.160
the entire planet had in 1970 right it's just not comparable and they managed to achieve
00:58:14.240
incredible things because they didn't have boundaries they didn't know how it was supposed to be so they just went out
00:58:21.760
there and made it up and 90% of it was crap but some of it was so so
00:58:29.280
good are you playing with the future I have a rule of three if some
00:58:34.440
technology comes across my screen three times over the space of two weeks I put it on a list and then I go and play with
00:58:42.079
it and that's how I found Ruby that's how I found almost everything I
00:58:47.319
use if you don't do that then there's a word for what you'll
00:58:53.319
become maintenance programmer don't do that and then last
00:59:01.880
thing are you having fun what you do is really
00:59:08.680
hard what you do take involves taking risks it's not easy so you deserve to
00:59:17.559
have fun are you having
00:59:23.880
fun if not make it
00:59:29.359
fun thank you