 Hey, thank you for that kind introduction Liam it's true I am very very very excited about WebAssembly, and I'm especially excited that there were so many new hands in the audience So I think this is a good talk because I will be giving an overview of really the why of why We built wasm starting from the very beginning from the evolution from the past to the present and a little bit on the future And that started for me back in 2012. This is the year that I graduated from college And it started with a technology called asm.js I had this problem where I had just given a demo and it was terrible I rendered an application with basically 15 frames per second And that was because I was trying to come up with a portable way to run code in the web But what I had created was a heavy server connected over a web socket and then like a light client that was that was rendering But then I discovered this blog post by Alon Zakai and he talked about asm.js as this Super-efficient subset of JavaScript that when targeted from C++ and Compiled to it you would be able to run basically C++ code in the browser and I thought okay. Well, that's crazy I got to try it out. So I read a bunch about it But really what convinced me is this demo here and I have to switch to Firefox just because that's the true experience Let me see. Here we go Hit high resolution and so this demo here is called banana bread It's it's an arena shooter and what will happen in a second is basically what happened to me the first time That I played this which is a bot spawns and it takes me out but I pulled up this this game and Basically blew my mind. I jumped up from my desk and I immediately walked down to I Immediately walked down to the corner office and in that corner office was my director who I'd just given this terrible demo to you But also in there was the VP my VP the head of engineering This is a kind of a mid to large-sized company. I was working at SAS and these were suit people This is my first year out of school. I just gave these guys a really terrible demo So normally what I would do in that situation is immediately turn on my heel and run away But I was so excited that I just kind of went right on in I showed them that exact same demo that I just showed you and I logged on the desktop when we started playing it and It really just caught fire because if I can do that in a browser I can render some graphs, which is really what I was trying to do So we had about a million lines of C++ code and really similar to what Kelsey was talking about before This code actually was ported from C to Java Later to flash and now we're trying to come up with an answer for flash now that it's basically deprecated in browsers And what we also were doing around this time in 2012 was trying to support mobile app development And so what you ended up having is a software stack that looks a little bit like this where you've got a C++ code you compile it to a bunch of different targets. You add a ton of different host glue But also part of that host glue is necessary for rendering the view So naturally I added M script in which is the tool chain created by alone To let me basically build C++ code and target as in JS And so this was just really incredible. I wrote a lot of JavaScript code glue to actually make this work Well as an application, but it really did just work So that kind of blew my mind because I was basically taking What I was considered the greatest hack of all time taking a high-level language and finding ways to make it optimized so that It can be a low-level compilation target something else I want to call out around this time is in 2014. I went to talk at CPP con and the Dropbox team was talking about a Language IDL because they were doing exactly the same thing we were doing which is taking portable C++ code and finding a Way to share that code and run it across a lot of different platforms And so they had an IDL that I'm showing here mainly because I am embarrassed to show you the XML that I wrote for doing Basically the same thing But also it's going to be very familiar once I talk about it later Now there was another amazing demo that happened in 2013 that really helped as an JS catch fire The Mozilla team partnered with the epic games team and they ported the unreal game engine in five days so this type of technical demo really caught a lot of people's attention and It brought people to the table like me a conventional BI analytics application building with that tech meant that there were really really use cases and crazy enough people to go and try this and ship applications and So what that also meant is that now all the browser vendors got together and said okay? You know we could push forward a specification for the greatest hack of all time and that would benefit a lot of people But what if we started new what if we started from scratch from principles for designing something that is web native? What will we build if we did that now? Essentially what we landed with we're all here today, so we already know it's pretty awesome But it's web native in that it is needs to be fast to download fast to start It needs to have a really small memory footprint It needs to be portable because it's code that I'm going to be running on a lot of different machines running in different browsers It also needs to be Just as safe and sandboxable as JavaScript Now what really made it real for me is this demo, which is yes, I know yet another game demo But this is the Unity game engine. This was in 2016 This was like one of the first like really cool like wow they built this web assembly tech It actually works and I've got this really complex rendering that's happening in the browser Now the reason why I keep showing you game demos Is for a few different reasons Games are really one of the most complicated software engineering projects that we can work on it pulls across many different disciplines also, the developers are The kind of people that want to use cutting-edge technology to get the most out of hardware and software So as far as tech demos go there They're one of the the most fun and they're the ones that you can put in the hands of other people and say Check this out. This is real so by 2017 we basically hit web assembly MVP ship first in Firefox But then you know immediately after in Chrome around 2017 was when I also shipped my app to production with web assembly And I remember in 2018 how the performance just got faster and improved Now the biggest deal here is in 2019 That's when web assembly officially became the fourth language of the web up to this point We only had HTML JavaScript and CSS To make a an official language of the web. It means that we got a lot of things out of it But we also had to come up with a lot of ways to reach MVP and issued a lot of different features Including things like garbage collection and tail calls But those are later added And so what we got was something that was sandboxable And is really in a lot of ways pretty simple It's just a compilation target that many different languages can support And I usually call it a bunch of numbers in a trench coat because at the end of the day The web assembly module itself can't do anything unless it's handed a function call from the host And so a lot of times you'll hear people say deny by default But can you really deny something when it's not even able to make that call to break out of the sandbox at all? So with something that is as simple as this type of thing we were able to get a lot of adoption really fast I wasn't the only person building applications in 2019. I started seeing implementations Really across the web a lot of cool tech demos that happened around that time include stuff from Adobe and Well, just it seemed like everybody was at the table. I believe Shopify showed up around then So 2019 was a huge year for web assembly including the introduction of the web assembly systems interface Now over time over the past several years It's really evolved from just being a systems interface when it was first introduced in 2019 We were really thinking of it as some approximation to running on posits to make it really easy for you to take a Was a module and embed it in a non web use case I do want to call out from the very beginning even in 2015 the original use case and goals documents in the web assembly design repo Was included both web and non web embedding. So from the very beginning We knew this was one of those cases that we wanted to solve now Why is he itself is is really that arrow that I have here It's that function call that I was talking about that gives the web assembly module the ability to do a lot of Different things like file.io and networking that it itself isn't capable of doing But even more importantly it allows for granular imports of those functions And so I can specify just for one was a module because it needs it it says it needs access to you the system clock Well now my web assembly host is in charge of sandboxing that capability and how that implementation works So I can add something like fuzzing of the time so that you can't get an exact System time for security reasons Another amazing thing that happened in 2019 is the bytecode alliance was found formed. So We knew and I really wasn't part of this. I was more like somebody sitting on the sideline being like yeah, keep going guys but the the bytecode alliance was formed because they knew that This is something that is cross-industry wide. It's not something that we can go alone And it included a number of major companies like Microsoft, Fastly, Mozilla, and Red Hat as as the original founding members that were like somewhere around 30 or more and the goal of the bytecode alliance is to build a software foundation that Allows it for the web assembly ecosystem that has all the same properties that we wanted out of web assembly portability But also safety and security Now from 2020 to 2022 You know, I feel obligated to include these these years together because I don't know about you all but they sort of blur together for me because There's a lot of work that happened around this time, but there was also a global pandemic But in a lot of ways this really helped web assembly evolve even more and show up in more use cases Consider for example, Google Meet and Zoom They both use web assembly and SIMD to be able to blur your background So folks don't have to see your roommate or whatever mess you made for whatever your COVID project that you're working on so around this time it wasn't just Google Meet and and Zoom but you web applications We also saw folks taking advantage of web assembly to make it easy to distribute applications because it's portable Because it's it's very efficient to download and start We're starting to see a lot of folks use it for example in prime video where if you have a tiny wrapper of Around your your application that's running say in a TV, which is kind of a weird environment to target If you put a lot of your business logic within a web assembly module that piece is the thing that you can now distribute All around the web and makes it really easy to update And so of course most of the streaming applications today also use web assembly Other awesome things that were landing around this time frame was many different proposals that weren't included in that initial web assembly spec so a lot of it was around performance A lot more was added for basically being able to add more languages that can target web assembly including For tail calls and then now garbage collection, which is getting a lot of excitement and action right now And we're seeing many more languages now be able to adopt web assembly But there were also a lot of pieces here that laid the groundwork for what you've heard a little bit before Talking about the component model and that includes reference types and multi value So once those proposals landed we're able to build the next new thing which Kelsey started talking about as the universal computer So in the present everybody here is using web assembly every day It's in many different applications. It's in your cloud native stack. It is Honestly the best and probably last plug-in model You'll ever need if you want to extend your on-boy application and there's a talk later talking about how to extend Open policy agent you can use a web assembly plug-in Which is really just a web assembly module to extend it now another example of What I consider the plug-in model for a web assembly is yet another game example So you shouldn't be surprised you can tell that I am a gamer And and I do love these examples. This is the Microsoft flight simulator and this is a new thing that was added this year They made it so that you can now run web assembly on your Xbox And the reason to do that is that it makes it so that instead of having to download like a DLL that lets people just Run random code from other people on the internet to modify your game You can now put that in a web assembly sandbox environment and run that to you know Create new different ways that controls work and and Microsoft flight simulator now This is actually a really cool story. So I recommend checking that out now Let's get to the future. This is the cool part Kelsey talked a little bit about this so I'm not gonna go too deep But most of us have this problem remember the original graph that I showed that where we were building C++ and targeting all these different environments Well, the reality is They're still doing it exactly that way And and many other people are Because we haven't quite made this the reality But there are places where it can be so I work at Cosmonic We build a pass for wasm cloud wasm cloud itself is a distributed application platform for wasm And so Cosmonic being built on wasm cloud to host wasm cloud Modules really means it's web assembly modules turtles all the way down and it's actually a really wonderful way to develop. So this I Put it in the future category because today most people aren't gonna say I'm gonna write a new CLI I'm gonna compile it to wasm and then I'll just show up and work for everybody right because we're not quite at the point where There's just a default. This is how I run web assembly desktop applications today But I think it's totally in the future probably within a year or two But we keep talking a lot about the component model And I too just like till believe that this is the future. This is has the potential to be a universal Computer that everybody is able to build on and build on top of the shoulders now There are a lot of different features here of the component model and I am going to focus more on the why it's important Because as engineers we often focus more and wrap ourselves around the what in the how of things And there's gonna be a lot more talks talking about in great detail how these different tools work and to get started But the why is often just as important as the what in the how So with wit this is our now our language neutral IDL that Many different languages can support and it basically lets us make it really easy so that we can interact with high-level interfaces For for what we build in a component And so say you have a wit file and IDL definition of your API then you can target wazzy preview to Use a tool like wit bind gen to generate your language binding So remember when I was talking a little bit earlier about hey this this IDL thing is kind of a cool idea We were talking about it even back in 2012 and 2014 Well, you know This this this idea is really a combination of many different other projects have come before and so by Being able to take an IDL definition that lets you talk in high-level languages We can have many other languages be supported So what comes out once you run this build process is a wasm component This is a new ABI those first eight bytes is different between a module and a component But what comes out is pretty great Remember when I said that a web assembly module is really a bunch of numbers in a trench coat Well a web assembly component is really a bunch of web assembly modules that are in a trench coat That also know how to talk to each other and So by linking them together I'm able to take languages that are usually never before have I been able to write a single application That can go from rust to go to JavaScript But I can build a portable component and it's portable because again It's really built on top of the core web assembly specification, which itself is portable So once I take a web assembly module Or really a web assembly component that has those high-level interfaces I can link them together and use other web assembly components as libraries and Now this is what we're talking about when we're saying we can now build a universal computer in a lot of ways This is what we think that universal computer looks like So you might be asking, okay? Why now? Well, I believe that a lot of the reasons why web assembly itself was successful is a lot of the reasons why the Web assembly component model will also be successful It's an open standard you can join a foundation that's building a lot of the SDK and tooling around that open standard through the by-code alliance And yes, many of these different approaches have been applied before you you know might throw out Java right once rent anywhere But what's different now is a combination of a lot of these different ideas that people have come up with To be able to do something that's unique And so I'm incredibly excited about it because it also solves real problems that I've seen including say today when we have a vulnerability like log perj we have Basically the entire world has to go and update their application They have to go update their dependency recompile their entire app redeploy well and also retest and then we do this everywhere So what if we had a common dependency like a logging component that a lot of folks pulled in and then All they had to do was relink. They did not have to recompile their module The energy savings alone is massive cost is massive cost on on people time and work It is massive. So There's so many different things This is just like one use case that I could pull out that a lot of people have probably felt this pain before But components let us do a lot of other things like being able to use the right tool for the job. So As Kelsey even talked about earlier We've every era of computing we felt like we had to go and rewrite the entire world in our in our language So as a go developer, I don't want to enable cgo So I'm probably not even going to share code with another back-end engineer that is writing in Rust for example Even though we're both back-end folks. We're both kind of working in the same space Same thing can be said for making it easy for JavaScript developers to be able to pull in code from back-end engineers so that's a type of silo that we've built up across the the software industry really a a Way of fragmenting our ecosystem How many times has a regular expression library been ported from language to language to language when we got it Right the first time with the parole expression syntax Now we can also run our components anywhere. So at the time in 2012 It really felt like the browser and the web was the final frontier and now what we're starting to hear is that It's really the edge it you want to get our code running as close to our users as possible And so the edge can be your phone or your smart watch or your car There are so many different environments that we want to target and also in 2012 at the time I was trying to figure out how to take basically x86 compilation and run that everywhere now if you look at anybody's build matrix you're looking at all kinds of different arm and CPU architectures and For a lot of the reasons that we've talked about it's really important to find ways to make sure our software is secure and sandboxed So with the component model we can now build applications and a new way that makes it so that they're easily sandboxed So Between that and this concept of being able to share nothing between our components Components have linear memory just like in a web assembly module But they also don't share memory between each other So before I showed how we can have fine-grained capabilities for each component that we pass through And that one way of doing that is with wazzy But we also make it so that we know at a very granular level Exactly what capabilities any individual component in a composed application is using and we know so that Let me tip step it back If I pass my keys to the kingdom to us application today And that includes like a bunch of environment variables including my AWS keys then what I get is Perhaps a supply chain security attack where somebody just has access to getting environment variables And they go and they know the the typical environment variable for my AWS key By making it so that I don't even share memory between the components that are linked together in that app application, I have a new type of application model that Defends against this type of attack. And so this is really a new model for the current day of software engineering So I encourage you to get involved the standardization work is within the W3C A lot of the tooling and a lot of the language binding and that work happens within the bytecode alliance There are also several web assembly run times that are hosted within the bytecode alliance including wasm time and the web assembly micro run time In addition to that there's lots of web assembly run times external to the bytecode alliance And I also encourage you to jump on the bytecode alliance chat if you're getting started and you're trying to build things starting with bytecode alliance tooling is probably where I recommend because I I'm also on the seat on the technical steering committee and Why now because it's open and it feels like 2012 again for me being able to work with asmjs for the first time So thank you Thank you so much Bailey. I always love seeing you speak and I really love your doodle a bunch of numbers in trench That one always just makes me a lull. Does anybody have any questions for Bailey? Please introduce yourself hi Bailey and Sven. Thanks for the amazing talk I know the Component model is coming. So I'm very excited, but it will take times until all the run times Support the component model. Do you think there will be shims or polyfilts in the meantime? Yeah, that's a great question. Okay, so The component model is coming right that was in the future section I actually expect people to be able to build and on top of the component model and basically the top fall time Frame that's when we're targeting wazzy preview to to release wazzy preview to you is going to give you those wit interfaces and a lot Of different API's that make it really easy to run outside the browser There's a talk that's coming up soon that'll dive deeper into wazzy. So I didn't go too deep there And so because the component model isn't quite yet available are there ways to basically polyfill to go from Where we are today to the component model and that is absolutely true so I got I had the opportunity a couple weeks ago to demo with Dan Curelone and we showed Basically targeting a wazzy preview one module. So something that a lot of languages support today We compiled a wazzy preview one we adapted that to wazzy preview two which adapted it to a component And then once I had it as a component I still had to work with an existing language ecosystems and run times And so I used a technique that my team coined as a wazzy fill because what I did is I Looked at the API's that my component uses and I adapted them to work within my host environment And that is an incredibly powerful way of building things And it's it's one of those things that like once you realize that you have Fundamental Lego building blocks of components that you're able to assemble on top of each other you just keep assembling and Adding more wazzy fills to work within your environment and so yes, you can start fiddling today I will say that It wasn't the easiest to get that demo working You know that a lot of stuff is changing And you need to have versions that align with each other because it's a new ABI and each thing needs to support that exact same ABI But it's very much real and I think we'll probably see a pretty cool demo later Actually, I know exactly which demo we're gonna see later and it's gonna be awesome And Bailey's talk from was my oh is online on their channel if you weren't there at the conference It's a phenomenal question by the way the program committee thinks that the theme for 2023 is the component model and wazzy So later today We've really tried to curate a couple of talks and the talk that Bailey is alluding to is a prerecorded talk unfortunately but it's guy Bedford and Peter Hume and Peter Hume from Fastly and I think that is the talk that will blow your minds If you'd think that this is far in the future We saw it privately a few months ago in the developer workshop and we could not wait to get it on stage here today Any other questions for Bailey before we let her go? Okay, great. Thank you so much Bailey great talk as always