 So for those who attend the first talk in this room, I want to remind a few couple of things, which are the kind of conduct that we have, especially for the room. It's different from the first one, so I encourage you to go on the page and read it out. If you're a developer, you will love to know your opinion and try the survey from bit.ly-slash-forcedon-17, all in upper cases. And from all your presentations, I encourage you to try the nightly version of Firefox, which can be downloaded from nightly.mozilla.org or mozilla.org-nightly, whatever is easier for you. And we are trying to find out what motivates you to contribute to open source. So I invited to complete another survey. We always survey these days at bit.ly-slash-why-open-source. Our next speaker is Nicolas Trani, and he's one of the Mozilla lovers. And one of the few French people that really understand what G-A-P is, I don't know, I'm feeling bad now. And also he created the APA app, so we're using Spider-Monkey and the server since 2006, without 16, six only, a long time. And he likes to ride a unicycle motorcycle. Welcome. Hi everyone. So today I'm going to talk to you about the hand-bearing and maintenance of Spider-Monkey on last five projects. I'll talk quick in the introduction about what is Spider-Monkey and about our team. I'll show you a kind of simple example, maybe a Spider-Monkey. And then we'll see what's coming next. We have thousands of bindings inside the project, and you have to maintain them and the thing that is going to be for you. And finally, last we'll see how to make a bigger life easier by making bindings more easily to implement inside your project. So, if you don't know Spider-Monkey is our front JavaScript engine, it's how you, it can be used in standalone projects to have JavaScript future bindings to a project. And it has a simple space API, a nice, very nice team, and very good performance. There are people who believe that the maintenance is faster than Spider-Monkey, but I believe this is not quite right. And if you don't trust me, go and see ourfastyet.com and we'll see that Spider-Monkey is quite fast. And our team, I've been working with two very talented people for the past 10 years, and first we will build a project called the APE. By the time, it was allowing you to do real-time communication inside the web browser when WebSocket didn't exist yet. And this was quite irritating, but now there's WebSocket and Monica about this one. So, we decided a few years later to build something else. We built Medium. Medium is a general purpose JavaScript engine and rendering engine also. I'll talk about that a bit later. As you're building Medium, we had a great opportunity to try to approach an environment. A company called Conker, we did a real-time building server which is used in advertising market. And the server would have to handle a billion request every day, something like that. And we tried it, we've built it with Medium and it's really great. So, a few years later, we decided to open source it. Actually, it's been something like six months it's out for everybody. So, we'll see a simple element. So, the idea is just to create a JS object robot which takes the names as the first parameter and which has one method, each method. And when we will call this method, you should see something to be printed and like generally, hello world. And here are some simple code. I don't think you can really see what is going on here but this is just to give you an overview. Here are the decorations you need to do to in order to get your bindings done. The first thing is to declare what we call a JS class which has various information about your JS class. Then we have a list of the functions used inside your robot object. Here we have one method which takes one argument. Then we have here a robot structure. We will use this one to store the name of the robot to make sure we try it in the echo method. And then we have two functions to do one which is the constructor of our robot and the other is the echo method. Let's see what this method is, that's function arguing. So, the constructor is starting by doing arguments, checking an argument conversion. We just check we have the right number of arguments and match the type we're expecting. Sorry, we're not doing argument conversion here. We're only checking we have the right argument. The second part is about actually printing the JS object and storing a pointer to a robot structure which stores the name inside this JS object. And the last part of this code is actually getting the string given to the constructor translated to a C string and store it inside our robot structure. There's not much more in this constructor. The second part is the echo method. Here you can see that just like for the constructor we have all sorts of argument checking. Then we'll retry it in the pointer to our robot structure which stores the name. So, we can then print, sorry, we can then convert the given argument, the string we want to print and print also the name of the robot. This is not even complicated, but now imagine you have a lot of bindings to write and I'm sorry, I've been a bit too fast. You can notice in this short example that we have, it's essentially a boilerplate called what you will just make sure the argument is a correct type, et cetera, et cetera. And you will spend most of your time doing conversion between JavaScript and C or C++. And this is not really great because, you know, you get quickly borrowed. As standard, just the example here were incomplete. There are missing a lot of stuff like the JS engine initialization, there's been a bunch of errors taking. I made the example short to fit inside the screen, so. There's no JS exposure, so our object is not right now, they're over to our script and they're no JS finalizer. I just needed to show a simple example. So, now what's happening? We have thousands of bindings inside our project. Well, as I was saying, we will quickly get borrowed by writing boilerplate code and doing conversion. It's very error-prone and you can easily make mistakes and your stuff will not work as expected or crash on, I don't know. When you have thousands of bindings also, you can see that's quite a lot of code for not that much and you have to have the spelling key. There's a new release, spelling key upgrade. There's a new release over six months now and each new release brings some awesome features but also brings a big change and your code will break. So, you have two updates, you have thousands of bindings and all the argument checking, conversion, et cetera to work with a new version. And this can be quite time consuming when you have, well, you want to upgrade. This example was quite simple but when you're working with more complicated stuff like asynchronous code or multi-fling, you have to get to deep understanding of how a spelling key is working internally if you don't want your code to crash or sort of like that. So, also, we didn't see this simple example but which will arrive at some point when you do your binding is that it can be tricky to correctly handle your GMS Object Life Seeker and make sure it's still alive and it's not garbage collected when you don't want it to be garbage collected. Something we don't talk about actually is about documenting your GMS binding. Most of the time people put documentation in their source code but when you're doing bindings, it's kind of all to write the documentation for your GMS binding inside the C, inside the C file. But it's not all, as there's also other issue if you really want to do, to embed Spiderman inside your project. What's happened is that most of the time everybody wants more than simple GMS. You know, when you have Spiderman monkey, the only thing you'll get is really basic GMS paper. You have no timer and nothing, but mass date and that's pretty much it and all type and structure, but that's not much more than that. You'll need, yes, as I said, timer, circuit, file system access, eventually modules, W facility. Usually when you start doing this kind of bindings, you will introduce new sub-party libraries inside your project. So then the program will be to build all of those sub-party libraries because if your product support different platform or configuration, it will be different for each platform and configuration. Most of the time, well, most of the time you will have different work or building script for each platform, but it can quickly become very hard to handle because everybody needs to be updated also as we go on internal. So it's hard. So how can we make a new life easier? Well, the project we've been working on in the medium came out here and with something called Ideal, that works that a bit later. So quick word about medium. Medium is a general proposed JavaScript runtime and vendor engine, what is this? That's built in top of Spider and Key. We have two applications, there's medium server, which can be somewhere compared to what is not GIS, but with less virtual, let's be honest. And we have medium frontend, which is basically a window and you can draw inside it using Canvas API. But it's a bit more than that because you have Canvas API, OGL API, OGL API is also a layout engine inside. Just to be clear, this is not using HTML or anything like that. We just took Spider and Key and made binding for it and be able to render stuff on the screen. So for Android, this is what may interest you more. We have two library, two software build on top of this library, leaving them crawl, which implement a method and send some basic bindings, like soccer, for soccer, HTTP file, module three, and all the stuff. And we have little bit more which implement bindings for Canvas, OGL, OGL, and a few other stuff too. We also have a bunch of tools and all kinds of projects to help building all the server party. This one is called Constructor, it's a people script that will invoke different build scripts of your different server party libraries. The great point of this Constructor is that you have all the build steps inside the same pit and file that will invoke the right commands. And it goes by this caching, so we don't have to build all the server party every time and it's make building all the server party for different platform or configuration much more easier. As the second tool, while helpful, we have is commit class mapping. It's a C++ header file, which allows you to easily map a C++ object to a JS object. And while if you use class mapping, you will still have to write some bullet paper like the argument checking and type conversion, that's your object life cycle that will be automatically handled. So if one of our object is garbage collector, the C++ class will be distributed too. So it's allowed having many issues with garbage collection. So that's a simple case. We also have an experimental super for DevTools, which allows you to connect, I have to my Google Chrome DevTools, I'm from Inezula, but it was a bit harder to get this right, so we started with Google Chrome. Right now, it doesn't support a lot of stuff. You can inspect JavaScript object, print stuff inside the console, but that's pretty much it. But in the future, we are really looking forward to helping to get the IPA done so you can interact with the dev object point and et cetera, all this stuff. And the next thing that I was talking about here is IDL. Well, let's see what's IDL are. IDL stands for interface definition language and it's, I want you to describe your IPA. So here's a short example. The interesting part is that we have a constructor, I already said we have a constructor that is taking the C string and we have the echo method, which also is taking the C string. You've probably won't see a bit later how it works on the next slide. You've probably heard of web IDL. They are used by Chrome, Firefox, Safari, and they use web there to generate their bindings. The great thing about generating your bindings is that you will no longer have to write boilerplate code and all the other information that's taking et cetera will be ended automatically. So that creates a view a lot of time, especially when you're willing to update Spider-Munkey since you will only have to change your password code to generate code compliance with the new Spider-Munkey version. You want to upgrade too. Something great about IDL is also they are easily extensible so you can build some whole own flavor of IDL with what you require inside your project. And what we like about this is that IDL is a great place to put your documentation in it. First because with the IDL code we have here, you'll be able to automatically generate the basic information for your documentation and you will only have to write what's in the description of your function, sorry, and arguments. Before talking to you, that's bad, but there's no two are available out of the box for doing this. All the browser has their own IDL processor that is making the bindings for us, but there's nothing available for embedders. Well, let me try to bring something. So it's very experimental, it's not quite perfect yet, but we are working on it and we really hope that during this year we'll be able to get something that is working right. Let's see the simple example. So as you can see here, we still have the IDL code and we're going to give this code to the browser. It will generate us a class here, so I don't think you can do the class, I will give you a general idea of what it's doing. So it will generate a GSForget class and this class is extending class method. As I talk about here, this one will handle various stuff, like your object lifecycle. And then it's also extending a GSForget base which is where is the embedder, where is the actual implementation. It's on the right, but we'll talk about it a bit later. So on GSForget class, this is only generated code. Here it's just a little file, but I didn't put the generated code because it's way too big. So the constructor here will only be invoked when the GS object will be created. What's this? This is, sorry, we have three static methods. The first one is the actual constructor that is going to be invoked by the GS engine receiving all the GS arguments. The implementation of the constructor will do all the type-changing element conversion. It will then call the constructor of the GSForget class which will call the constructor of your implementation, of the embedder implementation in the GSForget base class. We then have the list method, which I think is the method that we're going to object. So, this is very specific. Then we have the register object method which I will be to expose your GS object to the JavaScript engine. You can see that we have expose equal class. This means that we'll have the robot class, GS object, available inside the global GS object. So let's see to what's looked like the embedder implementation. But you will have to write. And you can see here it's way, way, way shorter than doing binding on your own. One of the great advantage here is that you will receive a C string when, well, you will just have all the C arguments, arguments that you'll have to see in all the method of our constructor. So it's quite easy to implement our class. We have the constructor that is using the name and we just save the name inside the property of the, of our GS object-based class. The name are around here. We have a distrutor that is going to be colored when, as I said, the GS object will be deleted. Or if you delete your surplus class, your GS object can see a little bit coming in the method and it will raise an error. And here the distrutor is only for the name. And then we have the echo method, which is way more easier than what we saw previously. It just do a print-off with the name of the robot industry we have. So as you can see, this way we can really make our life way, way more easier when you have to handle a lot of bindings inside your project. If I could sum up a bit all of the things when you, but yeah, when you embed Spindling inside your project and you need to add bindings into it, the first thing you really have to do at all costs is to avoid doing, avoid doing binding by yourself and use abstraction as much as possible. So you can use the idea, even if it's not finished yet, but maybe in a few months you can use it. Otherwise you could use my class map, either fine, or you can write map rules or, I don't know, whatever suits you, but avoid at all costs writing your binding yourself. Always use Spindling to the best beards. This is something very important. Spindling here has a lot of subtleties and you really have to understand what is going on under the hood sometimes. And when you use Spindling to debug big, you will have a bunch of assertions when you're doing something that is not quite right and this will help you to catch but way sooner than otherwise, than the other way. There is a feature called the GC0 which will actually run the garbage collector very much more often. And when you have issues about garbage collection with your object enabling the GC0 will help you to really see where your issue are. It will crash pretty much as soon as you do something that is not good. Well, when your stuff is not correctly loaded, sorry. I'll get Spindling here through the interval because if you miss a release, then the steps needed to get the next release inside the project will be higher and you will need much more time to get it worked, to get it inside the project. So, try to upgrade Spindling on Moomki every six months at every release. You'll get a nice feature, performance boost, and well, well, that's it. If you need the app also when you're doing the binding, people are for the Spindling here, really great people. They're always here to help you and always here to give you good advice and over the past 10 years, they help you have so much time. I can thank them enough to be there and be easily reachable. This is what's made us use Spindling here, actually, because I mean, some people we can really talk to and that can help you to understand how Spindling here is working is really a plus when you're doing your own project. That's it. I don't know. How much time? Okay, great. Okay. What? Sorry. There are all the content, three concepts that are available at www.getup.com.medium.com for them, and you can find a project on www.getup.com.medium.com or www.getup.com.medium. Any questions? Wow. Okay. Did you understand something? No? I see from the looks that they are like, wow, something like that, some of them, some of them. Okay. Thank you so much, Dan. Thank you. Bye.