1 00:00:12,100 --> 00:00:19,120 >> Hello. Welcome back, everyone. We have Simon  Carryer, who's going to talk to us about syntax   2 00:00:19,120 --> 00:00:32,960 trees. I love syntax trees. I really do. Simon  Carryer is a data analyst in New Zealand. He works   3 00:00:32,960 --> 00:00:42,080 on other peoples' dumb ideas. This is his wording.  And his on dumb ideas on the weekend. Welcome,   4 00:00:42,080 --> 00:00:50,000 Simon. So great to have you. So great to have you. SIMON CARRYER: Hi, thank you very much. This talk   5 00:00:50,000 --> 00:00:58,000 will provide almost no education content  around ASTs. Please do not take this as   6 00:00:58,960 --> 00:01:06,240 informative at all. This is purely stupid  ideas in this talk. So, some context,   7 00:01:07,600 --> 00:01:15,040 I have kind of a brain problem, which is that  if I have a dumb idea, I have to make it real.   8 00:01:16,560 --> 00:01:19,840 I can't think about anything else  until it's done and that has led to   9 00:01:20,640 --> 00:01:28,000 several terrible things being created. I made  a website, which forces people to choose which   10 00:01:28,000 --> 00:01:34,320 kind of milk they'd rather drink between two  different mammals and then creates a ranking   11 00:01:35,120 --> 00:01:39,840 of those so people like lama milk,  but not rat milk, for example.   12 00:01:41,920 --> 00:01:48,000 I made a thing, which took my own, horrible  drawings and turned them into Bob Ross paintings.   13 00:01:51,520 --> 00:01:59,360 So that's the kind of thing that I like doing. But, this idea, that I'm going to talk to you   14 00:01:59,360 --> 00:02:09,040 about now, is probably the stupidest idea I've  ever had. For you to understand why that idea   15 00:02:09,040 --> 00:02:17,680 was so stupid, you'd probably need a little bit of  context. In particular, what is an AST? Well, it's   16 00:02:17,680 --> 00:02:26,640 an Abstract Syntax Tree. I learned about those, in  this talk, called Fantastic ASTs and Where to Find   17 00:02:26,640 --> 00:02:35,840 Them. You should check out that talk, which is  far more educational than this one is going to be.   18 00:02:38,560 --> 00:02:44,400 Imagine you've got a little bit of Python  code, like this, super simple, adding   19 00:02:45,440 --> 00:02:55,440 a couple of variables together. If you pass  that to Python's AST library and call it   20 00:02:55,440 --> 00:03:07,600 "pass method init string," it'll return a binary  option and on the left hand, it's taking "A" and   21 00:03:08,640 --> 00:03:15,680 a thing called "B" and it's adding them together.  Why is that a good thing to do? Why would you want   22 00:03:16,400 --> 00:03:25,120 to do that and what can you do with these things? Well, for a lot of smart reasons, but the key   23 00:03:25,120 --> 00:03:32,240 thing to understand about it is that it is  making a tree representation of your code.   24 00:03:32,240 --> 00:03:38,000 Right. It's turning into each of the  objects that are being acted on by the code,   25 00:03:38,000 --> 00:03:43,040 into a sort of node and then representing  their relationship to each other like a tree.   26 00:03:45,040 --> 00:03:51,520 And that lets you traverse that tree and  kind of understand what the code does without   27 00:03:52,400 --> 00:04:00,480 having to execute the code itself. And you can chain those things together to make   28 00:04:00,480 --> 00:04:08,800 really big, complex bits of code. So, here we're  taking A and B, adding them together, comparing it   29 00:04:09,440 --> 00:04:22,640 and passing that into a "if" to boolean. If A+B is  greater than 10, XY might be what this tree does.   30 00:04:25,200 --> 00:04:32,080 Why is that good? So, it tells you what your code  does without having to execute it. And people use   31 00:04:32,080 --> 00:04:40,800 it for all kinds of smart stuff. Automatic  testing, transpiling. Any time, in your IDE,   32 00:04:40,800 --> 00:04:44,720 when you're, like, writing code and it underlines  it in red and says, "oh, you made a mistake here,"   33 00:04:45,280 --> 00:04:55,840 it's probably using a AST for that. That's  not what I'm using it for in this talk.  34 00:04:56,400 --> 00:05:02,320 I guess the main thing that you should  take from this is that it represents the   35 00:05:02,960 --> 00:05:06,560 what your code does in a kind of tree like format.   36 00:05:09,440 --> 00:05:14,000 The other thing that you need to understand, for  context in this talk, is genetic programming.   37 00:05:16,640 --> 00:05:25,360 So, that's also really complicated. I'm not going  to go into it in too much detail. I learned most   38 00:05:25,360 --> 00:05:32,160 of what I know about genetic programming from  this library, JP Learn, from Trevor Stevens.   39 00:05:39,040 --> 00:05:42,560 You should check out that library if you're  not already familiar with it. It's very clever.   40 00:05:44,000 --> 00:05:49,840 Basically, the idea of genetic programming is  you've got a problem you want to solve. You write   41 00:05:50,800 --> 00:05:57,840 something that can measure how well a particular  solution has solved that problem and you generate   42 00:05:57,840 --> 00:06:05,040 random solutions to the problem and then  randomly re combine those solutions of multiple   43 00:06:05,040 --> 00:06:12,560 generations, keeping the fittest solutions in  each generation and eventually come up with a   44 00:06:14,720 --> 00:06:17,360 fittest possible solution  that solves your problem.  45 00:06:19,040 --> 00:06:24,560 And I guess the the key thing, to take from this,  is that the way one of the things that genetic   46 00:06:24,560 --> 00:06:33,840 programming does is it represents those solutions  as a kind of tree structure. Right. So, it using   47 00:06:34,480 --> 00:06:41,440 these it usually uses mathematical  operations and then it takes two solutions   48 00:06:41,440 --> 00:06:47,840 and mangles them together by taking a bit of each  of them and recombining them to a new solution.  49 00:06:51,120 --> 00:06:58,640 So that gives you the genesis of my stupid  idea. Given that you can represent code   50 00:06:59,440 --> 00:07:09,280 as a as a tree from an Abstract Syntax Tree,  and given that you can and genetic programming,   51 00:07:09,280 --> 00:07:16,400 they've shown you can make new solutions by  mangling together these tree structures. Can you   52 00:07:17,200 --> 00:07:25,040 write new code, in Python, by mangling the ASTs  together and get something that produces some   53 00:07:25,040 --> 00:07:31,440 kind of output? Can you make a function that is  the combination of two other functions that does   54 00:07:31,440 --> 00:07:36,800 something a bit like the both of them?  I wanted to play around with that idea.  55 00:07:39,120 --> 00:07:45,200 And to do that, I wanted to I needed to  have something that could write functions,   56 00:07:46,080 --> 00:07:50,560 where I could see the output of them and see  if the output of these two different functions   57 00:07:52,720 --> 00:07:59,680 of the new function was similar to these two  source functions and so I guess taking an idea for   58 00:08:00,240 --> 00:08:06,560 Mendelian genetics, which started with flowers,  I thought it would be cool to write functions   59 00:08:07,280 --> 00:08:14,480 that draw flowers so the first thing  I did was write kind of a harness,   60 00:08:14,480 --> 00:08:20,320 or code that would help me write  functions that would draw flowers.  61 00:08:22,240 --> 00:08:26,080 What I wanted to do was have really  simple flowers that could be generated   62 00:08:26,080 --> 00:08:31,520 by minimal functions. Because I knew I  would be writing really terrible code,   63 00:08:32,480 --> 00:08:40,240 I needed it to handle bad outputs  and have something kind of legible.   64 00:08:40,240 --> 00:08:48,000 So, 90s kids will understand, if you did any kind  of computer programming in school in the 90s, you   65 00:08:48,000 --> 00:08:55,040 probably played around with Logo. There's a little  turtle and you tell him to move around and turn   66 00:08:55,680 --> 00:08:59,760 and whatever he does, he leaves a little  trail behind him and you can make drawings   67 00:08:59,760 --> 00:09:07,840 out of it. Well, Python contains Logo.  There's a library the core library of   68 00:09:08,960 --> 00:09:17,920 in Python, called "turtle," is Logo. It is a  nice, simple drawing library. So that was the   69 00:09:17,920 --> 00:09:26,800 basis of my drawing library that I wrote. What I did was it starts with a state,   70 00:09:27,360 --> 00:09:35,040 an x and a y position and a iteration number,  which will become important later. And then I   71 00:09:35,040 --> 00:09:40,720 could pass to that some really simple functions.  So, here's a function I wrote for drawing a daisy.   72 00:09:42,800 --> 00:09:49,840 It takes just an iteration number and it produces  an output based on that iteration number.   73 00:09:50,880 --> 00:09:57,440 So, that function returns some outputs  which are interpreted as instructions to my   74 00:09:57,440 --> 00:10:05,520 drawing library. Or it could produce one set of  instructions or multiple sets of instructions.  75 00:10:07,200 --> 00:10:13,840 I passed that to a couple of regulator functions  that would make sure that those instructions   76 00:10:13,840 --> 00:10:20,720 produced by the function were actually able  to be interpreted as drawing instructions   77 00:10:22,240 --> 00:10:31,440 and then make a turtle. And I tell that turtle to  draw, based on the instructions. So, for example,   78 00:10:31,440 --> 00:10:38,720 the instructions might say, "turn let and  go forward." And it would do that and draw a   79 00:10:38,720 --> 00:10:47,680 little bit of a flower and then it would return  a new state and increase the iteration one step   80 00:10:47,680 --> 00:10:52,720 and then get passed to that that state would get  passed to the function again. So I made this real,   81 00:10:52,720 --> 00:10:58,800 simple, little framework for drawing flowers and  that meant I could write a handful of really,   82 00:10:58,800 --> 00:11:05,040 simple functions that would draw different  flowers, like this. So, I made a little daisy   83 00:11:06,240 --> 00:11:13,920 and a cyclamen and a fox glove and a  tree. And each of those are generated   84 00:11:13,920 --> 00:11:17,680 by a function that's only, you  know, a handful of lines long.  85 00:11:20,960 --> 00:11:25,360 And then I wanted to mangle those together.  So, I wanted to achieve was, could I get   86 00:11:26,080 --> 00:11:29,280 two of those functions, the daisy  function and the tree function,   87 00:11:30,320 --> 00:11:37,600 mangle their ASTs together and produce a  new function that drew a flower that looked   88 00:11:37,600 --> 00:11:45,920 a bit like a tree and a bit like a daisy?  So, I needed to take a function, using   89 00:11:45,920 --> 00:11:51,920 Inspect, I could get the source string of that  function and then pass that and I'd get an AST,   90 00:11:53,040 --> 00:12:01,280 so I did that to two functions and then kind of  jumble them together and make a combined AST.  91 00:12:02,560 --> 00:12:08,240 And there's a cool thing that's I think  they only introduced it in Python 3.9,   92 00:12:09,040 --> 00:12:15,280 which means you can unpass an AST as well,  which means it will show you the code   93 00:12:16,000 --> 00:12:23,600 that it shows you code that would generate  an AST that matches the AST you've unpassed.   94 00:12:24,720 --> 00:12:32,160 And that was enormously helpful in doing this. Anyway, so, when I was mangling them together,   95 00:12:32,160 --> 00:12:39,840 I used a few ideas from genetic programming.  The main one being cross pollination.   96 00:12:41,280 --> 00:12:48,320 What that looks like is this, you start with  a source you start with an AST. And then you   97 00:12:48,320 --> 00:12:57,680 select a donor AST. So, in this, we've got  the AST we looked at before and another AST.   98 00:13:01,360 --> 00:13:08,000 You select a donor, from the donor, you  select a subtree and a target location   99 00:13:08,000 --> 00:13:14,720 in the in the original AST, and then  you kind of graft on that bit of the AST   100 00:13:15,840 --> 00:13:21,360 to the, um, to the subject. And  that gives you a new function.  101 00:13:25,680 --> 00:13:29,840 There are a couple of other things that  I tried, as well, mutation, which is just   102 00:13:30,560 --> 00:13:36,720 changing one node, like incrementing a number  up or down and a greater than to a less than   103 00:13:38,640 --> 00:13:41,600 and pruning, which is snipping bits off the tree.   104 00:13:45,360 --> 00:13:52,240 So, from from that new, combined AST, you  can compile it back into compiled code   105 00:13:52,800 --> 00:14:00,480 and then execute that, which creates a function  back in your namespace. So then you've got   106 00:14:00,480 --> 00:14:08,240 a new function, which is  whatever that AST tells it to do.  107 00:14:12,080 --> 00:14:17,520 And that kind of works. If you take the  tree function and the daisy function   108 00:14:18,400 --> 00:14:25,440 and then mangle them together, you kind of get  something that sometimes looks like a combination   109 00:14:25,440 --> 00:14:36,800 of the two of them. This was enormously exciting  to me when I first achieved this, but it was also   110 00:14:38,400 --> 00:14:45,440 terrible because I hadn't really expected this  to work and the fact that it did work meant   111 00:14:45,440 --> 00:14:52,320 that I was encouraged, in my stupid  idea, and then had to take it further.  112 00:14:54,400 --> 00:14:58,240 And the first thing that I did to take  it further was multiple generations.   113 00:14:59,680 --> 00:15:06,000 Could I take these mangled ASTs, these  functions that were the product of a mangled AST   114 00:15:06,000 --> 00:15:08,720 and then mangle them together even  more and get something even worse?   115 00:15:10,560 --> 00:15:17,840 So, to do that, I had to kind of do this round  trip, an AST that was compiled into a function,   116 00:15:17,840 --> 00:15:24,880 choosing the functions that I wanted  to recombine, get the ASTs for them,   117 00:15:24,880 --> 00:15:32,320 mutate those to and then combine them again and  do this whole round trip. And that was a bunch   118 00:15:32,320 --> 00:15:37,440 of [Indiscernible] around. You can go and look  at my code to see how I did that. It was gross.   119 00:15:40,480 --> 00:15:45,920 But it worked. I got even more  hideous functions. Things that   120 00:15:45,920 --> 00:15:50,800 produced sort of [Indiscernible] sigils  that looked less and less like flowers.   121 00:15:53,680 --> 00:16:00,640 That was also very encouraging to me. So, then I got to thinking, if I can do that,   122 00:16:01,200 --> 00:16:07,840 maybe I can go, like, full genetic  programming on it. Maybe I can actually   123 00:16:08,560 --> 00:16:15,600 evolve code. Make something that evolves  a Python function to solve a problem.   124 00:16:19,840 --> 00:16:27,040 So, to do that, I needed to start with a function  stub. All right. A random function. So, I wrote   125 00:16:27,040 --> 00:16:31,760 a thing that would randomly piece together  a little bit of an AST that could get   126 00:16:32,480 --> 00:16:40,240 turned into a function, so this is the example  of that approach, using that unpause function   127 00:16:40,240 --> 00:16:52,560 from 3.9 to see the code your AST would generate.  So, this is this function doesn't do very much,   128 00:16:52,560 --> 00:16:57,520 but it produces an output that is capable  of being interpreted by my drawing library.  129 00:17:00,400 --> 00:17:05,920 So, you take one of those random function  stubs, get the instructions that it generates   130 00:17:06,720 --> 00:17:13,120 and then measure the fitness of that  function. I'm going to get into that,   131 00:17:13,120 --> 00:17:20,560 more later, because that's kind of the trickiest  part, right. Writing something that can tell you,   132 00:17:20,560 --> 00:17:27,440 does the output of this function look  like a flower? That's very hard to do.  133 00:17:29,840 --> 00:17:39,120 So, this is where I took most inspiration from  genetic programming and spent the most time   134 00:17:39,120 --> 00:17:46,880 talking to Trevor, with him trying to get me to  understand this. What I did was used tournament   135 00:17:46,880 --> 00:17:55,280 selection. So, the idea with that is that you  have dozens or hundreds of these random functions.   136 00:17:56,880 --> 00:18:03,520 And randomly select a handful of them and  then measure the fitness of that random   137 00:18:04,320 --> 00:18:08,960 selection and then take the best of those  to be the donor for your next generation.   138 00:18:09,600 --> 00:18:15,840 And then, iterate that several times so that your  your next generation is a combination of random   139 00:18:15,840 --> 00:18:23,360 selection and selecting the best. And the reason  we do that is to maintain genetic diversity.   140 00:18:23,360 --> 00:18:31,040 If you just get the best functions from each  generation, they tend to all be very, very similar   141 00:18:31,840 --> 00:18:37,120 solutions to the problem. By introducing a  random element, you get this genetic diversity,   142 00:18:37,680 --> 00:18:45,120 which is [Indiscernible] over time, tends to  give you a little bit. Those selected functions   143 00:18:45,120 --> 00:18:55,360 become the donors for this random combination  of functions and they make new functions,   144 00:18:55,360 --> 00:19:01,040 which are hopefully a slightly better solution  to the problem than the ones you started with.  145 00:19:04,400 --> 00:19:10,800 So, what does that look like? Well, a lot of it  depends on the fitness function. This was my first   146 00:19:10,800 --> 00:19:16,000 kind of naive fitness function that I wrote.  Basically the idea is, what does a flower look   147 00:19:16,000 --> 00:19:22,400 like? Well, it's got a thin stem and then it's  big at the top. So what I want to say, the first   148 00:19:23,120 --> 00:19:27,200 few iterations should have one output  in them. It should be just one line   149 00:19:27,920 --> 00:19:32,400 and then after the first four  generations or the first four lines,   150 00:19:32,960 --> 00:19:37,840 it should get big, right? So little stem  at the bottom and then big at the top.   151 00:19:40,720 --> 00:19:44,400 This is what it output. So,  I wrote a thing that would   152 00:19:45,360 --> 00:19:51,840 get the best output the best function from  each generation over 10 or 12 generations   153 00:19:52,720 --> 00:19:57,600 and although this is sometimes generating  functions that produce flowers, a lot of the time,   154 00:19:57,600 --> 00:20:06,240 it's generating stuff that doesn't it's generating  functions that don't draw anything at all.  155 00:20:06,240 --> 00:20:11,760 This is an example of one of the functions it  generates and it's illustrating one of the key   156 00:20:12,720 --> 00:20:19,840 pitfalls in machine learning, which is that it  has done literally exactly what I asked for.   157 00:20:22,240 --> 00:20:31,440 So, it's doing it's doing something once  for every every time, in a range. But   158 00:20:31,440 --> 00:20:36,960 because it starts at zero, the first thing  it does is nothing at all and that stops   159 00:20:36,960 --> 00:20:43,200 it from stops the function from working, which  means that the flower dies before it's even born.  160 00:20:44,640 --> 00:20:47,120 So, I had to fix that with  my next fitness function,   161 00:20:47,120 --> 00:20:53,600 which adds a penalty if the  flower is ever a size of zero.   162 00:20:56,720 --> 00:20:59,680 And that's a little bit more successful,  right? It's not evolving things that   163 00:21:00,560 --> 00:21:04,080 kind of start to look a little tree like,   164 00:21:04,880 --> 00:21:11,040 like this. Here's an example of the kind of  function that it generates. So, still very,   165 00:21:11,040 --> 00:21:16,480 very simple things that get but it does that  thing where it starts small and gets bigger.  166 00:21:19,680 --> 00:21:25,760 I did a lot more fiddling around. Here's another  thing where it's trying to make it only of a   167 00:21:25,760 --> 00:21:32,160 certain length and get a little more daisy like  and kind of this is the first time where I started   168 00:21:32,160 --> 00:21:36,800 to feel like I was actually starting to get  something that looked like a flower. See that last   169 00:21:36,800 --> 00:21:43,040 one there? Hang on, there, I'll zoom in. It's got  a stem and then a flower on top. Right. It's kind   170 00:21:43,040 --> 00:21:52,960 of it's kind of a flower. Anyway, maybe it was  the mania I had gotten into trying to solve this   171 00:21:52,960 --> 00:22:00,800 problem, but I was very, very excited when I saw  this picture. And it encouraged me to work harder   172 00:22:02,400 --> 00:22:12,320 that's the function that drew that. So, you can  see that it is generating very, very complex code   173 00:22:12,880 --> 00:22:20,800 and code that doesn't a lot of this code  never actually gets invoked so it's sort of   174 00:22:20,800 --> 00:22:29,440 demonstrating another common pit fall in genetic  programming, which is called bloat. It just   175 00:22:30,720 --> 00:22:39,840 writes mangles things together and seeing what  the output is. So, we've got kind of a miss here.  176 00:22:41,200 --> 00:22:48,640 So, it was many, many iterations later of fiddling  with that fitness function and seeing the results   177 00:22:48,640 --> 00:22:54,800 and [Indiscernible] around when it kind of started  kind of producing things that looked a little bit   178 00:22:54,800 --> 00:23:01,920 like a flower. Not a lot like a flower. It's got  a stem at the bottom, which is all one color and   179 00:23:01,920 --> 00:23:08,240 it's thin and it gets big at the top and it sort  of explodes out. I think this was maybe my best   180 00:23:08,240 --> 00:23:14,880 flower of many, many attempts and there were  a lot more that looked much uglier than that.  181 00:23:18,480 --> 00:23:29,840 Less you be concerned about this taking over our  jobs and making us less redundant, do not fear.   182 00:23:31,440 --> 00:23:37,680 This is some of the code that  generated that flower, so it's making   183 00:23:38,640 --> 00:23:45,600 absolutely hideous code that none of  us should feel worried about. Even my   184 00:23:45,600 --> 00:23:49,840 code looks slightly better than  this, when I write it myself.  185 00:23:52,960 --> 00:24:02,640 So some conclusions. Don't do this. It's a  terrible idea. Why is it a terrible idea? I guess,   186 00:24:02,640 --> 00:24:07,840 because of that the thing with the fitness  functions. Right. What I realized was that   187 00:24:08,560 --> 00:24:13,280 in order to get this to work, I needed to be  able to write a function that could exactly   188 00:24:13,280 --> 00:24:19,200 measure whether I had solved the problem.  And for any problem with any degree of   189 00:24:20,320 --> 00:24:23,120 complexity, solving that problem   190 00:24:24,560 --> 00:24:29,760 measuring whether I had solved the problem was  exactly the same as solving the problem in the   191 00:24:29,760 --> 00:24:35,840 first place. If you can tell whether or not  you've solved the problem, if you can describe   192 00:24:35,840 --> 00:24:41,760 the problem so exactly that you can measure it  in code, then you've already solved the problem.   193 00:24:42,800 --> 00:24:49,920 So, it turns out this is an actually pointless  thing to do for writing code. So, don't do it.  194 00:24:51,200 --> 00:24:56,640 I learned a lot from doing it. I learned a lot  about ASTs and what they're good for, which is not   195 00:24:56,640 --> 00:25:01,920 this. I learned a lot about genetic programming.  Also, not a good application in this case.   196 00:25:03,920 --> 00:25:11,280 But, very instructive. If you want to learn from  my mistakes, you can go and check out my code,   197 00:25:11,280 --> 00:25:18,800 which is here. And, you can read about several  of my other stupid ideas, mostly on Medium,   198 00:25:18,800 --> 00:25:23,040 which you can check out there. I'll also  try to get those links somewhere where   199 00:25:23,040 --> 00:25:26,240 you can click on them and you don't  have to copy them down from my slides.  200 00:25:27,040 --> 00:25:32,080 Um, thank you very much. I've finished a  little bit ahead of time so I'll try to   201 00:25:32,080 --> 00:25:37,280 take some questions, if I can. >> Thank you so much, Simon,   202 00:25:37,280 --> 00:25:45,440 for that just delightful journey you've  taken us on, on growing syntax trees. I   203 00:25:45,440 --> 00:25:54,480 was laughing laughing a lot, admiring your  beautiful blooms that you tended so carefully.  204 00:25:56,320 --> 00:26:01,760 Okay. And, yeah, the chat has  been going off this whole time,   205 00:26:01,760 --> 00:26:06,160 with a lot of excellent commentary and puns.  206 00:26:06,160 --> 00:26:12,720 SIMON CARRYER: Oh, I'm glad. I'm glad. >> We have a couple of questions.   207 00:26:13,520 --> 00:26:18,720 We have a few minutes, so add more questions  while I'm asking Simon these questions.   208 00:26:22,880 --> 00:26:28,000 Why do all the flowers turn to the left? SIMON CARRYER: Oh, that's a really good   209 00:26:28,000 --> 00:26:33,200 question. Which I don't know  the answer to. It's probably a   210 00:26:35,760 --> 00:26:44,400 an accident of how I wrote the code that  generates the functions being biased towards no,   211 00:26:44,400 --> 00:26:51,760 it'll be my drawing library, which the turn  is either a positive or a negative number and   212 00:26:51,760 --> 00:26:58,000 it's more likely to be a positive number than a  negative number because of the way the it's just   213 00:26:58,000 --> 00:27:03,040 an accident of how the code is written. >> That makes sense. That makes sense.   214 00:27:04,320 --> 00:27:10,800 Our next question, actually, I'm going to  reorder these questions slightly. Do you think   215 00:27:10,800 --> 00:27:19,840 this would be applicable to data analysis? SIMON CARRYER: I hope not, that's my job.  216 00:27:19,840 --> 00:27:21,440 [Laughter]. >> Good answer.  217 00:27:24,747 --> 00:27:32,000 SIMON CARRYER: Genetic programming, in general,  is more applicable in cases where you can easily,   218 00:27:32,000 --> 00:27:38,240 sort of mathematically measure whether you've  got a good solution so it tends to be good for   219 00:27:39,280 --> 00:27:44,720 fitting to a curve or, you know, writing a  function that can describe some real world   220 00:27:44,720 --> 00:27:54,400 data accessibility. So, yeah, that sort of realm  is more likely to be a good idea. Whether doing   221 00:27:54,400 --> 00:27:58,880 that on Abstract Syntax Trees is ever a good  idea, I don't know. I don't know. I would be   222 00:27:58,880 --> 00:28:06,560 delighted to find a practical use for this. >> What were your favorite resources for   223 00:28:06,560 --> 00:28:12,320 learning Abstract Syntax Tree stuff? SIMON CARRYER: Um, my favorite way   224 00:28:12,320 --> 00:28:18,880 to do it was to annoy Trevor on Slack, at work,  while he was trying to do his job in lockdown.  225 00:28:18,880 --> 00:28:23,040 >> So the rest of us will have  to find our own "Trevor" then?  226 00:28:23,040 --> 00:28:30,600 SIMON CARRYER: His documentation of his library  is good. Check out the docs on G P Learn.  227 00:28:30,600 --> 00:28:38,400 >> It's always great to hear  a recommendation for docs.  228 00:28:41,440 --> 00:28:46,000 Our last question I'd like to end on  this, I did not write this question.   229 00:28:47,360 --> 00:28:50,800 What awful, terrible idea  are you currently working on?  230 00:28:52,000 --> 00:28:58,000 SIMON CARRYER: So, yeah. You know  how when you write code, you, like,   231 00:28:58,000 --> 00:29:03,920 write one function and then another function and  then you write something that puts both those   232 00:29:03,920 --> 00:29:11,840 functions together and then you have to why do we  have to do that ourselves? It knows what to do.   233 00:29:12,800 --> 00:29:20,160 That's a path finding problem, right? >> That makes perfect non, in brackets,   234 00:29:20,160 --> 00:29:31,520 sense to me. Thanks, Simon, we all  needed a good laugh, you provided.  235 00:29:33,440 --> 00:29:42,880 SIMON CARRYER: Cool. Thanks very much. >> So, everybody, we are on a break now.   236 00:29:43,600 --> 00:29:51,520 It is lunchtime. And, just a heads up for  anybody who's thinking about submitting a   237 00:29:51,520 --> 00:29:59,120 lightning talk to deliver tomorrow, lightning  talk submission close during the lunch break. It's   238 00:30:03,280 --> 00:30:07,840 one of the best parts of a conference.  Now's your chance to participate.  239 00:30:09,360 --> 00:30:16,400 Okay. Thanks, again, Simon and we will see you  all back after lunch, at 2:00pm conference time,   240 00:30:16,400 --> 00:30:28,149 that's in an hour and a half. Have a nice break. [Lunch break until 2:00 p.m. conference time].