WEBVTT 00:00.000 --> 00:12.120 Or you can pass in and put some, I'm going to talk about that in a while, and so, so these 00:12.120 --> 00:16.680 are the blocks, these are the errors we put on blocks that you, I don't think you don't 00:16.680 --> 00:23.480 find them any languages, and there's a kind of a slight tweak that if it has this vertical 00:23.480 --> 00:29.040 ellipsis, that also means that you can drop a list on it. 00:29.360 --> 00:34.600 You can drop something on it that will then give you an aggregation of the data in that 00:34.600 --> 00:36.600 list. 00:36.600 --> 00:51.600 And so, one example would be here when we have the plus block, I can say 3 plus 4, I can 00:51.600 --> 00:58.160 see 3 plus 4 plus 6, and it works, but it can also get here the numbers from 1 to 00:58.160 --> 01:06.800 10, and if I put them on here, the block morphs into the sum block, and I can get the sum 01:06.800 --> 01:08.040 of that list. 01:08.040 --> 01:18.120 So it's basically a way to maybe overload blocks and primitives with functionality to make 01:18.120 --> 01:22.880 it more expressive, but also to reduce the number of blocks in the palette, because that's 01:22.880 --> 01:27.640 something that we hear a lot, you know, it's great to have something that's discoverable, 01:27.640 --> 01:32.000 so you can check through the menu to see what's there, but it's also a plate, because 01:32.000 --> 01:37.000 you've got to go through all the menus to find what you want, so there's this trade-off 01:37.000 --> 01:44.200 between giving you expressive power and overloading your mind with all the choices that 01:44.200 --> 01:46.760 you have to make. 01:46.760 --> 01:53.680 So it's a powerful feature, very attic blocks, and there are these, they're kind of all over 01:53.680 --> 02:00.320 in snap, with these indications of sometimes we don't want you to be able to do aggregations 02:00.320 --> 02:06.880 because they're also a user interface, things like when you make a list, like this block 02:06.880 --> 02:11.960 that actually gives you new list, it doesn't make sense to drop a list on there, to 02:11.960 --> 02:17.560 wrap it into a list, so instead, if you want to have a list of the numbers from 1 to 10, 02:17.560 --> 02:23.640 this is what you want, but it doesn't make sense to make a list of those numbers. 02:23.640 --> 02:30.520 So these are very attic blocks, kind of the first way of power blocks that we had in snap, 02:30.520 --> 02:37.320 and they're quite useful because they let us basically specify all our operators, our 02:37.320 --> 02:43.560 in-fix operators, to be very attic, so we can easily chain things like greater than or 02:43.560 --> 02:55.240 into these chains, oops, and they also let us kind of reduce our conditionals to just 02:55.240 --> 03:02.760 really one block, and it also serves sort of as a switch statement because we can expand 03:02.760 --> 03:10.120 them, and we just need this one block to do things that otherwise would have to be nested. 03:10.200 --> 03:16.200 Like often when you see these block-based languages, you see very deeply nested if L structures, 03:17.240 --> 03:26.040 and it's easier to mentally talk about and digest things that are just one level of 03:26.040 --> 03:35.960 nesting, and the second part is meta blocks, and meta blocks kind of is maybe the thing that 03:36.040 --> 03:42.280 basically goes into this blocks oriented paradigm, meta blocks is in snap, our rings, 03:42.280 --> 03:49.880 we have rings all kind of all over, here are blocks that have rings on them, and these are the 03:49.880 --> 03:59.960 higher order functions, so we can map the numbers 1 to 10, and we can say okay, we want this to 03:59.960 --> 04:08.600 be times 2, and the ring basically is a lambda structure, and then that's as very easily 04:10.120 --> 04:16.760 transformed these things, or these are all the higher order functions like that we have, for 04:16.760 --> 04:23.320 example, we could also say keep, which is a filter way, and if we keep the numbers 04:23.640 --> 04:33.960 one to 10, we can pass in a predicate, for example, that would select all the ones 04:36.840 --> 04:47.080 that are divisible by 3, and so rings are a very powerful way to avoid loops, and to 04:47.080 --> 04:55.000 just use higher order functions, and rings is in a way a meta, a meta structure, because 04:56.360 --> 05:00.840 really what meta blocks do, what these rings are, do you think they let you access blocks, 05:00.840 --> 05:05.080 either to call them, as I've just shown you now, or to actually access their properties, 05:06.200 --> 05:11.400 and you can change blocks with them, and you can make new blocks with these things, so 05:11.400 --> 05:20.520 what we have in snapp is that, for example, now that I have this structure here, I can 05:21.560 --> 05:30.920 I can split it, using ring, like I can split, hello world, I can split that, but if I have, 05:31.800 --> 05:43.400 for example, the move and turn script, and I put that into a ring, and if I split that, by blocks, 05:45.720 --> 05:52.120 I now get a syntax tree, and a syntax tree is something that, and now let's me think about 05:53.400 --> 05:58.440 the syntax, the structure, not in a texture away, and when I have a syntax tree, 05:59.320 --> 06:07.960 I can again stitch this together and create new scripts from it, and I can join it, 06:07.960 --> 06:18.840 and I'm again getting the script, so this is a way to dissect and rearrange scripts, and that's 06:18.840 --> 06:25.880 kind of going down into the way how we make blocks, like for example, I can, I can also 06:25.880 --> 06:33.480 programatically define a new block in snapp, using this, so I can define block here, 06:34.360 --> 06:42.120 for example, I could define the block jump, and I can say there should be height, and then 06:43.400 --> 06:49.000 I can define this with this block, like I can say there should be something like height, 06:49.480 --> 06:57.320 and then I could write something in here, for example, I could say I could do a little animation, 06:58.760 --> 07:11.480 repeat height, you could say change y position by 1, and then I could just duplicate that, 07:12.120 --> 07:20.120 and change it again by minus 1, now this would be sort of a block, and then I can say different 07:20.120 --> 07:27.640 things, but let me just evaluate this, so if I click on this, I've made a new block here, 07:28.840 --> 07:39.960 and I can now let my sprite jump hopefully, that's jump by 100, and it sort of does that very slowly, 07:40.040 --> 07:46.920 but the ways I can now write scripts that produce other scripts using blocks, something that 07:47.480 --> 07:55.480 usually I'd only do in a text-based language, and so this is one idea to think about going 07:55.480 --> 08:01.640 meta on blocks themselves rather than, you know, on some other computational concepts, 08:02.520 --> 08:08.680 and this was the way to make it in block, oh, there are some animations in there, and finally, 08:09.640 --> 08:14.360 another thing that's going meta is that we can have self-reflection, that I can look at 08:15.240 --> 08:21.480 all the blocks of the system or the blocks on my stage to find out and to reason about them, 08:21.480 --> 08:35.800 so for example, I could say I can look at all my scripts in here, where do I find them here, 08:36.760 --> 08:42.360 so when I get all my scripts, now these are all the scripts that I have sitting in the 08:42.360 --> 08:48.280 scripting area right now, and then I can sort of cycle through them and get their syntax trees and 08:48.280 --> 08:53.480 rearrange them and analyze them, which block points to which other block, and basically sort of 08:53.480 --> 08:58.280 get a graph structure of my program, and yes, please. 09:04.360 --> 09:11.160 Yes, it is included in the list, which is the my scripts, yes, the whole thing is, it sort of 09:11.160 --> 09:18.680 proves that it actually is live, yes, if I didn't want to have it in here, I would have it in a 09:18.680 --> 09:27.560 different, like I can also see I can also evaluate it in here to find it again for every 09:27.560 --> 09:35.160 editing in here, it's not, it's not there anymore, right? So yes, but if it's in the scripting area, 09:35.160 --> 09:40.760 where I'm actually evaluating the block, it will be included in the scripts because it's a script. 09:40.840 --> 09:42.560 So yes, please. 09:42.560 --> 09:44.840 I've worked with this? 09:44.840 --> 09:45.840 Yes. 09:45.840 --> 09:55.400 Go on goal, fine and very curious, I'm looking for what's the difference with what I'm doing, 09:55.400 --> 09:59.080 and my blocks are within parenthesis all the time. 09:59.080 --> 10:00.080 Exactly. 10:00.080 --> 10:09.480 I have markers and I understand expressions, files on exactly, who's saying you're working with 10:09.480 --> 10:15.360 list and that's precisely what I'm showing you right now so so there's a question 10:15.360 --> 10:20.280 like is this something else then from what you've been doing if you've been if you've 10:20.280 --> 10:23.880 been using things like smart algorithms that are self-reflective that have met 10:23.880 --> 10:28.360 a programming capabilities and I'm not sure which is why there's a question mark so 10:28.360 --> 10:34.840 let me show you one more thing that kind of prompted me to maybe go into the into that 10:34.840 --> 10:47.520 direction and that is let me actually make it a project for this so what if 10:47.520 --> 10:56.120 blocks were also the domain of what we could program so we wouldn't just kind of 10:56.120 --> 11:01.520 generate new blocks but what if there were programs that sort of define the 11:01.520 --> 11:09.200 properties of a block and here's like maybe just just a little example I'm going to 11:09.200 --> 11:16.640 import data set of the Titanic now the passage of the Titanic and I want to have 11:16.640 --> 11:22.040 a block that sort of explores what what this is doing and for the sake of time I'm 11:22.040 --> 11:27.920 just going to import that block now so so this would be it so there's a drill down 11:27.920 --> 11:35.720 block I made and this now lets me drill down the data set of the Titanic and I can 11:35.720 --> 11:41.600 click on here and I get you know all the fields that are in the data set so I can 11:41.600 --> 11:46.680 say I want to get all the classes and it's already selecting a class that's in the 11:46.680 --> 11:51.640 data set and I can see all the classes that are in there and I can select them and 11:51.680 --> 11:59.200 now I'm getting all the people in that third class and if I'm selecting for 11:59.200 --> 12:06.440 example all the genders I'm getting mail and female so this isn't really that 12:06.440 --> 12:11.080 special but it seems that I made this block just for the Titanic data set because 12:11.080 --> 12:17.720 how else would it know which fields to show in that drop down menu but the 12:17.720 --> 12:24.880 fact is that this drop down menu is dynamic so if I take another data set for 12:24.880 --> 12:30.160 example the Forbes building there said and I put the building there's here I'm 12:30.160 --> 12:37.400 I'm getting you know the company sector and now it's it's software and other 12:37.400 --> 12:44.440 things so what's what I'm showing in the block is dynamic dependent on its inputs 12:44.440 --> 12:49.640 and I think this is something because you don't need it unless because you just 12:49.640 --> 12:55.040 type it in but here in blocks it's sort of a mismatch between an expression and 12:55.040 --> 13:00.720 a user interface with affordability and the way I've made this block here this 13:00.720 --> 13:06.200 is something new we've been thinking about is that in its definition there are 13:06.200 --> 13:12.320 also event blocks that are particular that that deal with user events to this 13:12.320 --> 13:20.920 particular block instance and so I've made this this thing that controls the menu 13:20.920 --> 13:26.440 that shown when like when the user requests when the user requests the a menu 13:26.440 --> 13:32.400 for the column it actually gets the data evaluates and then shows a dynamic 13:32.400 --> 13:37.880 rendition of that and then the right column where we can set the detail it does 13:37.880 --> 13:47.040 that depending on the selection and the left column and this is something that I'm 13:47.040 --> 13:53.120 quite excited about because now we're talking about not really building apps but 13:53.120 --> 13:57.800 having the program itself sort of be something that could be an interface to data 13:57.800 --> 14:05.120 and so it's sort of suddenly all this nerdism about let's do meta programming and 14:05.120 --> 14:10.280 oh wow like why didn't it pick up since the 80's like why does everybody think 14:10.280 --> 14:15.640 it's it's hard and it's something that like meta is crazy some of these 14:15.640 --> 14:20.000 seems like not such a bad idea anymore so it might actually make sense to do 14:20.000 --> 14:26.880 this and maybe blocks could be something that are more than a just a 14:26.880 --> 14:32.440 modality especially if they're alive could be something that could actually help 14:32.440 --> 14:38.920 us and I mean this this example is just something that I've shown you with data but 14:38.920 --> 14:43.640 I'm also imagining like in the other dev rooms here in in Boston Junior we're 14:43.640 --> 14:48.240 playing a lot with robots now if you're talking about if you think about hardware like 14:48.240 --> 14:53.760 one robot has this set of pins or or or these set of features having things that 14:53.760 --> 14:58.720 dynamically interact with that and show you and give you the choices and maybe default 14:58.720 --> 15:05.400 values could be something that maybe and that's kind of the last proposition I 15:05.400 --> 15:10.160 want to make that maybe gives us a new tangent for programming where it's not 15:10.160 --> 15:14.800 just about writing static code but it was actually kind of more of a language 15:14.800 --> 15:23.200 between us or and between the appliances we use and in that maybe there could be 15:23.200 --> 15:29.080 something not just blocks based programming but actually block oriented programming 15:29.080 --> 15:37.320 and the last thing is hyperbox option that yesterday in the keynote which is 15:37.320 --> 15:49.040 where we can basically put any vectors matrices can any dimension it's essentially 15:49.040 --> 15:54.560 a ray-based programming that's built into the blocks which also reduces the number 15:54.560 --> 16:01.120 of blocks and makes it easier to do more with fewer blocks because it does what 16:01.120 --> 16:08.400 you think it does and that's really the question more of a question I want to pose 16:08.400 --> 16:17.280 could there be something like a place for visual programming and this is what I 16:17.360 --> 16:24.360 wanted to show and we've already had some some great questions or or remarks and I'd 16:24.360 --> 16:31.360 be very interested about yours yes please 16:47.280 --> 16:53.960 I'm teaching for the right steps and the step by doing it would be all abstract away from 16:53.960 --> 16:58.960 coming in possible with the drawings in both that you look so many minutes and you 16:58.960 --> 17:04.560 combine them together you get a loop and you combine them together you get to access 17:04.560 --> 17:10.840 the identity of such an object that you can modify properties and I I'm still 17:10.840 --> 17:16.920 in draft but I was hesitant about how to interpret that and now I think I put an 17:16.920 --> 17:23.280 interesting base for more to use ideas going because you basically make something 17:23.280 --> 17:29.120 that can be abstracted a point that is about building the only stuff that may 17:29.120 --> 17:36.400 put in them together that start with looks like a language and that allows pretty 17:36.400 --> 17:41.800 much anything that's written in a complex you can do things that you can design 17:41.800 --> 17:49.080 at friends may hope both that's the magic in design I was thinking for would be able 17:49.080 --> 17:57.080 to be the base of the design itself whenever in the player to use a magic in 17:57.080 --> 18:06.240 the world you become a mother of the game that's a great point you said that 18:06.240 --> 18:12.680 you know the visual metaphors could be a base for your gain engines and things 18:12.680 --> 18:18.200 where and and you you're also expressed that the maybe it could be something where 18:18.200 --> 18:22.680 the engine could be written in itself kind of in this way this is also something 18:22.680 --> 18:27.320 that we've been playing with for example like all the blocks that you have in the 18:27.320 --> 18:34.640 pallet here that are primitives you can actually edit them like if I go to the move block 18:34.640 --> 18:40.120 I can see how this is done so this is the actual primitive and you can see it calls 18:40.120 --> 18:44.080 the primitive but there's fallback code I can turn off the primitive and then it does 18:44.080 --> 18:50.200 this so actually large parts of of this is written in itself and you can see for 18:50.200 --> 18:55.640 example how things like the repeat loop is actually sort of written in itself 18:55.640 --> 19:01.560 recursively and this is precisely the point like usually when we talk about these 19:01.560 --> 19:06.760 things it's like yeah you're nerds you're just like doing things 19:06.760 --> 19:13.000 itself but but there is this openness behind this if you can look at things without 19:13.080 --> 19:21.160 moving them and the things tell you or give you insights of their internal state of 19:21.160 --> 19:27.160 how they're made and if you drill down you see something that you're familiar with 19:28.440 --> 19:33.400 we hope that's kind of more inviting for you to engage with you know more powerful ideas 19:33.400 --> 19:38.440 then just to take it as God given yeah yes please 19:38.440 --> 19:45.880 so and thank you I'm also curious about how to make a progression from the from the basic 19:45.880 --> 19:52.280 of block programming or block building and I think that's and if that's perhaps my question 19:52.840 --> 19:59.080 is that also your intention that you want to have some kind of progression from from the 19:59.080 --> 20:07.240 basics with the hyperblocks and the drilling now is that also to have the ability to look into 20:07.480 --> 20:15.320 more more activities do we want to have a progression absolutely we don't want to have a 20:15.320 --> 20:23.000 progression the progression that we're after is that of intellectual concepts not so much of 20:23.000 --> 20:28.200 going from from from blocks to text because that is just a different modality of of 20:28.200 --> 20:35.480 expressing things although the list begins amongst you might be pleased to see that we have an 20:35.560 --> 20:43.080 internal encoding that has kind of his list like but the idea what we're thinking about is that 20:43.080 --> 20:49.480 you know if you're curious you should be able to explore things and and take things apart 20:49.480 --> 20:56.120 and rearrange things and and then learn about how this is done so there's it's okay to have a 20:56.120 --> 21:03.480 fence to have a barrier and you should be able to explore things