 Okay, I am Michael Homer. I'm going to be talking about grace. Grace is a new object-oriented open source educational programming language Some of you just point already I'm going to try to finish even a little bit early earlier than usual because I suspect there are going to be a lot of questions at the end So hopefully we'll finish really early So some of you may be wondering this question. Why would you do this? Why would you do it now in particular? There's a few reasons. One of them is that Java at this point is now 20 years old this year Python is probably the second most common language used for teaching and it is actually even older C++ is still holding its own and it's even older again There's also a lot of people using list which is even older again All of these languages have a lot of history. They have a lot of backwards compatibility The state of the art has moved on since they were created and to an extent they've moved with it Sometimes they've even been part of the state of the art moving on which is great But after 20 years, 20 years of patches start to look like patches so We've reached a point where if you want to teach the features that are in Java Java is actually not the best language to do that in. Java is a bad language for teaching Java with which is not the ideal position to be in That is the key example there is in Latin Europe They had to put them in a way that's broken because they put them in the right way Which they knew how to do then they would have broken compatibility with all their old code so there's these weird corner cases in all these languages where Students run into a problem where you try to combine generics and arrays the way that doesn't quite work and you get confused you get stuck you get Yeah, you get stuck So we've had 20 years of advancement in programming languages. We've also had 20 years of advancement in education research In fact, leave more than that. These languages are not educational languages All the languages that are currently used for education the most part at least One exception are not designed to be educational languages. Java is a large-scale industrial language Python is industrial language C++ industrial language. They have no intention at all of being useful for teaching So we can incorporate Not just advanced education research But things that were known 20 years ago things that were known 30 years ago And aren't in any of these languages That's what I'm trying to do. So to the end we set up some principles that our language should follow There is a secret hidden principle, which is still as much as possible So this isn't going to be a language that has lots of new exciting features in it In fact, it has almost no new exciting features in it. So this may be a very boring talk and I'm sorry What we do have is features that have shown themselves to be useful in existing languages or in current needs of teaching or in industry and We try to incorporate those features in a way that complies with what we know about teaching or teaching programming in particular And what we are best able to fit together into a cohesive whole of language So here's some principles. We want simple programs to be simple So you shouldn't have more in your program than actually represents the concepts that you personally right now are trying to Express what have an understandable semantic model? So there should be a single overarching cohesive model of language that a student can internalize and look at any code at all within this language and Follow what it does pass it themselves in the head figure out Where the control flows gonna go with themselves in their head if they want to know that you have to but it should Be able to because you should have a single semantic model which all the other languages don't they have weird special cases We want to support different teaching orders There's a few reasons that one of them is simply that we don't know and I don't think anyone knows what the right way to teach programming is There are a lot of different ideas and there are people who will argue strenuously for every one of them There's even research I can point you to peer reviewed published research Let's see is that every one of them is better than every other one of them all mutually contradicting each other Sometimes even in the same edition of the same conference or the same journal Java's better than Python Python's better than Java. We don't know The other part of this is a pragmatic reason and the pragmatic reason is these people with the strongly held views exist And we are in the dog food business So what I mean by that is the customer is not the consumer the consumer of our language is the students the customer The person who chooses what's going on is the instructor of course the people who are writing teaching materials and so on We need to entice them to use our language and if we tell him no actually that way you want to do that's wrong You can't do that didn't they want so pragmatically you want to support these approaches educationally We don't know any better if we did maybe we chose something different, but we don't we also want to be a general purpose language So what I mean by that is it's not a micro world language It's not a language. We only have a limited expressive domain It's language that even if you perhaps wouldn't use it to write your giant server applications conceivably you could It doesn't have any limitations when you can write it is a language that you could continue using indefinitely And that's quite important because there's a a lot of education research into What what they call transfer of learning transfer of learning is the idea of Applying what you've learned in one skill domain So say in learning one program language to a different but related skill domain like learning a second program language There's a lot of teaching approaches that rely on okay We're gonna start you out in python and then after a couple months you're gonna move Java We're gonna say run scratch and then we're gonna move you into python all these things exist and all of them When you careful what I say here all of them don't work so what we know from education research for decades now is that relying on people to Automatically have just sort of free transfer of learning between different domains just doesn't happen You need to build up quite a high level expertise in that first domain and that first language before you get any benefit at all out of Having learned that before you do the second skill So you start out with python you do that use that for a month You're you're okay at it just Java and you have to learn to program all over again We don't want that one to support students throughout the learning process so that they can continue using this language until they've actually reached the level of competence that's required to Switch on another language if they want to at that point or keep using forever both fine So let's look at some examples of how these principles show up in the language nation We had this no incantations rule. So what I mean about incantation is something like this Public static void main string square bracket odds. That's an incantation that appears in every single executable Java program It's actually longer than the second line well the one two three whatever fourth line that actually does what the program is doing So when you write hello world, you're written more to make the compiler happy than you have to make you happy That's a bit of a problem It now when I call an incantation I Want to be careful that I'm not implying the meaningless that is very meaningful So we have it there in fact six distinct concepts in that for just that one line We have public static void main string Square brackets six concepts if you change any one of those in the source text your program will no longer work They're all meaningful here. They're all meaningful elsewhere in language But what they're for right here is making the compiler happy making the language happy. They're not for making you happy So you have two options here one is that you just there's they're actually you gonna teach people on their very first day You're writing hello world Here's what a static method is and to do that you're going to explain what a non-static method is which you haven't Explore some to you You're gonna explain what void is which is a tricky concept to get across in the first place all these things are a problem Or you're an alternative. You can say okay. Just just put it there. It's fine. That is the automatic compile happy It doesn't matter just ignore it and that's a problem that actually Leads to them using it as an incantation So one of the the big problems I see with students teaching When we teach Java is that they do treat lots of things in the occasion. They have a lot of cargo co-practices This bit of code worked over here. Let's copy in here So commonly that has a form of say copying a static field declaration in as a local variable and that obviously doesn't work My experience it starts as an incantation and then in the educational process eventually the students are taught what they actually mean and So I think what one potential thing that they could learn from that is things that they see as Incantations are actually So very confident the audience that is that people will eventually learn what these concepts mean and they will they will eventually be taught what these mean Right at the start though. They don't know what it means. They don't want to know what it means and You can't realistically teach what it means at this point. So this is an incantation to them The problem is that they will then use those incantations for a while and they'll get stuck and when they stuck They don't catch up. So one of the other things we find in education of programming in particular Is that people get a little bit behind and they get a lot behind because there's just this constant building contents on each other So here's gonna be our first grace program The same program before but is in grace. This is also a valid Python program a valid pearl program This in particular is not novel or interesting in itself We've applied the same principle throughout the entire language as far as possible so that you don't have anything appearing in your program They are not personally right now ready to deal with as part of doing what you're trying to do One understandable semantic model. I said at the top that this was an object-oriented language So to keep our semantic model simple everything is an object You're an affirmative type. He's no anything else. Everything's an object Everything you can do with those objects as a method We have all these standard method types here. You can have a dotted method call You can have implicit flavors. You can have operators methods. We have in fixed binary methods and Prefects unary operators operate both those and field accesses are also They miss and send their method request the method calls What do you want to call them all of them go through the same dispatch semantics one at the bottom is the most interesting one here So if you're familiar with small talk or new speaker one of the language in that family You will have seen something like that before Otherwise this may be new to you This is one of the more unusual features in the language, but it's really useful. That's a multi-part method That's one method called between and that takes my arguments and does some stuff Well, let's just do something like this. So these are control structures of grace Yeah, if they now finish a while loop So if they now see it is actually a method call that is a method if then else it takes a boolean So the result of that expression x less than zero and then two blocks. So a block is written embraces there That's a first-class function a lambda All these things it's a bit of code that you can hold on to execute later not extrude all execute multiple times You give what you get an object everything's an object so you get an object that hasn't applied Yeah, sure So what we have at bottom is a while loop the while loop syntax is a little bit Unusual if you're familiar with other curly bracket languages and that's because we want to keep that semantic model simple. So while has Curly braces around the condition. That's because the condition is evaluated multiple times in Most languages while is a special case the special case in Pazza special case semantically you have this expression in the middle of nowhere that Keeps you multiple times for reasons that are potentially unclear to you So in grace everything that can be executed more than once or that may not be executed all is going to be a block That's going to apply throughout the entire language. We had the same semantic model everywhere No more questions. No good. All right, so Let's put different teaching orders So Among yours people like some people like to have objects first you make a bunch of individual objects And you have to talk to each other some people like to teach with classes first You have a class and then from that you manufacture lots of objects that all have the same code and they all interact with each other that Both of those are valid approaches. We don't want to prevent people from using you those They want to enable into either those but we don't make the language any more complicated. We have to so a class. In fact, it's actually just a bit of synthetic sugar for an object that Has a method in it that gives back another object So class of factories The other thing that means that the classes are not types so types in grace are structural They are just a set of method names methods parameters method return types an object belongs to that type Exactly when it has all those methods with the right signatures and if it doesn't have them then it doesn't belong to that type It doesn't matter whether Two objects are made from the same The same site they represent the same class same object literal It only matters they have the right methods So you can make an object belong to a type long after the type was created We can make a type that an object belongs to long after the object was created or far away or however you want Types really that so we have parameter types variable types with natural colon return types written after a little error The other neat thing here is that types are optional So some people like these types and they feel very strongly about that Some people like to teach without types and they feel very strongly about that There is little evidence to persuasively suggest that one of those is better than the other So we spoke both that gradually typed so you have type somewhere and Not type somewhere else. You have all types You can have no types if you have types in one part of your program and not in another We're an object pass between those that we dynamically check at runtime to make sure it's the right type So the certainly type code can rely on its static assumptions and the dynamically type code doesn't have to care about anything If it's wrong you get an error you hit me on your program. So that's fine We had a few tough choices to make and try to put this language together One of them is Simply are we building language to make teaching programming easier or are we making language to teach make you to teach make now To make teaching programming the right way easier that the right way meaning sort of the software engineering approach We say if you're taking programming What we really want is to have all fields all methods all everything be publicly visible and available by default If we're following the software engineering approach, everything should be hidden by default unless you explicitly choose to make it open So programming you have less concepts fewer concepts deal with in getting going Engineering you're doing the right thing in some sense It's not possible to reconcile both those in the same language so ultimately we decided that we would have a mixture to we would have Methods be public by default because usually when you create a method you want to go out and we have fields be Hidden by default because when you make a field, it's more likely than not to be part of the representation In both cases you can change that for a particular method of field and so on inheritance with objects is really hard so there's the Sort of obvious way of doing it, which is just delegate of prototyping. That's what JavaScript does that has weird action distance problems There's concatenate prototyping, which is what Kivo does which has weird self-capture problems weird virtual method cool problems Just weird problems, you know There's trying to duplicate what you get out of one of the other major languages that kind of thing That's also problematic But as it turns out a lot of people who are actually teaching Various courses have managed to tie their entire teaching approach to the minutiae of the ordering of The evaluation of field initializers and the scope of field initializers and constructors in Java or In C++ or in Python or in whatever language they're using they managed to build their entire approach around The fact that a field initializer runs before the constructor or after the constructor that it has access to make down calls to make virtual method calls to Objects that don't even exist yet. If we're cutting those off, we're going to cut those people off from applying the teaching style Actually don't have a good answer that we have been through a lot of ways of doing inheritance all of which are almost identical And almost every respect except the weird corner cases that these people have built their entire approach to teaching around So the whole bit that we're going to be able to support them by Some mechanisms other than inheritance because having multiple kinds of inheritance your language is not a sensible choice I think then we have a different decision, which is do we want to support one? Completely unified language where everything we've wanted to teach learning the same thing being taught the same thing or do we want to have? language variants where each Variant of the language particularly supports this student and their learning at this stage with their course with the instructor with the everything else those are also in conflict with one other and Both of them in some ways are bad So we decided to hear is try to support those variants, but try to support them in a very structured way That structure way is called dialects So direct is to clear the top of module you say dialect name of your dialect and that puts your module into that dialect That what that dialect can both extend the language is available to your module to your code Or it's restricted. They can say actually you're not allowed to write a variable declaration a type declaration not have a type declaration Extended I can say actually you have some I'm gonna Put you into my little graphical micro world I want to start out with a graphical micro world and then move out of it And we can do that within the same language because we had these dialects that will support the students all the way through Importantly, this is only per module basis not a global switch So you can have different modules in the same program all of which are in different dialects so the instructors code can be written in the unobstructed language and the students code can be written in a Specialized dialect that maybe only applies for this one week of their course of different dialect every week So that's neat So in fact, we started to embrace variation. So what we envisage is a giant lettuce of different dialects You think of that picture as a random sampling out of the middle of it. It's not important what's in it The idea is that you can start out in a lot of different places There'll be a lot of different things that you can learn first You're gonna have variables or no variables types or no types You want to start out learning about just simple straight line procedural code and you add some loops so on What can happen is there are all these different guys start out with and they all support what you're learning right now And you can zigzag through all the different dialects are available. So you start out with Just straight line code, then you add loops, then you add types, then you add something else So there'll be a lettuce of variants of the language each of which Supports a particular combination of features, a particular combination of things that people want to do and they can move between them At will so ultimately everyone ends up either in the same standard unrestricted language or they've gone beyond it they've There are some other approaches where you do is sort of a software engineering first approach where you have Pregnitions, post-conditions, loop and variance everywhere. Maybe you can do that and then you end up beyond the standard language So we can both extend and restrict the language. How do we do that? So extending language works by nesting. We already have the content of objects We already had the content of lexical nesting, putting one thing inside another. So a modular grace is just an object It's treated as being implicitly inside one of those object literals And so you can have methods and fields and straight line code to be screwed and so on The data declaration just takes your module and it puts it inside the module object or something else So you get automatic lexical access to all the methods that are defined in there So writing a dialect is just writing some methods that you want to be available and then it magically works Important part there is that you don't need as a to know as a dialect author how to deal with parses and compilers and all these other things that in general making this kind of language extension possible requires you to learn about You only need to know the language that you clearly already know because you are teaching it Hopefully, you know it and we have different dialects with different modules on silent and our module I up here is able to access module B C and comp 102 which are all written in different dialects, and that's all fine So it's extensional dialects languages that extend the language that's available. What about restrictive ones that take things away from you? The reason that we might want those is that The reason that we have those is that There may be advanced features language that should be hidden from the user Parts aren't really to encounter yet because of the teaching order. So to the end, I'm going to show you my favorite Java error This is real student code or a debt between real student code. It is a real error in it. I won't ask you what it is But here is the error message that is generated from this code a quick show of hands Can anyone tell how to fix a error from the error message? anyone No one could tell don't feel bad about that. That's a totally unreasonable thing to ask you But it's if anything a much more reason thing to ask you than is to ask a student who has just started programming a Month or two earlier. So what's happened here is the quite understandable error of the treats things in temptation They have copied a very good declaration into the body of an F. That's not allowed So Java the compiler head job see the compiler has decided that they're trying to make a reflective call on the fake class associated with the primitive type Which is something I didn't know you could do until I saw them do it That's not a reasonable thing for a student to be trying to do But it is in language because it is apparently useful in certain rare reflective instances that apply in your industrial strength code We are using reflection all over the place It's not something that's necessary for a student I think a student would come out of university and they would never have encountered that or never tried to that They may have encountered it. What happens when they can't this is a right-in doc class And then I get a different era and they up so far down the river hole that you can't tell how they got there So I'm grace firstly we try to avoid having those advanced features But I need really there are going to be advanced features that are just more advanced than what you know right now We've haven't introduced you to variables or loops or what have you and you've gone out in the internet You found some code and you put it in and you'll confuse about how it works That happens all the time. That's not necessarily a problem, but we want to support students while they're doing it So our diamonds can have a chicken method the chicken method gets run a compile time Statically or however you want to look at it and what it does is it is run statically given the parse tree or syntax tree of the client module and can examine it and can Print out warning messages can print out errors can reject it can do anything it wants We'll spread some helpers so that you can write those checkers easily So you write those in basically a declarative way if you have simple needs if you have really complicated needs you can write Entire type check isn't in fact the touch your grace is actually written as a dialect so you can do Really complicated things, but for the most part you only need to do relatively simple things But what you could do is some really neat stuff and give people an error saying actually you know You haven't been taught this this feature yet, or you are you haven't heard this feature, but you're doing it wrong Why do you look at section 2.5 of the textbook because I know what you're doing this week I know what you've covered so far. I can tell you exactly where you need to go to correct your understanding Right at the time that you've made the error So you don't have to go and talk to someone else heavens right in here right now while you're trying to write your code That's really neat So I said that we wanted to support different teaching styles and one thing that Happened in grace is that because we gradually typed we don't have method overloading. You can't have two methods with the same name and Have different things executed based on the type It's also an object-oriented language. So people who Organize their programs in a more functional inductives kind of a way They're kind of on the call by by general or languages. So you want to help with people out To the end we have a pattern matching functionality. The pattern matching is essentially let's take a bit of data. Let's examine it and let's Figure out what kind of thing it is on some axes and then branch based on that So this is an Example of a simple pattern match we have X a piece of data Which I'm just telling you is zero or a string or a student if it is zero We're gonna run the first block if it's a string and it wasn't zero We're going to match second block and I'm gonna print out any for the student. We're going to match it We're gonna extract The student's name the students ID with these student objects cooperation and we're going to bind them and make us available with code So this is for the if the has to use isn't here This is very like what you might do with algebraic data type and so on For the has to use is again. This is also magnetic. I'm not gonna tell you why but you can be happy about that This syntax is very much like what you see in Scala It's very much what like what you see in language that have it very deeply built in but this is actually just a method match case is method These patterns are objects that we have different methods available on So it's been built in without extending cement language just with methods and very tiny extensions to allow you to write those Those destructuring matches. Let's focus on just that middle block now So anyone there embraces s column string arrow print s So that is both syntax of a pattern match on Something that I'm hoping it's gonna be a string Then I bind to s and the sentence of a block that just has a parameter called s that is a string That's deliberate. We had the same syntax in both places because they represent basically the same thing because grace is gradually typed You is a wrong type object to any method out of any block What will happen is if it's wrong you will get an error and your program will die pad matching is a way of allowing the receiver of that object to Indicate non-fail lead that actually that wasn't the right thing for me. You should go on and try the next thing. So what happens is Match case will try each of these blocks in turn what will say actually they didn't match try the next one I did match great. I'm done We also do Mr. Patterns put pens inside each other again this sort of Algebra doubt type kind of thing this one here will match at the top will match a point that has an x coordinate of zero So it's on the the axis and That's by putting a zero the pattern that we already used in places the x the Well in place of the x coordinate where we could have bound the name Now the bottom of course combined pen together and say it's gonna be a point on the y-axis Or it's going to be a 3d point who is on the plane defined by this That's what the vertical bar operator and ampersand operators is I must match both pens Now both of those are the same operators that we use for types so in fact if you had something that belongs to both the Sequence and dog types then you could name that type as sequence ampersand dog and that would give you a strap That there was both of those If you use those as patterns, then you get exactly the same result So again, we had this consistency with what things actually mean we are even Whether you're using pens or not doesn't really have to matter to you if it's not something you're actually being taught about right now So how does that actually work? You can define your own Pens if you want and those are all built around this match method the mythical match that takes an object and it returns either a successful match I found match if it's a successful match. It says great. I matched. I have succeeded and here's why I matched the failed match I didn't match That's it. You can check what you got back and check what you can do with what you got back This is basically just a non-failed way of indicating error We can also use them at top there in sort of a Boolean context We can say if point don't match X then do something So that lets you use these features without necessarily having to introduce the concept of pen matching for different orders available to us it's simply a way of testing things that you could introduce at any point without necessarily having to talk about the entire Padmatching syntax or you can choose the padmatching syntax and not the rest of it I'm so support both of those because they both represent valid teaching approaches in particular the ACM and archival e work together to put out a curriculum for computer science courses and it mandates that students must be introduced to both functional inductive programming and object-oriented program at some point So we want to allow both those to happen within our language because as we know switching languages early on is a bad thing Now those of you who are familiar with JavaScript by language may look at the top part and cringe because you think truthiness is bad So in this case and possibly this case alone truthiness is okay So because in grace everything is gradually typed everything is structurally typed True and false aren't special. They're just objects. They have some methods What makes a Boolean is that has the right method of Boolean These don't have to be done about that. That's a fundamental part of language Well, let us do is say, okay, I had these methods. Let's call them if true and a false If I think I'm true and you give me a block of code to run I will run it with if true and I won't run out with a false Or vice versa if I think I'm false so in this case truthiness is not bad truthiness let us extend the language in a way that is Consistent and allows an end user to extend the language in a way that is consistent With their own teaching approach with their own library approach without necessarily having to pollute the rest language with Magical rules that define what isn't isn't going to be true Okay, let's talk about information and there are two Really complete implementation of grace they both support I think everything I've talked about here is mini grace which was primarily written by me Although also with some significant contribution to other people it's actually written in grace itself It's able to compile that grace code into both see that runs on your machine and into JavaScript that runs in your web browser The neat part about being written in grace and then able to compile it with the platforms is that we can then compile the compiler itself In JavaScript, so we can run the compiler in your web browser You can just go to a web page and you can type in some grace code and you can run it right there in your web browser In the client side without having to have any kind of server interaction anything else. That's really neat source codes available the There are tables available which you can either build or use to build the source code because of course you don't need heavy-grace compiler and You can go to that web front-end all those links are from that thing down the bottom that I've had on my slides. There's a hopper hopper is a an alternative implementation that uses a concurrent JavaScript Implementation style so it also runs in web browser or also runs under Node.js on your machine and it Uses this a synchrony to avoid one of the big problems that mini-grace has running in JavaScript The big problem is if you write some grace code that is say an infinite loop Mini-grace will quite happily generate you some JavaScript code that is an infinite loop and then it will run your and then Browser will be set Because your browser will keep running forever and it will never stop because JavaScript is completely single threaded There is no way that you can interact with the browser whilst running that code So you can't have a stop button to actually stop running now because that message will not be processed until your infinite loop has terminated which may take some time hopper works in a Different a synchronous way using a set of callbacks using the promises or what you may also know as futures System that is in JavaScript It had its own talk on Wednesday I hoped to point you to the video but it is not out yet But you'll be able to find that if you are interested in the techniques of implementation that Both these implementations are open source both of them support everything we've seen so far Mini-grace has been used and as part of a course for teaching grace to first year students at a university just a couple months ago now That went okay The infinite loops killer browser problem was a slight problem for them, which they did know about in advance But other than that things basically went okay. So the grace line has been used in reality We have some data on it. We're gonna get some more data on it as time goes on. Hopefully I Don't remember how American school years work, but whatever the next term as we hopefully need some more Okay with that, let's have a look at a Live demo the most exciting part of every talk with everything's going to fail So this is tile grace. This is a completely different thing than what we've really been talking about This is the grace language, but in the form of something that's more like say scratch so if you put it with scratch scratch if you're not familiar with scratch scratch is a Dragon job program editing system with a little graphical marker world We can have a little sprites move around the screen talk to each other character in actions any program by dragon job So I do something like this. Let's make a variable Let's call it x. Let's give it a value And this is all so far extremely like scratch If you ask me to scratch you'll probably matter rip them off Okay, I can run this and it's going to print out. Hello world. Which is great. Let's look at something a little bit more interesting Let's load up Okay This here is written in a dialect. This is a dialect that provides Movement primitives basically it gives you a total graphics world So we can write things in the micro world in a scratch flight dragon job way without actually having to use a scratch flight dragon job system That is restricted to a micro world. So run this and draw a little housey envelopey shape I can drag these things around these are again real We just need stuff here. So all these blocks correspond exactly to the underlying syntax of grace So in fact, if you just copied and pasted all text here, you would get a value grace program at the end Initiation the browser that we had but other than that you get a value grace program yet That's not an intended part designer grace, but it is something that kind of falls out of those principles that we saw earlier We want to have single names things simple semantics simple syntax And what it leads to do is quite neat. So I can click this button here And my tile code that I had there much like a scratch has now turned text so I can switch back if I want to And then I can switch back again So this is real text. I can select it. I can do whatever I could do with ordinary text here Let's change the program a little bit. So that's going to Turn right 45 degrees and then move forward 50 units whatever that is So I can change that text that's real text and then I can go back Into my tile view and my changes are still there. So run the program or now I do something different That is really neat. I was really pleased when I made this Uh so what this intensely you do is Use one of these drag and drop systems that sort of avoid the burden of syntax Is it gone to green? Okay, usually I don't turn the wrong way and I just go to the side of the screen and just come back It lets you avoid the burden of syntax that people have trouble with when they start out Which is one of the things that scratch is really good for But it doesn't leave you stuck in this world where you Know how to do drag and drop but you don't necessarily know how to program in general And you haven't you're not able to keep using that system for long enough to build up the little dex of t's that we require to switch from the language The idea here is that you have a deliberately permeable area where you can use both text and tiles switch between at will always understand that There's a correspondence between what you're doing by drag and drop and what you're doing by text So when you move out of it, you'll have some understanding of what's going on That's the theory of it We have then run a user experiment using the system to see firstly Will people actually use that ability to switch if it's there? So it's all very well. It looks nice There's no point in having it Let's come back to the slides So I ran the experiment at 33 participants. They were primarily students So they are All fairly young. I think the the modal age was 18 30% of them identified themselves as d-mail 70% identified themselves as male. They were I think the median age was 20 So that's the demographics And what happened here? We have a graph here of how many times each participant switched view as a histogram So we had two people who never switched at all Across an entire family did five tasks We had two more who switched once and then a big handful of people who switched multiple times So it appears that people will actually use this feature. It's available to them Other feedback suggested that in particular people actually found just the ability to see the same code in two different ways to be useful And would like to have that available all the time So that one is good. There is a whole bunch more experimental data, but I don't want to spend the entire time on that So at this point, I'm actually going to invite questions from the audience And we'll see how that goes All right Lot of time So the first question I have is about the graphical Language yep, and I'm very curious have there's anything actually be done to identify whether or not that is a more efficient way To teach people whether you could flip back or forth or not Do people pick it up More quickly if they have to tie back cane symbols or whether they're playing with lego. I'm Okay, curious. Yes. There has been some done and like much research in this area the results will be mixed Um A problem has come up Which has been basically the one the switching language problem people have a lot of difficulty learning scratch and they're moving somebody else Which is a bit of an issue They also often have a problem where when they're doing that even if they did have a pretty good grasp of stretch as soon as they find a difficult they Uh decide I can't actually program what I was doing before isn't programming and then that becomes self-fulfilling people do Pick this up in a sense of they're able to write small programs that do things fairly quickly So the original motivation was actually I went into one of the local intermediate schools so that's uh year seven eight so 11 12 year olds and gave a scratch lesson to them And they love it kids really like it they engage with it Much more than anything else that you see them do They're able to make small little games small little storytelling scenes for themselves fairly early on They they do need some help in doing so like it just conceptual help and what does this word actually mean sometimes But yeah that kind of approach it does seem to let people get up and running Faster and experiment more than a textual approach to begin with does It's not necessarily the best approach for actually I'm going to teach someone and they're going to move on to be a real programmer in the short term But particularly for children. It's fantastic. Yeah Um, thanks for your talk. Um, if you assume that this is good and um that It's the best way. What would be the expected take up rain? Like how long is it going to take to get through all the bureaucracy of unions and stuff and for have to have Unis doing it so at the language as a whole all the tile stuff. Yeah using grace as a teaching tool How long I want to get through um To get through all of them infinitely much time Um, there are still universities that are using Pascal language universities are using various kinds of lists not even record but just old-timey lists People are very stuck in the ways and they don't like to change So probably a very long time Getting it into some I think is More achievable in in the short term and then we'll see whether it actually works So I we've based this stuff on research and what we know about education We're very strong. It may turn out that when you use grace and programming Teaching for real actually everyone's bad at it and it doesn't look that would be sad, but that's the reality of doing things Without doing research I hope that we could get it into some universities So this has been uh built in collaboration between researchers at different universities So I would hope they can get them into their own institutions Relatively early on and then if it works out spreading more and more But I don't have time I The dialect stuff, um Fills me with trepidation. Have you got any data on how effective that is or because it seems to me like it's fraught But I wonder if you have any actual data on whether it's effective We have no data on whether great studies in particular are effective, but There are other languages that have used similar approaches spk was a language that basically uses a series of language levels to build up to I think pair one Record has a series of language levels as well. Those have shown themselves to be reasonably effective and not allowing students to Go beyond what they are supposed to know at this point when they're Um, when they're learning so that much has been helpful. I don't have research on Grace dialects in particular, but they work. They build on the same Concepts have been used in the past That's true. Yes. I have mentioned two languages that did not take the world by storm Uh, what has taken the world by storm is java, which is not a good teaching language I have researched the system was the jaguars on its way out. I have recent research that suggests that is not true It's a teaching language. Yes Surveys of the teaching language is used in different institutions python is up. It is not up at the expense of java Java is pretty much holding its own at the moment Um So the examples you've given so far are really great, you know Starting off the beginners with a scratch like environment and and all that um My question is uh, and you did say that this is designed to be a general purpose language and one of the things that In my experience engages students is also to be able to do something that's useful in the real world Uh, that could be for example to create an actual, um, working Uh browser app or a website or something. So, um, my question is does do you have, uh An environment for grace that lets the student do that sort of thing There is the ability to write applications that will Run in we have a moment. We have a sort of ide that runs the web browser. It's always used for that course. They let you write Uh, reasonably complicated applications graphical applications It doesn't let you do let's write an application and distribute it to people Uh, well, you couldn't see in some of your source code and they can run it, but I mean you could do that, but we do not yet have that in existence That would be really awesome. I think if There are also libraries for doing um I wrote a bunch of bindings to like gtk plus and so on that'll let you write graphical applications in grace on a native machine Which I just forgot about until right now, but uh, you could do that. We haven't Focused on that particular part of things yet, but that will come in time. Um, thanks When I was at university teaching uh, people who had a program and when we switched to java There was a lot of uh, there's a lot of buzz the students really liked it. This is a new hot language and and In terms of the You know attracting new students It seems that students like to learn languages which they They know are used in industry and and even when I'm not at university now But when we switched to python at the university who came to be a few years ago The some of the students were going like oh, this is a toy language You know I'd rather learn, you know something a bit more industrially heavy, but um, It strikes me you're gonna have a bit of a Problem selling grace to students because they'll say oh grace, you know, I want to Learn a program which everyone else is using on my mates of learning or whatever That's true. Yeah, that will definitely be an issue Some students really do want to come in and they just want to come in basically get a meal ticket And they want to go and learn whatever's in industry Uh On the other hand the universities in New Zealand say and look around the industry in New Zealand All the universities are teaching python and java Except one and all the industry is using c-sharp and visual basic So it does not appear that is in reality actually a significant problem. They might moan about it, but they don't actually Seem to stop coming in or care in reality I don't have a gun to the other than that. Yeah Um, you said that you can supply a check that goes through the AST and can Do basically arbitrary things to the to the students code Can you inject stuff into the tree as well? Like could you do things? I was thinking along the lines of if it's done more than 10 000 iterations You're probably best stop and pop up No, so you cannot modify the syntax tree when you do that It's quite deliberate because macros have turned out to be a bit of a problem in other languages And want to avoid that kind of complexity for that particular case though, you've run too many iterations You can in fact provide your own implementation of the wild look that says you have run 10 million iterations Are you sure you mean to do that? That's a totally reasonable thing to do and that's supported by the extensional behavior not by the restrictive behavior So the restrictive behavior can only examine things cannot change it The extension behavior can add new methods and then if you call those methods and you get those methods behavior Um, I'd just like to echo the statements. I teach introduction to programming at my local library So it's general public Everyone borks at using a language that's not In use if if they know it's a teaching language That's almost the point where they feel like they're being spoken down to As in some of these are mature age some of these are high schoolers and If you give them a programming language like That you're going to be using Almost the first question is where is this used and if it's not be used Um in industry or for real stuff They bork at it having said that do you have dialects like a python dialect or a java dialect or something like that All grace code all great any dialect produces code that is uh valid grace code You can't change the actual syntax language in to the extent of having a python system. You can change it to Here is the most ridiculous thing I come up with which is implementing an apl dialect We have some valid apl programs that also valid grace programs because we had operator uploading and so on You can't say okay, you want to write in python? It's going to behave like grace, but you can make things that are reasonably close now At the same time, um The on the point of whether it's a real language or not That is an issue that will always be an issue for every language one of the the problems we have is that When you use one of these industrial languages It's actually really hard to teach people. We have enormously high failure rates for students in You'd learn computer science learning programming in basically every context in every teaching environment everywhere in the world We don't have a good way of getting that across So a teaching language that makes it easier whether they think they're Doing better or not Is likely to actually help them and then once they've been learning their language for a couple of years Which is the level of learning that it takes to be able to transfer to a different language Then you can teach them a different language Whether they want to do that or not is a different issue and there's a marketing problem there I'm not a marketing expert The comment was if we have a good standard response, they'll be great and Was that a good standard response? And the response to my question was a general mere so we should probably work on that We will focus for a bit and put the marketing problem on it when we have one Does anyone have a question? I've got them So thank you so much Michael Homer and I hope all enjoy this pitch And here's a little gift for you. Thank you so much. Can we come back?