Or you can pass in and put some, I'm going to talk about that in a while, and so, so these
are the blocks, these are the errors we put on blocks that you, I don't think you don't
find them any languages, and there's a kind of a slight tweak that if it has this vertical
ellipsis, that also means that you can drop a list on it.
You can drop something on it that will then give you an aggregation of the data in that
list.
And so, one example would be here when we have the plus block, I can say 3 plus 4, I can
see 3 plus 4 plus 6, and it works, but it can also get here the numbers from 1 to
10, and if I put them on here, the block morphs into the sum block, and I can get the sum
of that list.
So it's basically a way to maybe overload blocks and primitives with functionality to make
it more expressive, but also to reduce the number of blocks in the palette, because that's
something that we hear a lot, you know, it's great to have something that's discoverable,
so you can check through the menu to see what's there, but it's also a plate, because
you've got to go through all the menus to find what you want, so there's this trade-off
between giving you expressive power and overloading your mind with all the choices that
you have to make.
So it's a powerful feature, very attic blocks, and there are these, they're kind of all over
in snap, with these indications of sometimes we don't want you to be able to do aggregations
because they're also a user interface, things like when you make a list, like this block
that actually gives you new list, it doesn't make sense to drop a list on there, to
wrap it into a list, so instead, if you want to have a list of the numbers from 1 to 10,
this is what you want, but it doesn't make sense to make a list of those numbers.
So these are very attic blocks, kind of the first way of power blocks that we had in snap,
and they're quite useful because they let us basically specify all our operators, our
in-fix operators, to be very attic, so we can easily chain things like greater than or
into these chains, oops, and they also let us kind of reduce our conditionals to just
really one block, and it also serves sort of as a switch statement because we can expand
them, and we just need this one block to do things that otherwise would have to be nested.
Like often when you see these block-based languages, you see very deeply nested if L structures,
and it's easier to mentally talk about and digest things that are just one level of
nesting, and the second part is meta blocks, and meta blocks kind of is maybe the thing that
basically goes into this blocks oriented paradigm, meta blocks is in snap, our rings,
we have rings all kind of all over, here are blocks that have rings on them, and these are the
higher order functions, so we can map the numbers 1 to 10, and we can say okay, we want this to
be times 2, and the ring basically is a lambda structure, and then that's as very easily
transformed these things, or these are all the higher order functions like that we have, for
example, we could also say keep, which is a filter way, and if we keep the numbers
one to 10, we can pass in a predicate, for example, that would select all the ones
that are divisible by 3, and so rings are a very powerful way to avoid loops, and to
just use higher order functions, and rings is in a way a meta, a meta structure, because
really what meta blocks do, what these rings are, do you think they let you access blocks,
either to call them, as I've just shown you now, or to actually access their properties,
and you can change blocks with them, and you can make new blocks with these things, so
what we have in snapp is that, for example, now that I have this structure here, I can
I can split it, using ring, like I can split, hello world, I can split that, but if I have,
for example, the move and turn script, and I put that into a ring, and if I split that, by blocks,
I now get a syntax tree, and a syntax tree is something that, and now let's me think about
the syntax, the structure, not in a texture away, and when I have a syntax tree,
I can again stitch this together and create new scripts from it, and I can join it,
and I'm again getting the script, so this is a way to dissect and rearrange scripts, and that's
kind of going down into the way how we make blocks, like for example, I can, I can also
programatically define a new block in snapp, using this, so I can define block here,
for example, I could define the block jump, and I can say there should be height, and then
I can define this with this block, like I can say there should be something like height,
and then I could write something in here, for example, I could say I could do a little animation,
repeat height, you could say change y position by 1, and then I could just duplicate that,
and change it again by minus 1, now this would be sort of a block, and then I can say different
things, but let me just evaluate this, so if I click on this, I've made a new block here,
and I can now let my sprite jump hopefully, that's jump by 100, and it sort of does that very slowly,
but the ways I can now write scripts that produce other scripts using blocks, something that
usually I'd only do in a text-based language, and so this is one idea to think about going
meta on blocks themselves rather than, you know, on some other computational concepts,
and this was the way to make it in block, oh, there are some animations in there, and finally,
another thing that's going meta is that we can have self-reflection, that I can look at
all the blocks of the system or the blocks on my stage to find out and to reason about them,
so for example, I could say I can look at all my scripts in here, where do I find them here,
so when I get all my scripts, now these are all the scripts that I have sitting in the
scripting area right now, and then I can sort of cycle through them and get their syntax trees and
rearrange them and analyze them, which block points to which other block, and basically sort of
get a graph structure of my program, and yes, please.
Yes, it is included in the list, which is the my scripts, yes, the whole thing is, it sort of
proves that it actually is live, yes, if I didn't want to have it in here, I would have it in a
different, like I can also see I can also evaluate it in here to find it again for every
editing in here, it's not, it's not there anymore, right? So yes, but if it's in the scripting area,
where I'm actually evaluating the block, it will be included in the scripts because it's a script.
So yes, please.
I've worked with this?
Yes.
Go on goal, fine and very curious, I'm looking for what's the difference with what I'm doing,
and my blocks are within parenthesis all the time.
Exactly.
I have markers and I understand expressions, files on exactly, who's saying you're working with
list and that's precisely what I'm showing you right now so so there's a question
like is this something else then from what you've been doing if you've been if you've
been using things like smart algorithms that are self-reflective that have met
a programming capabilities and I'm not sure which is why there's a question mark so
let me show you one more thing that kind of prompted me to maybe go into the into that
direction and that is let me actually make it a project for this so what if
blocks were also the domain of what we could program so we wouldn't just kind of
generate new blocks but what if there were programs that sort of define the
properties of a block and here's like maybe just just a little example I'm going to
import data set of the Titanic now the passage of the Titanic and I want to have
a block that sort of explores what what this is doing and for the sake of time I'm
just going to import that block now so so this would be it so there's a drill down
block I made and this now lets me drill down the data set of the Titanic and I can
click on here and I get you know all the fields that are in the data set so I can
say I want to get all the classes and it's already selecting a class that's in the
data set and I can see all the classes that are in there and I can select them and
now I'm getting all the people in that third class and if I'm selecting for
example all the genders I'm getting mail and female so this isn't really that
special but it seems that I made this block just for the Titanic data set because
how else would it know which fields to show in that drop down menu but the
fact is that this drop down menu is dynamic so if I take another data set for
example the Forbes building there said and I put the building there's here I'm
I'm getting you know the company sector and now it's it's software and other
things so what's what I'm showing in the block is dynamic dependent on its inputs
and I think this is something because you don't need it unless because you just
type it in but here in blocks it's sort of a mismatch between an expression and
a user interface with affordability and the way I've made this block here this
is something new we've been thinking about is that in its definition there are
also event blocks that are particular that that deal with user events to this
particular block instance and so I've made this this thing that controls the menu
that shown when like when the user requests when the user requests the a menu
for the column it actually gets the data evaluates and then shows a dynamic
rendition of that and then the right column where we can set the detail it does
that depending on the selection and the left column and this is something that I'm
quite excited about because now we're talking about not really building apps but
having the program itself sort of be something that could be an interface to data
and so it's sort of suddenly all this nerdism about let's do meta programming and
oh wow like why didn't it pick up since the 80's like why does everybody think
it's it's hard and it's something that like meta is crazy some of these
seems like not such a bad idea anymore so it might actually make sense to do
this and maybe blocks could be something that are more than a just a
modality especially if they're alive could be something that could actually help
us and I mean this this example is just something that I've shown you with data but
I'm also imagining like in the other dev rooms here in in Boston Junior we're
playing a lot with robots now if you're talking about if you think about hardware like
one robot has this set of pins or or or these set of features having things that
dynamically interact with that and show you and give you the choices and maybe default
values could be something that maybe and that's kind of the last proposition I
want to make that maybe gives us a new tangent for programming where it's not
just about writing static code but it was actually kind of more of a language
between us or and between the appliances we use and in that maybe there could be
something not just blocks based programming but actually block oriented programming
and the last thing is hyperbox option that yesterday in the keynote which is
where we can basically put any vectors matrices can any dimension it's essentially
a ray-based programming that's built into the blocks which also reduces the number
of blocks and makes it easier to do more with fewer blocks because it does what
you think it does and that's really the question more of a question I want to pose
could there be something like a place for visual programming and this is what I
wanted to show and we've already had some some great questions or or remarks and I'd
be very interested about yours yes please
I'm teaching for the right steps and the step by doing it would be all abstract away from
coming in possible with the drawings in both that you look so many minutes and you
combine them together you get a loop and you combine them together you get to access
the identity of such an object that you can modify properties and I I'm still
in draft but I was hesitant about how to interpret that and now I think I put an
interesting base for more to use ideas going because you basically make something
that can be abstracted a point that is about building the only stuff that may
put in them together that start with looks like a language and that allows pretty
much anything that's written in a complex you can do things that you can design
at friends may hope both that's the magic in design I was thinking for would be able
to be the base of the design itself whenever in the player to use a magic in
the world you become a mother of the game that's a great point you said that
you know the visual metaphors could be a base for your gain engines and things
where and and you you're also expressed that the maybe it could be something where
the engine could be written in itself kind of in this way this is also something
that we've been playing with for example like all the blocks that you have in the
pallet here that are primitives you can actually edit them like if I go to the move block
I can see how this is done so this is the actual primitive and you can see it calls
the primitive but there's fallback code I can turn off the primitive and then it does
this so actually large parts of of this is written in itself and you can see for
example how things like the repeat loop is actually sort of written in itself
recursively and this is precisely the point like usually when we talk about these
things it's like yeah you're nerds you're just like doing things
itself but but there is this openness behind this if you can look at things without
moving them and the things tell you or give you insights of their internal state of
how they're made and if you drill down you see something that you're familiar with
we hope that's kind of more inviting for you to engage with you know more powerful ideas
then just to take it as God given yeah yes please
so and thank you I'm also curious about how to make a progression from the from the basic
of block programming or block building and I think that's and if that's perhaps my question
is that also your intention that you want to have some kind of progression from from the
basics with the hyperblocks and the drilling now is that also to have the ability to look into
more more activities do we want to have a progression absolutely we don't want to have a
progression the progression that we're after is that of intellectual concepts not so much of
going from from from blocks to text because that is just a different modality of of
expressing things although the list begins amongst you might be pleased to see that we have an
internal encoding that has kind of his list like but the idea what we're thinking about is that
you know if you're curious you should be able to explore things and and take things apart
and rearrange things and and then learn about how this is done so there's it's okay to have a
fence to have a barrier and you should be able to explore things