 Thank you everybody for coming to to the talk. Thank you Lyon for for the introduction As Liam mentioned, we are now at being work at the office of the of the CTO Which may surprise some of you being where has traditionally being an infrastructure company Pioneer some of the Foundations for you know, what is the cloud now with visualization, but it's not had traditionally rich developers and and that's part of what we're trying to to change from the inside a lot of people Believe at being where including ourselves that WebAssembly is the is the future of Infrastructure is gonna play like a big role and we're trying to to make or or or part on on making that happen It's a small team about five people It's only two of us here, but a lot of what you're gonna see today has been like a group effort As Liam mentioned we we have a background open source I was smiling through the previous presentation. I I contributed to to Mona about 20 years ago I was a module to connect Mona with Apache so you could run a speed on it You know back in 2002 or 2003 and in a way what we're gonna be Presenting today is is related to to to that both of us have background in what we call now cloud native with binami we created cloud images and Helm charts and and containers and if you take a look at what is the definition from the CNCF around cloud native it includes service meshes includes containers So, you know, it's microservices and if you ask me like a couple of years ago I will holohat really agree that if you're building like a modern application You're building a new application. Of course, you're gonna use containers Of course, you're gonna deploy these on on Kubernetes because that's that's the way forward But the more that we got into web assembly the more that we have been Looking at these and what's happening the more that I realized that it's one way of creating modern applications And that web assembly itself is opening a whole variety of new ways of Deploying and building and and creating modern applications The first one that is how ever the arena we got excited about web assembly is building desktop like applications and bringing functionality that used to be very compute intensive and Normally you will do in your own device. You can bring that to the browser and that can be Porting an existing code base like Google Earth or you can embrace these from up, you know The get-go kind of like what Figma Figma did right and hopefully that's also bringing This you know recent Figma successes are bringing more people to pay attention to kind of like the underlying technology That they used to to get to that point A lot of the companies here including, you know, wasn't cloud Fermion to worry tell they are pioneering a new way of doing things in in the edge around serverless and taking advantage of all the capabilities of what assembly in that regard that we have seen in the previous talks around isolation zero call starts and to kind of bring a different Flavor of serverless that doesn't necessarily need to use Containers or in many ways benefit from from not having that over here and finally there is also a new crop of Recall modern embedded applications and probably prime video and Disney plus are two of the examples These are streaming applications that need to run in a variety of devices that in a variety of different CPUs typically very constrained in many cases not even running Linux and they have been able to leverage web assembly to solve a lot of the portability problems or the Portability overhead without sacrificing performance and today we want to add a new category to to To that list and and kind of following in the on the footsteps of the previous percent that have talked about You know ways that you can bring Java developers or a way that you can take the don't let community You know forward to web assembly with place or we would love to bring Traditional web developers. There's developers that are building applications with PHP with Python with Ruby to the wall of what assembly and You know, why are we doing this as we mentioned as part of our mission at the end? Where is we want to? help onboard developers to the web assembly or kind of like increase them the footprint of developers that have access and and use web assembling on a date today and You know What a bigger community that you know people working with with PHP or working with with Python? And to do that we we need to be very conscious of what? You know was just discussed like a few minutes ago, which is the developer experience Ideally we want to do this without radically changing what we need to do what they need to do to kind of adopt this we want to in a way meet them where they are and Once they have experienced that once they they can take advantage of all the good things that web assembly Brings to them then we can kind of take them to the future and start using it in in other ways And that is something that we experience at a bit NAMI You know, we have millions or still has millions of users of the stacks that we provide and part of that is not that You know, we're doing anything, you know revolutionary Primarily what we're doing is we were packaging that for convenience We're packing that for ease of use and that has that kind of a quality of its own like the more Widely spread that your software is the more that you can bring that to people who you know Or may have trouble like getting it to to to the point of running But once it is running they can do a lot of things with it It unlocks and as a whole set of new use cases And you know potentially coming from a different perspective of The more sophisticated use cases that the people in this room are able to to achieve and that's kind of like why we decided to do this and how They would decide where to start we decided to take the most popular script and language at least for web development and And take the most popular application in this case is WordPress And I assume most of the people here are familiar with it. It's a content management system That runs 30 to 40 percent depending on which source you check of the web including high profile websites such as Disney or or the White House and That's not a type of that's not 30 or 40 percent of all the content management system It's not like 30 40 percent of all the websites right across all the sizes You know the top 10,000 at the top million is you know the percentage is fairly fairly consistent So if we get that working web assembly that means that you can you can get a lot of other things at working and Going back to meeting developers where they are Most of the people deploying PHP applications are doing so on top of the lamp stack Which was kind of like the first way of of the first wave of web development back in the in the 90s and You know create like an a standardized way of creating applications that you could easily deploy on different hosts because you could always kind of assume That you will have lamp and that is it's our cronin that is does stands for Linux my sequel Apache and mphp and in the spirit of you know meeting Making that transition seamless and not requiring little to no changes We leave Apache as it is you can assume that Apache is gonna be in any you know hosting service or any Linux distribution that you use We'll replace mod PHP, which is the module that enables PHP to interface with Apache and just kind of PHP has this concept of server API's or SAP's and And that PHP provide that we will replace that with mod web assembly or mod wasn't that Enables you to provide that interface instead of to to the PHP runtime to a web assembly runtime That in turn will run PHP because you still have PHP. The way that we did that is similar to how Chris Provided details of how they ported Python the path to do so It's very similar once you have compiled PHP to to wasi And we will be showing that later on all of that is is is now released and an open source You can run PHP inside mod wasn't inside inside Apache my sequel We will not touch we'll leave there for the purpose of the demos that you're gonna see today and kind of the initial work We have focus on sequel light, but the idea is in the very near future You will be also be able to run this with with PHP so in terms of whole mod wasn't works and I'm not gonna go into a lot of Detail we have some articles and describe these and some other presentations that That we have done that you can find online It's divided in in kind of like two pieces. There's the first piece which is mod wasn't This is a regular Apache module is breathing in C. He uses the Apache PR It's a very well-defined API that is used by you know, nearly everything in Apache is a module So if you you have a module that implements You know SSL TLS you have a module that implements session caching you have a module that that implements support for for you know PHP with mod PHP you have mod Python you have kind of like Different modules for integrating different runtimes or providing functionality in this case mod wasn't is an interface between Apache and a different module which Integrates is written in Rust and integrates the ability to You know instantiate WebAssembly modules to respond to requests and it kind of ask In between it takes the request from Apache processes then in a way that The WebAssembly runtime is gonna Understand and then take the output from that request send it back to Apache So it can send it back to the client or or or to the to the browser in in this particular First release that we're doing with this We use a was on time from the buy code alliance, which you know, you're all familiar with In terms of how this is implemented from the PHP perspective We you know, there is versions of PHP that work with in script and we have like a popular demo that we released a few months ago of showing WordPress running in the browser and using some of the functionality that is script and Provided in terms of simulating a lot of these You know different pieces that are missing from from kind of server side WebAssembly in this case We ported a subset of PHP to to wasi and instead of having to Compiling the PHP interpreter and tie that to much PHP. It's a laudable module So when the request comes to Apache, you know, there was some runtime realizes that that's like a PHP request has already loaded the the module you can preload that I start up time and then go interpret the PHP, you know index dot PHP or WordPress dot PHP take the result and Provide that back to Apache and this is very similar to how PHP works Currently again or go out here was not to to to be more efficient or to provide more functionality That mod PHP it was just too much what people are already have and in the spirit of having live demos I will leave you now with Raphael who is gonna be giving you a demo of how we have all of this working Thank you Okay, so let's see an example of how this works So the first thing that I'm going to load here My cursor yeah It's PHP info So this call is something you can write in your PHP program And when you call to this function this function basically prints some HTML code on the standard output And it's going to fill all the information about the PHP runtime Here is super small. Let me make that bigger and here you can see that the system We're not going to go through all configuration, but the system is wasn't 32 was see so this is what we were looking for And you can see that what we have ported We have built is 7333 at this time So this is for for the PHP version So let me show you the current status of the project so we have PHP 7333 as we have seen We have the PHP CLI that you can use to run scripts like PHP scripts Regularly like without any any changes. We also have the PHP CGI binary which is what interacts in this way as Daniel described before and what we have done Has been to build PHP with was ESDK nowadays was ESDK has Really good defaults. Let's say it's it's pretty easy In a in a general way to build programs with it And we have used the wassylipsy to provide the postings feelings for for it Okay, so what are the things that we had to emulate in this case? This is everything comes from from wassylipsy. There are some things that we could emulate with it You can you can see we have we have been all day talking about it. We don't have signals Also, we have some emulated looking for clocks get PID get PID doesn't make sense to be to have processes on web assembly So it returns a Fix go a fix number and that's it But so there are some things that can be emulated because in this case this part can be emulated and that's it But there are some things that we had to remove that we cannot emulate and for example in terms of PHP We have opcash opcash is some mechanism that PHP has inside or has Yeah on on its engine that whenever it reads through the PHP code it converts that into a bytecode and stores the bytecode in memory and so when you do Further requests or it is going to interpret the PHP file again. It doesn't need to start from scratch So it's it starts from what it already has in the bytecode So we have to strip that and as a result, of course things will be slower Even I mean even with the package we don't know but without it. It will be slower for sure So, yeah, this we have to remove things related to processes Like yeah, we we don't have this this concept as we were saying before anything that has to do with socket creation Or handling we don't have that thing again. So Yeah, then the send engine has some feature That uses set jump and long jump in order to implement Exceptional handling so the engine whenever it's it's Compiling the PHP code to bytecode it can raise acceptance So these PHP runtime has set jump and long job in order to implement this this mechanism to to be able to let's say To be able to Yeah, to be to be able to to get these these errors And report them back to the user also things regarding to new texas or certain file system functionality File system logs seeds of file logs change owner. You must things that we don't have but Despite we don't have all these things. We were able to build something as complete or not to build to use something as As complex as WordPress so we can we can still do something like that. So let me go through The demo of WordPress Okay, so we have an installation of WordPress. It's really simple. It just contains the basic installation so you can actually go and visit like the blog post is just you know the basic navigation that you can have on a Regular WordPress installation You have pages and yeah, all that works Also in terms of the of what we were saying about the CGI We have Script that implements or uses the features that will be in the in the in the end using CGI We have we can have a single for example psp script that I can show to you For example, this one is able to set the response code for example to am a teapot I can set the response headers It can read headers from the from the request that we are getting as an input and it can for example print to Jason Certain has for example the request to the request that we got and the headers that we have been collecting here before So we can try to trigger a request here and then you see for example We get from the cool directly the expected HTTP request We see that there are certain headers that are set by psp CGI itself There are others that are set by us and then yeah, just the body that we just That we just return from our script and Then we can of course do Like more complex requests. Let's say we can we can have something like query parameters Our own headers and everything gets filled into the web assembly module So you can see that here in the request. So Let me go back again Okay, so how does this plug into into Apache so with Apache we have So what you have to do is to load the module So Apache is aware of mod wasm and then you can see it on the location part This is some great. Maybe it's not very readable here What we are saying is just put in the root and what we are saying here is that from the root on in this case Then you can overwrite that afterwards if you want but for in this case from the root on what we are going to do is to add a handler For psp file extensions. We're going to use the wasm handler And so we what we can do is to configure in this case Mod wasm to say what is the root of the of web assembly? What is the module in this case is speech PCI? We can we can pre-open certain directories We can mount or not mount but yeah map directories into the web assembly runtime or set Certain environment variables Okay, so what are the advantages and trade-offs of of these approach? So first of all the upsides of running web applications With with wasm is security So we have the sandboxing feature of web assembly that already helps us with path traversals or buffer overflows We can also mix and match languages. So for example, we would have different endpoints that are served by different languages Depending on what you what is your back and breathing on even if it's a split it or whatever We can also even in this is a special case of the previous one We can mix and match runtime versions also certain paths can be run by page p7 others by page p8 for example And also isolation so improvements for for a traditional certain hosting implementations like what we were saying On the file system side it can it can help you also if we talk about the field Feature of wasm time for example, we are able to if we have noisy neighbors on our machine We can kind of control all these these execute execution time that we get with field And then in terms of extensibility within we can extend WordPress With wasm plugins and in terms of the external one if we want to port our program In in different steps from one language to another or just a part of it We can still do that because with web assembly as we have seen other in previous sessions We can do that step by step as we as we as we can or as we wish But there are there are also trade-offs We haven't measured it, but we know that the performance is so visually worse We have to check how how worse it is and we have to check what can we do to improve it and there's also missing functionality So we yeah, we have we know that we have feelings For for these things that are missing But you know there are some things that we cannot feel in any case, right? So there are certain calls that the PHP script might call But we don't have this implementation at all and it's like maybe this doesn't make sense To have on PHP itself like on the on the web assembly side of things Okay, so as far as the future we want to contribute dispatches upstream for PHP 7 and PHP 8 We also want to explore using wassics so that if you have heard the previous the previous Presentations is like it feels like there is a lot of people doing like parallel work And we are kind of doing the very similar work and maybe wassics For example could be something that if we agree as a community to to move on with it Might you know might improve all of us might might help all of us It also it's it can also run on serverless worker like environment So before we didn't really explore this that much but with the new way of doing things with web assembly We can have our repeats because deployed into serverless and see if that improves the the user experience for for our users And then for the future also PHP We have a synchify which is a method that we can use To to to implement certain features so with a synchify. We are able to Resume and pause Web assembly execution and so what we can wish to have alternate execution paths So for example, this is used for except for implementing exceptions And the idea would be that with a synchify We are able to implement the missing bits and pieces for set jump and long jump because in this case If we instrument the the binary and then we implement the right bits and pieces that we need with this instrumentation They we could implement something that that has or that implements the the Execution handling that we are waiting for and yeah, also fiber implementations for for pxp8 Could be of help and Then for mod was and what we want to do is to be able to load multiple web assembly modules So you can define as many as you want in your config also You might be a you might want to have different was enabled capabilities per module So one module might be able to access a certain directory other maybe not Also with the engine support. So right now we are on the support Was in time but in the future we we might support others because in the end The these engines might be more performant for certain operations And we may want to to use those engines or the user might want to use those engines for these specific things Also, yeah, we can run on Kubernetes environments with support for wasi as a key as for example this something we can also do Also, we could pull modules So instead of having to pre-fill or to to give or copy the the modules beforehand into the file system We could pull this from a server. I can be a it could be a registry It could be an HTTP server something that we can pull these modules from And also additional language framework support In theory if it's if it implement CGI we will be able to run it But we haven't tested it we have to try and see how it goes But yeah, this is part of the future that we want to to check also in terms of logging and debugging things that we to also invest time on it Okay So as the summary of this talk is first of all we have module wasm which enables Apache to Execute WebAssembly modules this already opens a big world because lots of things can be compiled into WebAssembly, right? So now we have Apache that enables all this world Then the second part is we have PHP which is ported to wasn't 32 wasi And then we have WordPress and other web apps that can run unmodified on the server side And then all the benefits of wasm now are available to all the developers So yeah, and the most important things about this in today I think is security because with this we have a more secure environment And we had a lot of deployments that we have seen WordPress 30 40 percent Many of these things will be secured by default or more secure by default without any change, right? So this is what we are expecting and this is what we will want to to tell the the world, right? So we want to gain all these developers So give it a try. We have wasm labs.dev. We have written The articles on how we have done this so provide feedback We are really open to to wherever you want to tell us Yeah, follow us on Twitter and yeah with that. Thank you. You have any questions?