 Welcome to Emerging Languages Camp 2010. News Speak by Gilead Brockett. I'm going to tell you a little bit about News Speak in 20 minutes. So in now 17 minutes and 52 seconds of News Speak. So we better get started. Probably speaking it's a dynamically type of class-based language. That's the category you're all familiar with. You can make a Python or Ruby or more pertinently. It's called Altoc, which is a direct ancestor of News Speak. And what makes it different for all these languages are a couple of unusual properties. Basically the fact that all names are late bound is a fairly unusual property in most languages. The fact that there's no global namespace whatsoever is also pretty unusual and the combination is the intersection of those. So that's fairly different and it leads to some interesting properties. In particular it seems to give a fairly minimalist way to achieving a bunch of important goals. Modularity. I don't know what you think, but except for the language formerly known as PLT Scheme I'm not aware of a language that has anything that I would recognize as a real modularity. They're not called Racket. Security of, you know, we're entering a world of cyber warfare. It pays to actually think about this a little ahead of time. A reflectivity you all know and love, things that make languages actually dynamic and of course reconciling this with security is sometimes a bit of a challenge and we do want to play nicely with the rest of the world. So the thing to the high little bit about News Speak modularity is that it is based entirely on the concept of classes. There are no modules, units, packages, templates, features, what have you. Basically classes nest and do not think of Java nested classes. And basically you define the top of the class as you explicitly define the module and you put libraries and stuff inside the back. We'll go into more detail. So let's talk about these two unusual properties. All names are laid bound. Another way of, this is something I've been calling message-based programming. Again in the small talk sense more than in the asynchronous sense though asynchronous messages are part of the master plan too. Basically every runtime operation, every name is a message then where if you prefer you can think of it in the absence of asynchronous calls connection as a virtual method. So another way of putting this, this enforces programming to an intermix. Programming to a net, this is kind of a slogan everyone hears but in most languages you can't actually do that. You'll find that the language doesn't allow it in certain cases and in other cases it's just too painful to do. So for example we never refer to variables directly. It's not that we don't have variables, we've got the slots but the main point is you are always talking to by means of a getter and a setter and that doesn't mean you have to define properties or use a lousy syntax or anything, it's just a fault of natural. So your code never cares including code in the class itself. It never cares how you actually chose to represent your object. More interesting is what happens when you're bound with classes because again you can't refer to them directly because everything is really just a virtual method call. So you're basically always accessing your classes by means of access or methods of getters which implies for example that classes have to be first class because you can't go back for yourself. It implies a whole bunch of other interesting properties that usually would have to be features that you're so planned to put into your language. For example, classes being virtual, right? Hopefully I don't know if everyone's familiar with this idea but if you nest classes, the nested classes can be overridden just like methods can. And in fact, you can override a class with a method that contains a class dynamically or a slot that holds a method in place per se and nobody cares because they're all going through a procedural interface. So virtual classes just fall out automatically from this idea of late binding. By the same token, we get mixins for free, right? If you define a class, you define it. You say what it's super class is. Since the super class is in fact late bound, you cannot actually tie the body of the class to a particular super class. It's always subject to override and we may be a little more convenient to do that. And therefore you can do neat things like class hierarchy. So you'll define an entire library nested or framework nested within a top level class and you can subclass that and if you want to say to change some attribute to the entire hierarchy you override the root class of that hierarchy and just change that and now you have a league library. So all of this, the thing from a language design viewpoint the thing that's nice about this is that none of this had to be designed in as a feature. It falls out of these four properties. Let's talk about the absence of a global namespace. Again, this is largely about modularity. And so as I said, top level class defines a module. It essentially does that because there's nothing for it to refer to. There is no surrounding scope. There is no surrounding namespace that it can refer to. So technically it doesn't really have external dependencies. Which bothers some people because it isn't, we've been programming with these global namespaces for so long that we tend to forget that there is really no such thing in the real world. But the issue is how does the thing actually do anything useful? How does it connect to the world around it? And the answer to that is basically going to be the class as a factory method when you instantiate it and pass parameters to that factory that is the only connection to the outside world. And so this makes for very self-contained modular definitions. And because there's no, yeah. So these are upwards reductio problems with that, which is quite literally someone have to connect to the outside world. And it seems to be here again. The short answer in 20 minutes is tooling, and I can show you exactly how that's done. Yeah, this is exactly the point, right? You have to have some place to stand on that. It does bother. Okay, so anyone who knows anything about things like OSGI and the Java world knows how incredibly heavyweight and complex it can be to achieve the goal of having two copies of the same library configured differently, running simultaneously. And what enormous amounts of machinery and effort have been put in to make that happen. But we have an object-oriented language as a mechanism that does just that, means instantiate objects. Because the entire library is defined in the class, you create two instances and you create two parameters and you're done. The other thing to remember is that there's no static state, there's no globals, and there isn't any state associated with the class definition per se. It is just code. So there are, essentially the module definitions are truly immutable values. And all the state is in the instances. Therefore, if you create multiple copies of these things, they do not step on each other unless you go out of your way and somewhere out in the tunnel have fed them on the state. What else? Multiple implementations, right? Because we're talking through everything to an interface, the whole library is now encapsulated in one object. We can have multiple, distinctive limitations, completely different parts. Our combinators, for example, have pack-wrapped implementation, another kind of implementation, or whatever. You can have different algorithms, and as long as they preserve that external interface, they can coincide and nobody cares if you write the code and spot more people for both of them, etc. All of this just falls out from this model. So a word about security. We are somewhat concerned about this. And the nice thing, again, that this approach gives you sandboxing for free. Basically, because a top-level class sees no names outside itself, because it has no connection to the outside world, the only thing that they ever get are parameters to the factor. Those define your sandbox. They are capabilities in the sense of the object capability method that Martin can tell you all about, and may tell you a little bit tomorrow, but probably won't. And that's a foundation of our security system. Not to say that we have a secure system, truth and advertising, we're running on sweet. But the language is such that you actually have a hope of making a secure system without boosting it too much. So this is security and reflectivity are kind of intention. And so what we do, we use an approach called mirrors, that I think Dom might mention tomorrow, or later this afternoon. And basically the idea is rather than what you're used to from small docs, C logs, Java, whatever, where objects, they tell you their classes, their classes tell you their methods, and there are other features they have, and therefore you can respect on them, and if you're lucky you can change them. The idea of mirrors is to separate that kind of capability into a separate object. And so having an object doesn't mean that you can necessarily tamper with its class. Because of that you can now pass those mirrors independently as capabilities, which basically means that if you don't give anyone any such mirrors, then the thing is a lot of the collective is a foreground. Dead to the world. And you can make it as flexible as you want. You can give it a mirror that will change the class of an object or whatever thing you wish to do. And in principle, you can control the granularity depending on the mirror API anywhere in between and give very fine way of control. Again, something to be demonstrated in fact as opposed to theory, ongoing. Interoperability. So again, all of this is just basic object oriented programming. We don't have a feature in the language or external calls or natives or anything like that. But you can interact with the world and what you need is an alien, a foreign object. And these objects will essentially encapsulate the ability to talk to some other systems. See aliens, objective see aliens, Java aliens, script aliens, whatever alien world you wish to talk to. And you can do follow backs by using closures. And you can have multiple foreign classified essentially two of these different aliens. And again, has the same property. If you don't want someone to policy, you don't give them an alien. Unlike say Java where all the security guarantees of the platform are null and void if you pollinate it, because you don't know what that native will do, you can actually prevent any, you can know for sure that this thing is not going to be able to pollinate it because there is no language features. So we're running a kind of schedule which is good. What's our status? Well, we have a fairly real system. We have an IDE written in USB. We have GUI libraries, the whole graphical stack written in base libraries and stuff like that. Still somewhat in transition from its sweet basis, but by now most of it is in USB. This is what it looks like. And you can download it at USBlanguage.org. It's open sourced under Apache 2.0. What else shall I tell you? There's a bunch of material. If any of this interests you, you can find quite a few documents, tutorials, videos, audios, et cetera, blah blah on the site. You do so, you are an early adopter and you have your own risk because you preserve the right little change of all kinds of things and all kinds of things that's still missing. But at least on Windows, you can do substantial stuff with it. We have a version about the web, not the long. We say conclusion. Overall, the language design point here is that there's a whole list here of things that really fit together very naturally and I've talked about most of them with the exception of currency where actors are again a very natural fit here, a pluggable type system that actually fit in here very nicely. But all these things, because they all stem from this basic idea of using a very strict and austere form of object orientation, they don't require a lot of mechanism. So it's really a very, very simple language. And some credit for the people who helped me build this and for the volunteers who are now, these people are crazy to do this anymore. Hopefully I haven't forgotten anyone so this gives you some scale and some of these people have done a little bit and some people, particularly Ryan, who started working on this when he was in high school and just finished his freshman year has done more work than anybody else. So these people have really helped him. And yeah, that's our slogan. And if there are any questions, we've done it in less than 15 years. Rich. You talked about programming to interfaces. Are interfaces first class? Interfaces are not... There is no... This is dynamically... There is no notion of an interface. You could obviously build a sort of reflective representation, but there isn't any such thing really to be this way. Were you considered using prototypes? Yeah. I did consider using prototypes. I'll give you my... I'm somewhat known and to be a little bit opinionated. So I'll give you my... Prototypes are great for the language designer. They give you a... They're more simple, more basic calculus and it's very attractive. I have not found it particularly attractive for the program. And there were also very mundane reasons. Like this had to be up and running in three months and so forth, which made it easier to take SWEET as a point of departure. But moreover, I am not a fan of... What are your plans for the implementation? Okay, so currently it runs on SWEET and this was again the path of least resistance there. Frankly, there's no easier way to get because of its basic... Certainly at the expression level it's pretty similar to a small dot. A small dot engine is actually a very good point of departure. There were all these things about which licensing. There were various reasons why we started. Having said that, I would like to run on something else. So if... There's some people looking at like JVM implementations and with the dynamic, et cetera, that's beginning to seem more plausible but it's still missing a lot from my perspective. But maybe someone will do it. We're more interested in getting it to run... There is a compiler to JavaScript that's a compiler module of bugs that we have not ready to release by any means. But compiling it to JavaScript is really where I think it's interesting. And we rely on former colleagues to make that work fast enough that it would be attractive. Any other engine that someone actually is willing to work for again. But right now it's mainly this weekend focusing on getting to JavaScript. Back to you. What was the last thing? I want to acknowledge that because the build-on interface system is complete. Are you carrying that idea? Okay, so... Information is actually fairly easy. Information is cheap even though propaganda may not be my expertise. But still, there's a fair lot of information. It isn't...Squeak is an image-based system. We're not married to that idea. In particular, Newspeak has a textual representation. Newspeak can go into a regular source code repository and all that sort of thing. It has a syntax, not just for expressions and methods but for classes and the whole thing. So that would probably happen in a way that the key issue is to get fully bootstrapped such that we can divorce ourselves completely from this weekend. So the domestic classes as a module system is brilliant and in retrospect obvious. And Beta introduced this idea. So my question is really is I'm not going to study Beta closely. Has it been sitting there secretly for decades and we've just all ignored it? Or is there some key thing that you added to make it work? I think the key thing is no global names. First of all, yeah. The domestic classes as a module is totally obvious and totally obvious to many people and when you look and see how to try to actually make it work, you tend to get stuck because even though it's totally obvious, it just has to be just so to actually make it work. Late binding of the classes, I'm not sure how essential that is, but yeah, no global namespace. Because Beta didn't try to... So Beta almost got there. Yeah, but they didn't really try. Beta just fragments. They have their own view of the world, right? And I think I have 14 seconds so I'll take off now. And you won't talk to me later. Thank you very much.