 It works, and we still have some, please, not forgetting to call the trigger, oh now we go, we have to start. Hi everybody, the next talk is given by Wunder Bauman, it's an introduction to PPCI, please give him a warm welcome. Alright, thanks everyone, so my fans are coming in, where are they, Hope and Alex? So I want to give an introduction to the PPCI project, it's a project I started a long time ago. So what it is, it's about the implementation of a compiler in the Python language. And as of now it contains several, I would say, architecture features for about nine different targets, and the only requirement to run this compiler system is Python, so that has some advantages. And it was also heavily in progress. So how did I start with this? At some point I wanted to write my own operating system, because all of the other operating systems were just not nice, so I wanted to start my own, and then I searched for tooling, and that also turned out to be not as nice. So then I started my own, and that's where I'm stuck now, or busy with now. So maybe a little bit about how does a compiler work, more or less, is high overview. So a compiler basically takes a source code and translates it into machine code, or some other code. So first you have, say, some checking of the source code itself, it's called lexical parsing and then checking some code. Then from there it is ER code is generated, which means intermediate code. And this intermediate code can be optimized with all kinds of clever tricks. And then in the end the code is generated for a specific processor, so then it again becomes, is translated again. So there, of course, exists a lot of compiler projects already. So you have all the phases of compilation, and here are some project listed. It is, of course, not complete, but it gives you some overview. At the lower part you see the more conventional compilers, they're all written in C, C++. There are some compilers written in Rust, and at the top I put some projects which are implemented in Python. And you see that the PPCI project goes all the way, so from frontend to the linking as well. So in that sense it's quite unique. And also I was wondering why are compilers implemented in C, C++, because it is such a difficult language to program in, you make so many errors, and it really sees a system language. So why do we do that? I don't know, I think, for example, Rust or maybe, I don't know, Go is a better language to write a compiler in, since it's really an application. It's not an operating system. But I think it is historical. OK, so writing a compiler in Python, why would you do this? I mean, obviously there are lots of better working choices in C, C++, but still there are some benefits of having a compiler written in Python, and that is it's easy to install and arguably it's better to, easier to understand as well, since that was one of the ideas behind the Python language that it is easily to read, whereas C++ or many other languages are pretty hard to understand. And it is also pretty portable because when the Python interpreter is ported to another platform, you can as well run this. And of course it's fun, so, yeah. So the demo I want to show you today is I got two contributions from Almar and Michael, and it's about one contribution is support for WebAssembly, and the other one is the support for RISC-V. So what is WebAssembly? In a nutshell it is a portable format for the Web. So the idea is that you can create a WebAssembly module and run it in a Web site. And it works in most browsers actually, so that is pretty nice. And if some people still remember the 90s where we had this Java applet, I think it is more or less comparable to that except you don't need the plug-in. But the code you have in WebAssembly is still portable, so that is very good. Then RISC-V, what is that? If you don't know that, it's an open source instruction set, right? And it is like the ARM processor, but then without the license fee, that is very nice and it is also open source. I think also there is another death room here about RISC-V. So this is the flow I want to, or the demo I want to show to you, and why WebAssembly is maybe also beneficial not only to the Web, but also for embedded systems as well. So the flow that we have here is we have a piece of code and we have transformed it into WebAssembly. Now it can run in browsers, of course, and that is the top flow you see here. You take some WebAssembly, then you still need some HTML files in JavaScript, and then you can run this file in Firefox, and you see the output of your WebAssembly code. But now, what is also possible, you can take this WebAssembly code and compile it, we'll do it in this case of course with PPCI project, and compile it to the RISC-V machine code and run it on actual hardware. And the fun thing about this is that the WebAssembly code is the same. So we have the same code actually running in the browser as on the hardware itself. For this hardware setup, which was mainly done by Michael, is that the Pico RISC-V core is used, and then with a virilator you can create a simulator. I didn't know that yet, but that works pretty nice. All right, now let's first start this. I will first show the source code of this. What is the function I'm going to use as a demo case? It's a very simple function. It's the faculty function. So five exclamation marks means five times four times three times two times one, and it is 120 or a hex, it's 78. You can create this WebAssembly module with the Wasm Fiddle tool. It's an online tool which you can fiddle with WebAssembly basically, and it works pretty nice. So I will now show this faculty function as it looks like in WebAssembly. So this is the WebAssembly, so it's a sort of an assembly language as it will look like. This is a text form. You also have the binary form. I will show that as well. So that is this file. Okay, that doesn't work. So this is the binary file, and as you can see, the binary file is also pretty more compact than the text version, and that is, of course, for the Web. That's very important because we have low times and we want to reduce all the loading time. But next to this Wasm file, there's also a demo page, and this demo page will load the WebAssembly module, as you can see here. Yeah, it is mainly, you have to write some HTML and JavaScript to actually load this WebAssembly file into memory. So now what will happen if I open this HTML document with Firefox? Right, five minutes left. I have to hurry. You can see here I printed the WebAssembly format on the left and on the right you can see the output when this WebAssembly is run. So now the WebAssembly module is run in the browser and we see that five faculty, we still remember it is 120. So what we actually do from JavaScript, we invoke this function and print the result back. So now I want to do the same with on the RISC-5 processor. So for this I made a script, and here you can see how you basically can use the PPCI project to load WebAssembly and also generate code using this. So first some utilities are imported and then we have object one, which is of course some glue assembly logic. This is then RISC-5 assembly of course, not WebAssembly, so it's a detail. Then here the WebAssembly module is also taken to an object and then we have three objects, the startup, the glue logic and the compiled WebAssembly. And then it's all put together and put in a hex file at the end. So we'll now try to run this and hopefully it will work. What could possibly go wrong? Now it created a file. As you see here on the bottom a firmware hex file is generated and if everything is well it should be possible to run this with the Pico RISC-5 simulator. Yes, and as you can see at the bottom it outputs again on the terminal the same code as we had before in the browser, but now running on a target. And yeah, some backup slides. That was it, so thanks a lot. If you have questions I will be here. Okay, thank you very much. If anybody has questions you can also ask them. Now you can raise your hand and I'll come by with Mike. Well, thank you very much Wendel.