 Thank you very much. I'll quickly introduce myself. I'm Daniele Perotida. That's me. My favourite portrait of me. As you can see it says I am Python software. I work at Divio, a Swiss Django company and I'm a developer of Django CMS. I'm a core developer of the Django project and a member of the Django software foundation board. You can find me in the usual places online as evild MP on IRC and GitHub and Twitter and there's my email address there so feel free to contact me about anything. So firstly, thank you. Thank you for inviting me to be here, for being here to listen to me speak. Thank you especially to the organisers and volunteers of this conference because if you're enjoying yourself here it's because of them. I know how much work it is to run a conference and to run a conference of one and a half thousand or so people is a pretty big deal. Things will go wrong. If things go wrong it's not because they didn't care or didn't think, it's just because stuff happened. So if you see any of the volunteers or organisers just say to them personally, oh thanks by the way I'm enjoying the conference because I can tell you as somebody who has done this that actually it means a great deal. So thank you to those people who are making this happen. And of course to the sponsors who make it happen, make it possible financially, the speakers who have put a lot of time in and all the participants who have come here to get together. As I said I work on Django CMS. We're sponsoring so we are also very busy this week. We've got a Django CMS help desk on Thursday. We're doing a docker workshop on Friday and we're sponsoring so. I got all excited that this is a great marketing opportunity and the best that came up with is Django CMS, We're Around Your Neck. So I don't know maybe Twitter will come alive with... No I'm going to go into the office and get lots of congratulations from the team when that makes a big splash on Twitter because I think We're Around Your Neck actually works really well as a marketing thing. So I want to talk about mines and machines and python. I'll have a tiny amount of python code in this and it's not very impressive. This is Alan Turing, the great Alan Turing in a rare photograph of him smiling and in his paper Computing Machinery and Intelligence in 1950 he turned the question of whether machines can think onto its head. In fact he said the question can machines think is too meaningless to deserve discussion and instead of asking whether thought can occur inside a computer he wanted us to consider whether instead whether a machine could in principle be indistinguishable from a human in those respects that allow us to say a human thinks or has intelligence. So he turned the question about machine intelligence upside down and he was applying insights from the philosophy of mind that emerged in the early 20th century which also moved away, moved the questions of mind and intelligence away from a concern with the metaphysics of thought and the intrinsic nature of consciousness towards questions like what constitutes an interaction with intelligence or how do we recognize other minds. So in other words he was very much in line with or following the footsteps if that's the right word of thinkers like Gilbert Ryle or Ludwig Wittgenstein who argued the search for mind was not a search in a mysteries but a matter of recognizing what was in front of us all along. So we could say that this represents a kind of fork in the study of artificial intelligence and Turing's argument in a way freed researchers from having to clamber into these kind of opaque mysteries of what goes on inside of consciousness and thought and instead concentrate on producing for example interactions that seem like encounters with intelligence and that's been the dominant fork if you like in artificial intelligence since then and its fruits are all around us I mean literally in our pockets so you've got your phone you can say do I need to carry an umbrella today or what's happening what events are on in Bilbao this week and the power of machines to recognize stuff like languages, faces, text or road traffic or not if you're in a Tesla sometime and to respond appropriately has certainly taken me by surprise and I think it's taken many people by surprise just how good machines have become at doing this and by Turing's account I really do think that we're living at the beginning of an age of machine intelligence but what about that other fork that lonely a furrow which fewer people have worked on and we hear less about that people have been working there and have been trying to unpick these mysteries of thought itself so Turing was a very intelligent thinker but just because he dismissed something as too meaningless to deserve discussion doesn't necessarily mean that that is so here are two people who thought otherwise who disagreed with Turing Joseph Weisenbaum in computer intelligence research she was the author of Eliza, the program Eliza which was his attempt to demonstrate in a concrete way what was unsatisfactory about Turing's analysis or the philosopher John Sol so in this talk I want to go back to that fork because I also think that Turing's analysis however brilliant and powerful it was is a bit flawed and inadequate and I think that the incredible advances of the series and the chatbots and the self-driving cars as far as we're actually concerned with intelligence I think those represent a dead end so those things like Turing's approach begin from the outside not really I think concerned with the nature of intelligence itself but with the challenge of creating an appearance of it what does intelligence look like what does it feel to be in the presence of intelligence and in narrow limited spheres this appearance can be extremely successful and the more successful the appearance the more easily we fall into using the language of intelligence around that behaviour so forgetting that I mean some people might actually find this contentious but I think that we're dealing there with a simulacrum of intelligence that's really in the case of say Siri no or a Tesla car is no closer to consciousness than a stone and I think the more interesting question is the neglected one that begins from the inside that asks what lies at the heart of intelligence how and where does consciousness arise and as programmers I think we have the concepts and tools to investigate this in useful and interesting ways and I want to argue two things in this talk firstly that programming concepts give us the most that the programming concepts that give us the most interesting insights are in fact the most basic programming concepts and that we can find their counterparts in the work of artists, poets and writers and that this helps us understand so for this we'll turn to the concept of poesis a Greek word it's where the word poetry come from and it means to make or to produce and it doesn't mean making or production in the sense of manufacture think of French or Italian verbs like fare or fare which they mean at the same time make and do or think in English about the way we would say things like making friends or making love that's the kind of making perhaps that is involved in poesis Poesis is not concerned with material or technical construction but with rendering a transformation in the world an act through which or a process through which something new is brought forth in poesis something becomes another kind of thing altogether a new thing emerges out of something something that wasn't there before so poetry can be considered a kind of poesis and I think that programming also represents poesis and that poets and programmers because their work is poesis this kind of making can help us understand usefully some quite deep questions about ourselves and particularly about the nature of our human consciousness our thoughts or the mind straight into the work of programmers and artists programmers seem to be particularly fascinated by ruled governed play when they find it and they respond to it strongly especially in poetry and art for example and there are some poets and artists and writers whose work and ideas speak very strongly to programmers because of this and I think that there's something in programming no, I think there's something in the way that programmers think that make them especially ready to understand and appreciate the intersection of these things these work and ideas so there are certain things you know that a programmer is just going to get a certain idea or a certain work or something like that I think part of the answer is that ruled governed play takes place in systems which of course programmers are also very fascinated by and three other things that programmers love best in systems are interesting outside programming loops, self reference and hierarchies and these are also the things that make ruled governed play very interesting and of course there are also some of the most basic structures and concepts in programming itself ones that determine the way programming works so let's start with loops even the simplest loop represents power it doesn't matter how trivial it is you can still unleash something infinite and the computer will try to realise it so there are many constructs in computing this is kind of the most basic but also the most beautiful and powerful I love loops, all of them but still the fascination of go to 10 is quite limited the only thing interesting about that particular loop is that it's infinite not because of anything that comes out of it so that's not very interesting but when we apply loops to other things then they get more intriguing does anybody know or remember the website textarc.org I used to spend a lot of time there 15 years or so ago what it does, it loops over a text and represents it visually and I can't show it to you on a real website because it's so old that it's Java and I have to load a virtual machine running Internet Explorer to do that so I'll just have to show this is the text of Alice's adventures in Wonderland right round the edge and then the words in the middle are in their place depending on where and how many times they appear around the end so look, here's the word and therefore the character Alice in relation to the entire text or in relation to the story Alice is literally at the centre of the story of Alice's adventures in Wonderland here's the griffin so you can see a peripheral character here's a linear sequence through the actual text in Textarc go and find Textarc it's wonderful if you can get it working on your machine if you can find it working on a Macbook on a Macintosh tell me how because I'd love to get it working again so in Textarc we no longer have a sense of the content of the work but instead we get its structure exposed by a loop presented as metadata and structure metadata matter we've lost something, the content but we've gained something else because it lets us see new meaning that perhaps was previously obscured in the loop of Textarc we can see who is associated with whom or what we can see who appears when and with whom we can see who dominates the story and when I say see we literally visually can see it so don't be distracted that Textarc is amusing in literary what it does is powerful and significant a fact that's not lost on large corporations and governments who understand the power of this stuff too Google and Facebook know all about structure and metadata and right now in various countries governments are anxious to have legislation enacted that will help them look more closely at metadata data of course they'd never do anything like eavesdrop on their citizens because that would be wrong they just want to know some of the metadata surrounding those conversations so I don't know if you can see that from up there so storing metadata is not an invasion of privacy it's a tool that keeps America safe no one is listening to your calls congressman I see here last Friday you talked to your wife then immediately called an escort service then a hotel of course we don't know the content of those calls so that's your wife now so this stuff is powerful Microsoft I came across this by chance we use the cloud to visualise information so we can track down the criminals yeah I bet you do so on Textarc the first text you get is Hamlet it's not there by coincidence programmers and people who are doing stuff with language always go for Hamlet or Alice or Hamlet these are the two texts they always go for there's something special about these two texts here's Hamlet and here's Ulises Carrion he was a Mexican artist and I'm going to play you a part of his Hamlet for two voices so I've got to bend this down and we don't have direct audio so I'll just do this here Penado Penado Penado Penado Penado Horatio Marcellos Marcellos ok so I think this is hilarious I think this is very funny but I also think it's not just funny it's a new interpretation of Hamlet it's a Hamlet for two voices left and right it's the whole of Hamlet about 15 minutes like that without any content whatsoever all we have is the structure so what have we lost and what are we left with well it's true that you won't know from this that Hamlet is about revenge or murder or desire and you won't know that Hamlet is a prince or the story set in Denmark but there's still a lot to learn we know who's there at the beginning we know who's there at the end if you're there at the end and a Shakespeare tragedy that's a big deal you know not everybody gets to be at the end we can discover whom the story revolves around who dominates the conversations who hangs around with whom who answers whom so we've lost something we've deliberately thrown some information away but we've exposed perhaps some previously hidden information at the same time now when I play this to other people everyone at first says what is this and then it divides the world up into programmers and non-programmers because non-programmers say what's the point and they're baffled or even irritated and I've had people really annoyed by that but programmers love it now you may all be programmers if you didn't love that then maybe you just don't have the soul of a programmer because also some people who are not programmers love that so maybe they are non-programmers who have the soul of programmers but anyway the point is that programmers get this kind of thing they understand loops they understand what's important about metadata and they know how to recognise a key value pair when they see one so you know you show me some key value pairs and well I'll show you some code actually so let me quickly jump into here so I've got a little program a little python program and it just jumps onto the internet this is a very useful soup this is a very useful library for exploring structured texts like HTML it loops through the text drags things out in pairs and then passes them to the say command so I'm going to this is my little tribute to Ulysses, carry on Francisco Bernardo Francisco Francisco Horatio Marcellus Marcellus so computers are perfect tools for this kind of thing for the exploration, the analysis, the discovery of texts and language and if you're interested in doing that it's very easy and accessible stuff to do what could you discover with a simple program like text arc or something like this could you extract the punctuation from a text maybe and recognise the author by the punctuation or by the white space I spent a lot of time with a raspberry pie and an array of LEDs visualising the characters in the hamlet as kind of spiralling outward different coloured lights so it's fun to do even if you're a lousy programmer like me there's a massive amount of this stuff going on in the world of literature there's a whole field of experimental literature that analyses text synthesises them, deconstructs them there's the Ulipo, the Auvoire de Literature Potentielle the workshop of potential literature French mostly French writers, mathematicians and artists I don't really have time to talk too much about that but I recommend having a look at that and you don't have to go to experimental literature hear a couple of pages from Douglas Couplin's Microsurfs the vowels on one page and the consonants on the other and we can play endless games, fun games illuminating games with text like this and I'm talking about games and playing and some of it's fun but it's also serious because play doesn't just refer to having fun play means the looseness in a mechanical connection you say it has a lot of play in this connection when the connection is not tight the extent to which one side of a connection is free and undetermined by the other and play is only possible where you have a linkage where you have a connection, a constraint if there were no constraint at all then there would be nothing you wouldn't have any play, you just have no connection and on the other hand if the connection was so tight that it were lock solid there would be no play either so you only find it where there's a connection and where the joints permit some movement and the rules and connections in language are just open and enough and open and loose enough for both rigorous meaning and play within the same system which is quite remarkable and this kind of play is something that's enjoyed and exploited by artists and writers and programmers so we've seen some examples of looping in text art and Hamlet but this kind of play becomes even more interesting when the looping becomes self-referential so his Ulises carry on again with his first Spanish lesson I know some of you already know Spanish but let me play you his first Spanish lesson so this is Fiendish Espanol Espanol Espanol Si Espanol Es Espanol Si Es Espanol Es Espanol Espanol Si Es Espanol Es Espanol Es Es Espanol Espanol Si Es Es Espanol Es Espanol Es Si Es Espanol Espanol Sî, sî esespanol esespanol. Es, sî, esespanol esespanol? Sî, sî esespanol esespanol. Es, sî esespanol? No, sî esesno esespanol. Es, esesno esespanol esespanol? Sî, esesnol... Okay, so I mean, this is language about language. this is language looping over its own structures, recursing on itself, its language-eating language. And now, again, I have played this to people and I have watched people get angrier and angrier as this goes on, you know, definitely not people with the souls of programmers. And I had one person turn on me after a few minutes to say, this is a shit way to learn Spanish. So, er... I love this. Look up Ulises Carrion, bless him. He died young. This is so fascinating. Now usually when something consumes itself in this way, it reduces itself to nothingness. But in this case, something new, something other seems to be coming out. Something new and almost magical. Something slightly maddening about it. And it's a perfect example of playing with rules and processes. So it's a programmer. You know, it makes you itch a bit. In a way this is a program that follows its own internal logic, obeys its own rules. And it makes me think, you know, could we make a first Python lesson in the same way? And you know, we have the technology. We could get Python to consume itself and regenerate itself like this. But I got distracted by my Raspberry Pi and the colour LEDs. So I never really got much, much further than that. But, you know, maybe somebody's a... a better programmer and less easily distracted could come and talk to me about that. So it's kind of impossible magic when you make something eat itself. But it's a very old, a very ancient concept. So here's the uroboros, the snake that eats its own tail. And it's very important. It's chemists in their dreams. As you'll know, if you've studied chemistry. So Augusta Cicules had a dream of the snake eating its tail and provided him with the solution to the puzzle of the benzene molecule after many years of studying carbon-carbon bonding. It's an ancient symbol of renewal and regeneration in many cultures. And programmers as much as artists are fascinated by what happens when a self-reflecting process loops. And as programmers we're particularly lucky because we've got the perfect tools with which to explore it. And I've mentioned magic. It's a kind of impossible magic. But the magic is not just that a snake bites its own tail because any idiot dog can bite its own tail and not produce anything magical. The magic lies when something eats itself and then somehow sustains itself and then something new emerges, something that wasn't there before. And I think it happens in Ulises Carrion. Something new comes out of the loop that wasn't in it when we started. A new thing altogether. And this is the poesist that we're in search of. Or maybe I'm in search of. Here's another representation of the uroboros. This time back the artist MC Esher who's also fascinated by loops and self-reference. It's a woodblock print with some very interesting things going on. Where does this loop begin? Is it a loop? Well, is it one loop or is it several loops? Was there four bands going on? Is that five loops? Is it four loops? Is it one loop? It's looping on different levels. You have to choose the level at which you see it looping. You have to make a decision to hold in your mind when you look at it. There's a hierarchy of looping going on. And this is where things get really interesting. Here's Douglas Hofstadd. I think he's possibly one of the most interesting thinkers you could ever hope to read a book by. He's interested in hierarchies. In multiple tangled hierarchies of self-referential loops. His best known book is Gerdl Esher Bach. Which explores art, music, logic and consciousness. And it's an utterly remarkable book driven by this fascination with loops and self-reflecting processes. And he's in search of the ultimate in self-reflection which is our own human self-consciousness. Subjectivity itself. And the book itself loops and recurses and reflects itself at different levels in its own structure. And he's interested in what could emerge from this kind of process. And it's a work, a book whose humor and sense of aesthetics will appeal very naturally to programmers. Here's Hofstaddder's law. It always takes longer than you expect even when you take into account Hofstaddder's law. Programmers love this kind of stuff. So, we've talked about emergence where something new and unexpected comes out of a process at some other level. Hofstaddder's interested in these emergent properties of systems. An emergent property is one that arises in a system but can't be found in its components. So, sometimes the property might be geometrical order. These are rocks in a river where water erosion has produced this remarkable effect. You know, the rocks aren't shaped like that because of some structure of the rocks. It's an inter... It's nothing in the rocks that represents that structure. That's only an interaction between the rocks and the water. And the water doing something to the rocks and the rocks in turn doing something to the water. So, the rocks themselves don't have that structure at all. Another example might be an ant column where column organisation is nowhere to be found in the behaviour of individual ants. You know, you don't see ants doing that. You can't predict it and yet a column, a new system emerges that didn't exist before. Or in art, in the work of Bridget Riley where the procedure she follows align down a page and it produces through the natural free play of this activity something that's not in any of its components. Or Google's deep dream that uses iterated pattern searching and generation algorithms that starts to holes and crosses levels of hierarchy and new levels of significance emerge. Or evolution, natural selection in nature itself can be considered an emergent property, something that comes out of basic chemical or biological processes. And there are multiple levels of hierarchy in these systems. Other properties in nature themselves are the emergent features of evolution. So this property that came out in turn feeds back into the system. So there are numerous behaviours in nature whose explanations have been sought in emergence, like cooperative behaviour which is hard to explain sometimes. Why is there cooperation within or even between species when it would seem that at the level of individuals there's no such benefit. So this graph is from a python library, Axelrod Axelrod and it shows the successes over time of different strategies in a tournament of the iterated prisoners dilemma which was set up as a search for the secret of cooperation in evolution. First by Robert Axelrod who was a political scientist in the 1980 in the first tournament selfish strategies did poorly. You know the prison I don't have time to explain the prisoners dilemma but I think probably most programmers are aware look up the prisoners dilemma selfish strategies did poorly and last year my friend Vincent Knight at Cardiff University implemented this as a python library and it's you can play you can develop your own strategy and put it into the tournament it's been wildly successful and has reignited interesting in Axelrod and the prisoners dilemma very interesting so have a look at Axelrod so those are all examples of emergent properties of different kinds not all of them have anything to do with consciousness of course but Hofstadda argues that consciousness intelligence is an emergent property that arises from systems in the brain and we discussed loops first of all and the magic that seems to follow in loops becomes self-referential and something new springs out of them and then Hofstadda is also interested in hierarchy so that we have loops within loops and loops at different levels in the system and his thesis is that hierarchies of self-reflecting or self-similar loops that repeat themselves at different levels lie at the heart of cognition and consciousness that the brain's neurological processes are themselves based on loops and self-reference and logic and play consciousness he says it is an emergent property it doesn't exist in the neurons of the brain if you're intelligent it's not because you have really intelligent neurons you won't find intelligence or consciousness by looking in to the brain and looking more closely at its neurons if we're going to find something there it will be by studying the system what happens in and to and between its loops so this here we are again this is the impossible magic where something emerges reflects on itself feeds back into itself crossing these levels of hierarchy Hofstadda thinks that this is the origin of consciousness that self-refering hierarchies of loops lie at the secret of thinking of cognition in these merely physical processes in which absolutely no consciousness resides because they're merely physical processes consciousness belongs at a different dimension so could consciousness be a system that nourishes itself like the snake eating its tail apparently impossibly and Hofstadda thinks so in fact one of his later books is called I am a strange loop and the eye of our consciousness of subjectivity is this process of looping and self-refering across hierarchies so now we're talking about intelligence and programming in a very different way from the one that followed Turing we're talking in ways that I think do make it possible to ask meaningful questions about whether machines could think and it raises the possibility of an approach into cognition research and artificial intelligence that's quite unlike some of the ones we see at the moment that are premised maybe on big data and huge ontologies brute force is unkind but I'm an unkind person on vast computing power and instead we begin with the simplest of things like the simplest concepts and tools that we as programmers enjoy playing with play itself we enjoy playing with play with rules with poesys, with analogy making, with processes so this approach comes into the question of consciousness of intelligence as poesys as a process that is at the same time transformative that brings forth something new out of the world or into the world and I think it's very intellectually compelling and I think at the same time however philosophically profound it might be the opportunities for exploring it are right at the hand of even the most novice python programmer which is also a fascinating thing and it gives us a way into this quest that seems very rich and valuable and illuminating and rich for exploration especially by us, by programmers but it's more than that because I think it does something even more important it gives us a way to look for not just an insight into artificial intelligence but just into intelligence itself and I think the kind of posturing way of doing this doesn't give us any of those insights you know, I don't think that Microsoft, you know, Mike Tay the Microsoft Hitler-loving sex maniac chat bot on Twitter that I don't think that tells us anything about the nature of intelligence however clever it might be and the question of whether Hofstadder in the end is right or wrong, I don't think it's that important it doesn't matter whether he's on the right track about the nature of consciousness and cognition his ideas are so beautiful and powerful and compelling that we should wrestle with them anyway I think certainly more elegant than Tay or Siri or all these other things that people are doing very clever things with and my background is not in programming but in philosophy I've been wrestling with Hofstadder and these ideas for a long time so a long time and it's really wonderful it delights me that I'm happy it delights me that I'm able to be in the company of programmers who find this stuff because they've got the right souls they find this stuff so fascinating immediately and are also fascinated by the poets and writers and artists that fascinate me and these things that I've found in programming in a way it's come back in a circle for me because it's another pleasing circle or something going back to the beginning these philosophical questions that have been with me for decades so it's like a snake eating its tail again there are some references for you if you want to follow up any of these things I've got my Douglas Hofstadder in that bag it's just falling apart it's been with me for a long time and I'm very grateful to Douglas Hofstadder so I haven't really I haven't really taken you anywhere but I hope I've given you something to think about and I hope that somebody will come up to me who's a better programmer and give me some better code that I can maybe develop this talk in something that does a bit more Python and a little less talking so thank you very much I think we've got time for a few questions have we thank you I should say a colleague of mine had to wasn't able to come so I'm doing another talk in case you didn't get sick of hearing me already on Thursday on documentation driven development so please if you've got any questions I'm happy to talk to you now or later let's go here so I heard some critique of this sort of big data approach to building intelligent systems and perhaps you can say that you cannot really call them fully intelligent in the moment but imagine they succeeded and they made like a talking and thinking robot that you can have a conversation with I guess you would still say that this is just a simulation of intelligence so I wonder in your view what is the difference between a real intelligence and a simulated intelligence if Hofstadr is right we could have an artificial intelligence and I'm not sure that he is right but I'd be much more prepared to admit of a Hofstadr like artificial intelligence than one that is based on you know this as you say the brute force big data mining and machine learning because I don't think a simulation is good enough something that's artificial something that's a simulation just because something is artificial doesn't mean it's not real it just means that it's been made so we could have a real intelligence a real intelligence that's artificial but a real intelligence that's simulated it sounds like a contradiction in terms of it's merely a simulation however good it gets because what's going on I think the question of what's going on inside actually does matter or this is Turing's argument it just seems unsatisfactory to me we do care what's inside are there any questions? one could take even a more recursive point of view about that question that is we saw the the Spanish lesson the Spanish lesson basically points to the idea of an infinite string of Spanish, Spanish, Spanish you get what I mean the thing is that that concept exists linguistically still is infinite is like the fixed point of an infinite sequence so through language we can even represent that sort of thing fixed points of infinite sequences that sort of thing sometimes don't exist so we have signifiers without signified and the thing is that intelligence itself maybe is something without a signified also the first Spanish lesson I'm afraid is a bit of a trick it's not just folding entirely by itself there's actually the director the artist who makes it go in the right directions it's not simply putting a Spanish at the beginning of everything it's choosing the right things and it's playing with them for example the fact that some things are homophones in that the same sounds can be rendered differently so it can keep asking the question so it would actually be less interesting if it weren't directed so there is some energy going into that system from outside and that I think is if there's something wrong with Hofstadder that's probably where it lies Eddie Yeah we got time for one more question Hello and good talk Do you think that maybe neural nets combine the two approaches to artificial intelligence in neural nets have maybe this emergent feature to them which might be described as emergent conscience? I mean that seems to be very promising and interesting because they one of the things that we've learned from neural networks is that they sometimes do unexpected things and not just unexpected things that it was left instead of right but new orders of things sometimes where a neural network will have an answer or have a response that seems to have stepped out and be looking at the thing from a different level so that might be a very I don't know enough about neural networks actually to say anything that useful but what I've understood is that actually that is a promising possibility that is the kind of thing I think that might just be the start of the kind of thing and we'll find more surprising things still I'm sure we can take more questions offline but I have to cut you off here, thank you again Thank you very much