WebAssembly 3.0 with Andreas Rossberg

20 Jan 2026 · 1 h 1 min · 33 chapters

Ask about this episode

Ask anything about it. ChatGPT or Claude reads this page and answers with the times it was said.

Connect VO and ask about every podcast you hear, including the moments you saved. Add to ChatGPT · Add to Claude

In short

Notes on Software Engineering Daily Podcast: WebAssembly 3.0 with Andreas Rossberg

Episode Overview

  • Podcast Title: Software Engineering Daily
  • Episode Title: WebAssembly 3.0 with Andreas Rossberg
  • Guests: Andreas Rossberg, programming languages researcher and former member of the V8 team at Google
  • Host: Kevin Ball, VP of Engineering at Mento

Episode Description The episode explores the evolution of WebAssembly (WASM) from a low-level compilation target into a prominent technology influencing modern computing across various platforms, including web browsers, edge computing, and embedded systems. It dives into the history, design constraints, major milestones, and future of WebAssembly, particularly focusing on the recent 3.0 release.

---

Key Concepts Discussed

  1. Evolution of WebAssembly
  2. Transition from being a compilation target for C/C++ to a cross-language execution format.
  3. Growth into a versatile tool used in various platforms (browsers, edge compute, embedded systems).
  1. Historical Context
  2. Pre-WebAssembly: Reliance on JavaScript as the main web language.
  3. Technologies Before WASM:
  4. Native Client (NaCl): Google’s attempt to run native code in the browser.
  5. asm.js: A subset of JavaScript that allowed for better performance by optimizing C/C++ code.
  1. Design Constraints of WebAssembly
  2. Security: WebAssembly runs untrusted code on a machine, emphasizing the need for safe execution.
  3. Environment Limitations: Unlike typical operating systems, browsers provide limited APIs and services.
  1. Milestones in WebAssembly Versions
  2. Version 1.0:
  3. Basic functionality targeting low-level languages.
  4. Introduced a linear memory model and basic numeric types.
  5. Version 2.0:
  6. Included vector instructions for better hardware performance.
  7. Added reference types to improve interoperability with JavaScript.
  8. Version 3.0:
  9. Major addition of garbage collection capabilities.
  10. Support for multiple memory spaces and richer reference types.
  11. Enhanced multi-language interoperability.
  12. Introduction of features like tail calls and exceptions.
  1. Advantages of WebAssembly
  2. Near-native performance for compute-heavy applications.
  3. Portability across different platforms, optimizing for embedded systems and edge computing.
  4. Strong focus on security and deterministic behavior.
  1. Future Enhancements
  2. Component Model: Aims to provide a higher-level module system, facilitating interaction between different languages.
  3. Continuations and Control Flow: Ongoing work to implement efficient handling of complex control structures in various programming languages.
  4. Hardware Implementation: Discussion of potential direct hardware support for WebAssembly.
  1. Non-Web Use Cases of WebAssembly
  2. Edge Computing: Companies like Fastly utilize WASM for server-side applications.
  3. Embedded Systems: Portability across different hardware platforms without rebuilding entire toolchains.
  4. Blockchain: WebAssembly’s deterministic and secure execution model is beneficial for blockchain applications.
  1. WebAssembly vs. JVM
  2. WebAssembly is designed as a low-level universal VM, whereas JVM is more tailored for Java.
  3. WebAssembly allows for greater flexibility and performance for various languages and use cases.

---

Key Takeaways

  • Interoperability is Crucial: WebAssembly is making strides toward better interoperability between languages, especially with the introduction of features in version 3.0.
  • Security and Determinism: The focus on safety and clear outputs will be essential as programming practices evolve with AI-generated code.
  • Future Potential: The community is actively exploring avenues for embedding WebAssembly in hardware and improving its capabilities for desktop applications.
  • Formal Verification: The emphasis on formal verification of the language specification promises a robust execution model, important for secure and reliable applications.

Closing Remarks Andreas Rossberg emphasizes the journey of WebAssembly and its continuous evolution to meet the needs of modern computing, hinting at exciting developments on the horizon that could redefine how software is built and executed.

Written by AI. May contain mistakes. Listen to the episode to check what was said.

Chapters

Tap a time to open that second in VO

Meet Andreas Rossberg

0:45 to 1:33

Introduction to Andreas Rossberg and his contributions to WebAssembly.

“the constraints that shaped its earliest design, the major turning points in versions 1, 2, and 3, and what's coming next for WebAssembly.”

Andreas's Journey to WebAssembly

1:33 to 2:28

Andreas shares his background in programming languages and journey to WebAssembly.

“Yeah, I'm excited to have this conversation.”

The History of WebAssembly

2:28 to 3:40

Overview of the history and evolution of WebAssembly and its challenges.

“I think, you know, if we have web programmers here, they're probably familiar, but not everybody is.”

Constraints of Browser Compilation

3:40 to 5:33

Discussion on unique constraints when compiling for browser environments.

“But that was really like a very clever, ingenious hack.”

WebAssembly 1.0 Features

5:33 to 6:47

Introduction to the features and limitations of WebAssembly 1.0.

“And you have to be aware of these environmental constraints.”

Performance Benefits of WebAssembly

6:47 to 8:11

Analysis of performance benefits of compiling to WebAssembly compared to JavaScript.

“like very basic virtual CPU, if you want.”

Benchmarking Challenges

8:11 to 9:30

Discussion on the challenges and trust issues surrounding benchmarks in performance.

The Development of WebAssembly 2.0

9:30 to 10:40

Exploration of the new features introduced in WebAssembly 2.0.

“Yeah, that was like the time I was on the VA team, like in the 10s, mid 10s, early mid 10s, that the benchmark war was like all on, right?”

WebAssembly 3.0 Overview

10:40 to 12:20

Introduction to the significant advancements and features in WebAssembly 3.0.

“when all the browsers implemented it and the features were completely done essentially.”

Garbage Collection in WebAssembly 3.0

12:20 to 14:00

Detailed discussion on the addition of garbage collection in WebAssembly 3.0.

“So, yeah, so external references, at least in principle, made that easier.”
Show all 33 chapters

Understanding Low-Level GC Features

14:00 to 15:10

Explore the low-level garbage collection features in WebAssembly and their implications.

“And that's where the type system then becomes significantly more complicated.”

Opt-in Garbage Collection in WebAssembly

15:10 to 16:40

Learn about the opt-in nature of garbage collection in WebAssembly and its efficiency.

“Actually, before we go further on that, so since you're targeting not only languages with garbage collection, but still those original languages.”

Introduction of Multiple Memories in WebAssembly

16:40 to 18:30

Discover the introduction of multiple memories in WebAssembly and its design implications.

“Another one that I saw that I'd love a little bit of a dive into what it means is this concept of having multiple memories.”

Trade-offs in WebAssembly Design Decisions

20:24 to 24:40

Examine the intentional design gaps in WebAssembly and the considerations behind them.

“Your team's focused on building product, but someone in ops needs a dashboard.”

Feedback and Evolution of WebAssembly Features

24:40 to 27:20

Understand the feedback mechanisms that shape WebAssembly's evolution from 1.0 to 3.0.

“with garbage collection like what we added now is sort of the garbage collection MVP.”

Unexpected Features and Future Directions

27:20 to 28:00

Discuss unexpected features in WebAssembly and future development trajectories.

“So in theory, everybody can join there and propose a feature.”

Unexpected Features in WebAssembly 3.0

28:00 to 29:05

Discover features in WebAssembly 3.0 that were surprising and how they fit into the overall development trajectory.

“are there any features that have made it out in one of the 2.0 or 3.0 releases that you did not anticipate, that were not sort of already in the back of your head of like, oh, yeah, we'll want to do that eventually?”

Language Support and Compiling to WebAssembly

29:05 to 30:24

Explore the landscape of programming languages that currently support compiling to WebAssembly and the implications of recent features.

“Maybe just being a function of how long it takes to add a feature.”

When to Use WebAssembly vs. JavaScript

30:24 to 31:59

Learn the considerations for choosing WebAssembly or JavaScript for web applications and DOM interactions.

“Yeah, I mean, there are so many languages out there that I don't have anything closer to complete knowledge of who has a WebAssembly backend and who hasn't.”

Accessing Web APIs from WebAssembly

31:59 to 34:27

Understand how WebAssembly interacts with web APIs and the challenges faced in accessing the DOM.

“Or potentially, if you're compiling a language that is very closely integrating with JavaScript by design, right, then that might also be better to still target JavaScript itself.”

The Component Model in WebAssembly

34:27 to 37:38

Get insights into the ongoing work on the component model for WebAssembly, aiming to enhance interoperability among languages.

“You wouldn't even, probably not even get much performance out of that because the overhead of calling from WebAssembly into JavaScript is actually mostly dominated by the actual work done in the DOM itself, right?”

Defining Interfaces for Cross-Language Communication

37:38 to 41:55

Explore the need and potential for defining a higher-level interface for communication across different languages in WebAssembly.

“Let's maybe step back a moment and describe the component model.”

WebAssembly as a Generalized Virtual Machine

42:04 to 43:07

Explore how WebAssembly extends beyond web applications to serve as a universal virtual machine.

“You can define how you interface to that.”

Non-Web Use Cases for WebAssembly

43:07 to 44:12

Learn about various non-web applications of WebAssembly, including edge computing and embedded systems.

“Well, it turns out the big feature for them is portability.”

Determinism and Blockchain Applications

44:12 to 45:58

Understand the importance of deterministic behavior in WebAssembly for blockchain implementations.

“so they need a much leaner runtime, idly, like zero size if you want.”

Challenges of Non-Determinism in Programming

45:58 to 47:29

Discuss the causes of non-determinism in programming languages and how WebAssembly addresses this issue.

“And with 3.0, we even have a deterministic profile now, which is kind of specifying if you really want to be fully deterministic.”

Advantages of WebAssembly Over JVM

47:29 to 49:53

Examine the benefits of using WebAssembly instead of the Java Virtual Machine for language compilation.

“There was only one little source of non-determinism, which was with floating point arithmetics.”

Future Features of WebAssembly

49:53 to 53:01

Look ahead to upcoming features in WebAssembly, focusing on threads and continuations.

“So that's kind of how you make use of it.”

Control Flow and Continuation Models

53:01 to 56:00

Delve into how WebAssembly plans to implement control flow abstractions using continuations.

“What does the next generation in WebAssembly look like?”

Understanding Effect Handlers in Programming

56:00 to 56:30

Explore the concept of effect handlers and how they improve modularity in programming.

“And of course, it only works when you have JavaScript.”

Future Directions for WebAssembly

56:30 to 59:00

Discuss the potential for WebAssembly to gain more built-in support across operating systems and hardware.

“And the thing, the continuation is essentially your object that allows you to resume.”

WebAssembly Specification and Formal Verification

59:00 to 1:02:30

Learn about the formal specification of WebAssembly and its implications for safety and verification.

“So it becomes even more of a portable format.”

Trust and Validation in AI-generated Code

1:02:30 to 1:03:50

Examine the challenges of trusting AI-generated code and the importance of formal validation.

“The more code we let be generated by dubious sources.”
Hear the part that matters, and keep it.Open this episode in VO. Double tap your headphones to save a moment as you listen.
Get VO free

Transcript

Automatic transcript. May contain errors.

0:00WebAssembly has grown from a low-level compilation target for C and C++ into one of the most influential technologies in modern computing. It now powers browser applications, edge compute platforms, embedded systems, and a growing ecosystem of languages targeting a portable and secure execution model. Andreas Rosberg is a programming languages researcher and former member of the V8 team at Google. Andreas helped architect WebAssembly from its earliest concepts through its most recent milestone releases, including the groundbreaking 3.0 spec that introduces garbage collection, richer reference types, and major steps towards multi-language interoperability.

0:42In this episode, Andreas joins Kevin Ball to explore the history of WebAssembly, the constraints that shaped its earliest design, the major turning points in versions 1, 2, and 3, and what's coming next for WebAssembly. Kevin Ball, or Kate Ball, is the Vice President of Engineering at Mento and an independent coach for engineers and engineering leaders. He co-founded and served as CTO for two companies, founded the San Diego JavaScript Meetup, and organizes the AI in Action discussion group through Latent Space. Check out the show notes to follow KBall on Twitter or LinkedIn, or visit his website, kball.llc.

1:32Andreas, welcome to the show. Oh, thank you. Thanks for having me. Yeah, I'm excited to have this conversation. Let's start a little bit with you. Can you give us a bit of your background and how you got involved with WebAssembly and kind of what took you to where we are today having this conversation? Yeah, it's been a bit of a journey. So I'm a person who's kind of on both sides of the aisle in terms of academic and industrial work. So I used to be more like a researcher in programming language, both hardcore theory stuff, but also implementation stuff. At some point, I switched over to industry working for Google, working on the VA team.

2:11And that's one side where the whole WebAssembly thing started. So that's how I got involved in that. Let's dive in there. Actually, I didn't realize you'd done a lot of academic work on theory. So I'm kind of curious, maybe as we go along to explore how that has influenced development of WebAssembly. But let's maybe take us on a quick journey of the history of WebAssembly. I think, you know, if we have web programmers here, they're probably familiar, but not everybody is. So let's kind of go through what was the inspiration and the different stages we've been at coming to today. Okay, yeah. So a bit of history was that before WebAssembly on the web, we basically only had JavaScript, right?

2:47And it was always clear and common complaint by many people that this is like not good enough. And JavaScript has problems, as we all know. And if you want to use other languages, you have to compile to JavaScript. And that's far less than ideal as a compilation target. It also can be slow or at least very unpredictable in terms of performance. so before WebAssembly there were already like two kind of technologies that tried to bring more more like native code to the web and one was a native client that was a google technology that allowed you to do initially at least x86 code to run that in the browser in some form of sandbox and then a bit later the other thing that occurred was asmjs which grew out of mscripten which is this tool that was able to translate C to a very stylized subset of JavaScript that engines could compile more efficiently.

3:40But that was really like a very clever, ingenious hack. So it was clear that this would not scale very well, right? And at some point then, it was mainly people working on the JavaScript engines at Google and at Mozilla. So Luke Wagner and Ben Titzer in particular, who got together and started the idea of like, let's do it the right way. And that's kind of how it evolved then. That was back in 2015, I think. What would you say are the constraints unique to trying to do this inside of a browser environment the way that it was? You mentioned like, okay, to get fast, we had to trim down the subset and Google tried this native x86 approach.

4:27What makes compiling to a browser environment different than just running something on my laptop or server? So the biggest constraint, of course, is that it has to be safe and secure, right? You're running untrusted code essentially on your own machine. So you can't afford like any undefined behavior or any kind of other non-safe behavior. So that is like the topmost constraint that hovers above everything else. And then, of course, you also have constraints like the web is a very particular environment. You don't have access to most of the services that you're used to from regular operating systems.

5:08There's no file system or anything like that. You can emulate some of that stuff, but it's not really physically there. And various other OS kind of services. And various programming language implementations kind of assume the presence of some of these services. So when you compile at least to the web, then some of these things have to be implemented differently. And you have to be aware of these environmental constraints. That definitely is a somewhat different environment to have to target. Let's then maybe look at what the sort of big steps have been leading up to this 3.0 release. So the first version of WebAssembly, what was in the box?

5:49So the first version is essentially was targeting customers we already had with ASM.js in particular, right? So there were already applications that just compiled a pre-existing CC++ code bases over to the web using ASM.js. And we wanted to be able to switch them over as soon as possible so that we can retire that technology and have something more forward facing. So the 1.0 release was totally targeted at low-level languages like C, C++ and Rust. And the feature set was really only you have this linear byte array as your memory model, and you have the four basic numeric data types, and that was all there was to it, right?

6:37So not much more than that. You could define functions, could compute in terms of arithmetics, and you had your memory. And you had a way of emulating function pointers. So that was it. like very basic virtual CPU, if you want. Yeah, well, and I remember hearing after that came out, there was something about, oh, this is super limited. And then people were like, hey, look, I rewrote this CPU-intensive library that we used to do in JavaScript. I rewrote it in Rust or I rewrote it in C. And now it's 30x faster. So these like stories of improvements. Now, those may be isolated cases. And actually that might be worth coming into.

7:16If you have a JavaScript application, what types of benefits do you see compiling down to WebAssembly over JavaScript? Yeah, I mean, that depends a lot on what your domain is and what kind of computation you're doing and how dynamic it is. So if you're really just doing low-level numeric stuff and you can basically ahead of time compile all that to a very efficient code, then that's where WebAssembly really shines, right? So you basically get next to native code performance. If you have more complicated language runtime things, especially in 1.0, like you need a garbage collector or anything like that, then you will have a much less pleasant time at that point because you have to emulate all that.

8:03And you are fighting against some of the abstractions that WebAssembly imposes, mostly for portability and security reasons. so right that's why for more high-level languages for example web assembly 1.0 is not a particularly attractive compilation target also in terms of performance it yeah again it depends a lot of what you can do of what you're doing so there are certainly things where javascript might even beat web assembly the reason being that it's a way more dynamic system right it does because it has to to be anything close to fast it does dynamic profiling dynamic recompilation and really really crazy things behind your back at runtime which of course all have a certain cost to them as well right you're just not seeing that usually but of course you can easily construct cases where this is creating much better runtime than than web assembly ever could because it doesn't try to be as smart right like so this has been a traditionally also fun thing with benchmarks because if you're like if you're not careful with benchmarks then javascript engines could easily optimize away like half of your code that you're what you're trying to measure and so yeah yeah i came up in the high performance computing world you know 20 25 years ago and benchmarks were and every compiler was trying to figure out okay how can i game this benchmark but in a way that's obvious that it's gamed.

9:30Yeah, that was like the time I was on the VA team, like in the 10s, mid 10s, early mid 10s, that the benchmark war was like all on, right? It was completely ridiculous. And I still feel a bit traumatized from that time and basically trust no benchmarks at all. Well, and we're revisiting that now in the LLM era, and everybody's trying to figure out benchmarks and they're not necessarily representative let's keep moving forward so you mentioned all right 1-0 targeting very low-level languages languages that probably aren't having to deal with garbage collect and aren't having to deal with these other things moving forward then 2-0 was how many years later uh depending on what you what you count right so there are the proposals and when they are done and then there's this official process about like releasing a spec which in this case took years after everybody already shipped all the features in it.

10:28So technically, I think it was released in 22. Practically, it was more or less done in 2019 or something, maybe 2020. I don't remember exactly. So that's when all the browsers implemented it and the features were completely done essentially. And the main big feature in 2.0 was the support for vector instructions. And that was again, take more advantage of hardware capabilities, really compute intense stuff and allow applications to take benefit of what modern hardware provides in that regard. Yeah, so that was a big feature. And then another, there were very smaller features. And one other interesting feature that was kind of showing a new direction was the addition of what we call reference types.

11:18so in addition to just these four numeric bit pattern types you now have an opaque type of references and that was two reasons at that point one was to have more first class handling of function pointers which we can't treat as transparent reference or as transparent pointers right because that would be completely unsafe so to have a way to pass them around you have to have a type that keeps them, that ensures that you can't peek at their bit patterns or anything. And the other reference type was external reference, and that gave you a way to basically pass through host values. So on the web, that would be JavaScript values through WebAssembly code, right?

12:02You can't do anything with them, but you can hold them and round trip them. And that offered a much more convenient interop story with the web in particular, where previously So you kind of had to maintain bijections on the boundary that was like really ugly and brittle to do. Yeah, I do remember that being a big thing of, you know, if you were going to port something over to a WebAssembly for a library or whatever, like really having to be careful about what's the interface and keeping it as slim as possible because it was hard to move anything around. Right, right. So, yeah, so external references, at least in principle, made that easier.

12:40Yeah. But also these were kind of like the inroads to what followed later with garbage collections of a much richer system of reference types. Yeah. Well, and it feels like in a lot of ways, 3.0, which is what brings us together here, was just a mammoth step forward in capabilities. I was reading somewhere that some of these things had been sort of in development for seven, eight years, which is just a mind blowing time frame for anyone in the tech industry, how much has changed in the last seven or eight years. So let's talk about the big release, 3.0, what was in the box and what did it look like?

13:16So the biggest feature arguably is the addition of garbage collection, right? So that's what I just mentioned with taking reference types to the next level. So you now have support for defining your own reference types and a memory layout for them. and then the WebAssembly engine takes care of allocating and deallocating them. It's noteworthy, though, that we try to make sure. So this has been a somewhat controversial feature because it's like, okay, that is no longer just like abstracting a CPU feature, right? It's a bit more high level. But we were very careful to kind of stay within the spirit of WebAssembly of being a low-level language.

14:00and I always phrase it as as low level as possible but no lower and so this is a very low level GC feature in the sense that all you get is essentially structs and arrays you don't get any objects or anything like that built in like you would have in other VMs like the Java VM or something right so it's really low level all you what the types are doing they describe to the engine what memory layout you want but you still have to map all your runtime data structure from your language to that low-level representation like you would do a native code right the only difference being that you tell the engine to allocate this stuff for you or one particular deallocate it but the complexity there is that yeah this type descriptions if you want to avoid a lot of runtime checks, then you need a more clever type system that always knows what it is you're referencing without having to do any CAS, or at least a minimum amount of CAS.

15:02And that's where the type system then becomes significantly more complicated. So yeah, that was one big thing. Let me quickly look at the list. Actually, before we go further on that, so since you're targeting not only languages with garbage collection, but still those original languages. Is that opt-in? How does one interact with it? So it's basically completely separate from this linear byte array that you had before. You can still use that. You can use both together. You can completely ignore the instruction set, the part of the instruction set that deals with GC. And then everything will be as before, right?

15:43Like you just don't have to use it. And some people have been worried about this creating extra cost in the engine. And actually, no, because like in web engines in particular, all it's doing, it's giving you essentially access to the garbage collector that was already there for JavaScript. Right. So now you can allocate something in there from WebAssembly code. And that's all that changes. They have one combined GC. so and that obviously was there before so nothing no extra cost there if you completely ignore this stuff so yeah those are completely separate memory area that does not overlap at all with with the linear memories yeah no that i think that's key it reminds me of like rust has this principle of cost-free abstractions right like anytime they can implement something that that doesn't have a runtime cost great in this case maybe it has a little bit of a runtime cost but it's opt-in if you don't use it it doesn't layer any cost to the other pieces exactly yeah and yeah we also have that philosophy i think c always had that philosophy or c plus plus they always call it pay as you go or some or maybe that was somewhere else but yeah there are various names for that and that's definitely a philosophy web assembly is also following yeah i was looking at at the feature list just before this so I can bring some of them.

17:03Another one that I saw that I'd love a little bit of a dive into what it means is this concept of having multiple memories. Right. So this is more actually a technicality because contrary to popular belief, you already were able to have multiple memories before. You just were not able to access multiple memories within a single module. But in WebAssembly before, you could have multiple modules that talk to each other and each of them defines their own memory that was totally okay there was just this weird gap that you could not bring them together in a way that you can directly talk and move values between multiple memories and that was both kind of like a performance cliff for for some kind of things that want to do that and it was also a gap in in the design like in terms of modularity so there are these tools that are basically acting like a static linker.

18:00So they take a set of modules and merge them together in one bigger module. And that worked with everything except memories, because you could not have multiple memories in one module, right? So in general, this would fail if more than one module defined one. And now that was one of the kind of intentional gaps we left in the initial design of WebAssembly 1.0 and always were meant to fill later. And it was more like, okay, we need to get something out of the door quick, so let's defer that. And now we've added that. It was basically one of the last kind of intentional gaps that we left initially that we filled in now.

18:36If you're using AI to code, ask yourself, are you building software or are you just playing prompt roulette? We know that unstructured prompting works at first, but eventually leads to AI slop and technical debt. Enter Zenflow. Zenflow takes you from vibe coding to AI-first engineering. It is the first AI orchestration layer that brings discipline to the chaos. It transforms free-form prompting into spec-driven workflows and multi-agent verification, where agents actually cross-check each other to prevent drift. You can even command a fleet of parallel agents to implement features and fix bugs simultaneously.

19:15We've seen teams accelerate delivery 2x to 10x. Stop gambling with prompts. Start orchestrating your AI. Turn raw speed into reliable, production-grade output at zenflow.free. SC Daily listeners, quick question. When things go wrong in production, do you know why in minutes or hours? AppSignal is the application performance monitoring tool designed for developers who want clean, actionable insights without a huge observability bill. You get all the tools you need to fix issues before customers notice, like error tracking, performance monitoring, log management, and more. AppSignal works for teams of all shapes and sizes, from startups and side hustles to SMEs and enterprise, and is especially great for teams that build with Ruby on Rails, Elixir, Node.js, and Python.

20:05Start your free 30-day trial and get 10 % off a yearly plan with code SCD10. Go to www.appsignal.com slash SED. That's www.appsignal.com slash SED and use code SED10. If you're an engineering leader, you know this cycle. Your team's focused on building product, but someone in ops needs a dashboard. Marketing needs an admin panel. Finance needs a custom workflow. The requests pile up. You can't get to them all, so people start building their own solutions. shadow IT spreads, and eventually, you're the one stuck cleaning up tools that were built with duct tape and good intentions. Retool breaks that cycle.

20:49Their AI AppGen platform gives teams a governed place to build the tools they need, so everything stays secure and under your control. Someone could type, build me a customer admin panel that manages accounts from Postgres, and they'd get a real, production-ready app with proper permissions built in. Your teams get unblocked, and you don't inherit a pile of technical debt down the road. So if you're tired of being the cleanup crew for Shadow IT, head to retool.com slash SEDaily and see how other engineering teams are democratizing app building without creating chaos. Because honestly, we could all use a better way to handle internal tools.

21:27Sometimes you just need Retool. It might actually be worth, just from a design perspective, because I think building a whole, I guess in this way, case compilation target a whole assembly level language that is pretty low level like that's a that's a programming domain not many people have explored like what types of intentional gaps did you leave in that 1.0 and what was like how did you think about that what were the trade-offs evaluated there were like three main gaps in terms of oh okay here we only allow one of these when really in in general in the future we want to allow multiple of these so the first thing was multiple values right so function or instruction initially could only return one result and that was kind of silly in terms of a stack machine and constraining so we lifted that and that was already like in the original paper we published that already had that worked out and then the other two were multiple tables and multiple memories so multiple tables kind of sneaked in in 2.0 as part of the reference types extension, because that meant that previously you only had function references, so you could just do everything with one table.

22:42But now you have multiple reference types, and we use tables in a more general way. So you need tables of different type, right, that naturally requires you to be able to define multiple ones. And then the multiple memories was the remaining one we added later. There has been talk about having multiple start functions, but that is not. You can easily work around that. But yeah, so these were kind of like gaps we left in there where all the instruction set and binary format already kind of anticipated that we will add them. Other than that, it was more like, okay, let's for now stick to the feature set of things that are already in ASM.js.

23:25So we have to cover everything in there. And then also So what is the intersection of all common CPUs at that point? So that everything that has a one-to-one translation in terms of instruction mapping to actual hardware, that is an easy one. And I think we didn't leave that many gaps there. There are more gaps now with SIMD, for example, because SIMD is a much sadder story in terms of hardware support where hardware vendors really can't get their shit together and agree on what the instructions are and what their corner cases are and what the feature matrices are and there are like random gaps in there that I really personally hate.

24:07But where just one hardware would not allow an efficient mapping of this particular case, so we leave it out. And maybe at some point we had that. Basically, we always have this MVP concept, right? In a more general fashion, which is, okay, let's always start with something that makes sense. and we already know we want to extend it later but have something that works and that we can ship and people start using it and we get feedback and experience and have a clearer picture of where we should take it from there. So WebAssembly 1.0 as a whole was an MVP with garbage collection like what we added now is sort of the garbage collection MVP.

24:46There is a whole list of post-MVP features that we have in mind that we might want to add at some point but they're that are not and totally essential right you can get by without them so this is more like the usual kind of thing we're doing where we kind of try to keep the broader picture in our head at least with have a rough idea how how that could be integrated later but focus on the things that we can solve quickly enough even though it still might take eight years i don't know Yeah, I'm curious, actually. So one, as you're getting that feedback from each version of MVP, which I think is that is the sort of approach that we all at least idealize as an approach.

25:29It's not always easy to follow. Is that feedback from browser implementations? Is that feedback from compiler implementers? Like what were the different things that ended up shaping from 1.0 to 2.0 to 3.0? Yeah, it's often like, sure, compiler writers, engine writers, framework writers. Sometimes it's CPU vendors that want to push there. Like this is a bit of what happened with Simni. There was a very strong push from CPU vendors to have support for their ultra cool and fast feature. So at that point, it might be somewhat political. But yeah, usually it's kind of for the bigger features. It's a broad understanding of, okay, we have this low-level language, and there clearly are things we can't handle yet, but what would that mean in terms of a feature?

26:19And then we design these bigger features. So, like GC was a discussion from the beginning. Exceptions is another thing that's in 3.0 now, right, which also was in the making for very long. Threads is another one that has in 3.0, although it's also already implemented everywhere and has been for years. The biggest gap now is still missing is something like some continuation-like feature. Maybe we want to talk about that later. But this is always things like we know that there are some language features you can't compile currently because there's some functionality missing. That is one big thing.

26:56And usually as engine people and compiler people, we know what these things are. And we already have plans to some degree for attacking these at some point. modular priorities and then sometimes there are smaller things that just come from clients users third-party compiler writers that notice oh you know this is kind of a thing that would be good to have here because i can't do it easily the other way and then they propose something as well yeah like that i mean this is a process i don't know how aware people are this like completely out in the open web assembly is totally like an open source project in a way and the committee is is open for everybody, right?

27:38So in theory, everybody can join there and propose a feature. But there is a very elaborate process you have to go through to push that feature over the edge in the end. In particular, you have to convince the rest of the committee that it's worthwhile. But that has happened a number of times. Well, actually, I wanted to kind of ask, are there any features that have made it out in one of the 2.0 or 3.0 releases that you did not anticipate, that were not sort of already in the back of your head of like, oh, yeah, we'll want to do that eventually? So I think more of those are kind of landing now that we have gotten over the hump of the big features that we wanted to do from the beginning.

28:23Maybe one thing I didn't anticipate was this relaxed SIMD kind of extension that we have in 3.0 now, which is also, to be honest, not a feature I'm particularly happy about. That's a different story. But other than that, most of these are kind of, yeah, have been in the making for a long time and always was a trajectory to them. I don't know when we started talking about 64-bit address spaces, but I'm pretty sure that also was from the beginning that eventually we will probably support a larger address space. So, yeah, it's a good question, But actually, in the releases so far, there aren't that many features that were not kind of that came up much later.

29:05Maybe just being a function of how long it takes to add a feature. Well, and in a lot of ways, I think this is well-trodden ground in terms of supporting all of these different languages. And so you're kind of catching up to the cutting edge in a lot of ways. And then at some point you catch up to that frontier and then there's what pushes forward. Speaking of that, I think one of the things that I saw that I thought was interesting was 3.0 added tail calls as well, which I think is a very important functionality in terms of enabling efficient use of more functional languages. I'm curious, kind of, if you look at the spectrum of languages, what does support for compiling to WebAssembly look like now?

29:49Are there any languages that are not actually supporting this yet? Well, I mean, that's up to the languages, but I would think that most languages that have a certain user base have some form of support for WebAssembly at that point. And 3.0, especially with garbage collection, but also Tailcalls was an enabler for a whole new set of languages targeting it now, like functional languages, like you mentioned, but also other GC languages like Java and C Sharp. and they're using that instruction set as well. Yeah, I mean, there are so many languages out there that I don't have anything closer to complete knowledge of who has a WebAssembly backend and who hasn't.

30:33But most of the languages that I come across, usually they already have it in some form with varying maturity, of course. But yeah, it's very much a thing these days in your compiler ecosystem to at least consider it. So looking at that now and looking at how much easier it is to navigate across the JavaScript to WebAssembly border now with these new features that you have this wide language support, can we revisit the question of when does it make sense to use a language targeting WebAssembly versus JavaScript or TypeScript? I think the calculus has probably changed a little bit since 1.0. Yeah, absolutely.

Read the full transcript

31:13So, right. So more high level languages, especially GC languages, are much more reasonable to compile them to WebAssembly now. I would think that actually it's reasonable for most applications. The only thing if you're really building something that all what it's doing is DOM interaction and manipulating the DOM, then you probably won't get much value out of it. right? Definitely not in terms of performance. It won't necessarily be slower either, but you might have to jump through extra hoops with all the glue code and so on and so forth, which is much quicker if you can just do it in JavaScript directly.

31:54So that is the main domain where I would say, okay, it's probably still better to use JavaScript. Or potentially, if you're compiling a language that is very closely integrating with JavaScript by design, right, then that might also be better to still target JavaScript itself. So that's kind of actually an interesting thing to discuss. So when I think about building an application in JavaScript, and particularly for the web, you have JavaScript, the language, all the runtime and libraries, but you also have all of these web-specific APIs that are available in JavaScript. Are those exposed directly in WebAssembly as well if you're building for the browser?

32:33Or do you have to hop over to JavaScript to access the API and then hop back? Yeah, that's a famous kind of question and complaint. Give me DOM access, right? The thing is, yeah, right now you don't have that. And that is actually a very important part of the whole WebAssembly security model that it's completely sandboxed, right? You have no ambient capabilities to have any access to your environment whatsoever. Anything you can do or interaction you have with your environment has to come through imports. And that's like core to its very tight sandboxing functionality. So what you have, though, is this very tight integration with JavaScript in the sense that a WebAssembly function you import can just be supplied as a JavaScript function, providing the kind of signatures match up sufficiently well.

33:26So basically, you can just import JavaScript functions and then just call them as if they were WebAssembly functions. The problem, of course, is that all the web APIs are really totally designed for JavaScript, and they don't really make a lot of, or many of them don't make a lot of sense in terms of a more moderate kind of object system language. So you usually end up having to write some, or may have to do some glue code there. But this is more like a tooling problem. So people often make the assumption that it would be way faster if they could access, say, the DOM from WebAssembly directly.

34:05But that's not actually necessarily the case, in particular, since JavaScript engines already go to way more lengths to optimize all sorts of things about accessing objects and JavaScript objects and DOM objects. And that would be a ton and a megaton of stuff that you would have to replicate in the WebAssembly code generator. and I don't think anybody is willing to do that because it's kind of silly, right? You wouldn't even, probably not even get much performance out of that because the overhead of calling from WebAssembly into JavaScript is actually mostly dominated by the actual work done in the DOM itself, right?

34:45With most of these calls. So the assumption that it would be way faster or something is not actually very accurate. That being said, there is some work now. So one thing you would like to have is at least have some kind of interfaces for accessing the DOM, which people sort of agree upon. And that is something that is sort of a separate layer from WebAssembly core itself, right? So people have now started looking into this in the context of this component model work. and so that might be something like maybe similar to these WESI libraries but for the web so we start defining interfaces and they grow kind of organically and maybe at some point when they are mature enough we've iterated enough on them and we might even standardize some of that but until then it might just be a library or tool chain that just does this for you and you don't have to worry about it anymore because that's the other thing right with the web API is a gigantic and be a moving target.

35:53So standardizing anything around that is kind of a challenge, right? Like you, you were more generous than I was. I was going to say a fool's errand. And you have to go through the pain of like trying to find the nice mapping to something that makes sense in WebAssembly and possibly for more than just one language that wants to interface. That was the thing that I was going to ask is, you know, now that you have relatively flexible, a relatively flexible type system, is there actually a substantial difference in terms of the interfaces per language, right? WebAssembly is pretty, leaves a lot of that to the language compiler.

36:33So there's still no like sort of automatic interoperability between languages, And that is very intentional because that in practice never works, because even the smallest impedance mismatches basically usually break everything. So it was very much an axiom in WebAssembly's design that we not try to solve this problem because it's essentially insolvable, at least on that level. And trying to solve this is sort of what the component model tries to do. that defines a somewhat more high-level language agnostic type layer, which is more high-level as well than GC types we have in WebAssembly now because I mentioned that these are very low-level.

37:13They don't know what an object is or anything like that. They just talk about low-level representations, really. So the component model has more high-level types, and they are particularly designed for multiple languages to be able to map to them and talk through these with each other. And that would be the preferred way to also define maybe a web API for WebAssembly. So on this level of type system that everybody knows already, at least if they want to implement against the component model, they already know how to talk to and have mapped to their language. Let's maybe step back a moment and describe the component model.

37:52So this is another WebAssembly spec or what exactly is it? So this is ongoing work still. And at some point, it might be a different spec, but we're not quite there yet. So this is trying to define a separate layer on top of WebAssembly itself, which is like a more advanced module system, if you want. That's one view of it, plus a more high level language agnostic type language to describe interfaces, right? And with that, you can basically specify how you bundle WebAssembly modules. You can define how they instantiate each other probably and things like that. And then there is this closely connected to that, this WESI effort, the WebAssembly systems interface, which tries to define a whole set of kind of standard in air quotes interfaces with respect to this component model.

38:49so that like that are operating system abstractions for example so you can use them and there are different ways to implement these interfaces either a web assembly engine implements natively so you have direct access to your host environment or they could be virtualized in other ways and the component model is pretty rich in allowing various ways of implementing interfaces and plugging things together for virtualization and stuff like that but yeah so that that is ongoing work still. It's a very complicated problem to solve, as you can imagine. And many people tried to solve that problem before.

39:24And there have been various technologies that don't have the best reputation, let's say, historically. I'm not much involved in that other than talking to the people doing most of the work. But we are kind of very careful to not try to repeat the mistakes, have a more constrained system and take advantage of some of the inherent design advantages that WebAssembly has, like the strong sandboxing and all that, right? And the strict portability. So it tries not to solve all the problems in the world at once. It makes some informed opinionated choices, like when modules of different languages talk to each other, it's all like a shared nothing concurrency model.

40:07So you can't really pass pointers across the boundary because that introduces all sorts of extra problems, right, that you want to avoid. That might also mean that it doesn't solve everybody's problem, but at least it solves a certain set of problems in that space. And from there, we can maybe get more experience about other points in the space after that. Got it. So to sort of play back to make sure that I understand, right now in the WebAssembly world, if you had different language implementations of different modules, there's no guarantee at all that they're going to be able to talk to that.

40:42That's basically on the developer to say, here's the defined interface that you have to match and go. And so probably most people are developing these things as a pluggable piece, either all built in one language or they're owning the whole system that's interacting. And what the component model, if I'm understanding correctly, is saying, let's define a higher level interface that is true across languages so that you could build essentially libraries or modules that can interface with each other without having to know the whole system front to end. Yeah, I mean, the situation with bare WebAssembly is kind of like with hardware, right?

41:17So you have your hardware types and that's it. And then if you want to have different compilers be able to talk to each other or to talk to an operating system or some other kind of environment thing, you need an ABI, right? An application binary interface. And that is something you can well define on top of WebAssembly. So far, nobody has done that. Although like a few weeks ago when we had the last face-to-face meeting, there was actually talk about defining a C-ABI for WebAssembly, which is the main one that everybody wants, right? So you at least know how to talk to a CFFI or something, and that is standardized across multiple compilers.

41:54And the component model you can view as an ABI on steroids if you want, because it's not a fixed ABI. You have a glue layer in between. You can define how you interface to that. But yeah, other than that, that's exactly what it is. Well, and this starts to, I think, take you out of the world of WebAssembly is a way to build singular web applications and into a world where you say, OK, WebAssembly might be a generalized operating system or virtual machine that you can target for different reasons. So let's maybe actually divert over here. We've talked a lot about web use cases for WebAssembly. What are some of the non-web use cases that people are wanting to use this for?

42:40Oh, there are many web use cases at this point. Actually, the web is just one among many at this point, which kind of we hoped for from the beginning, and it worked out better than we expected. I mean, we made very sure that the WebAssembly design and also the spec is not at all tied to the web or JavaScript for that matter, right? And the web in the name was more like a marketing thing, if you want. it's really intended to be like this maybe a bit hyperbole but a universal vm if you want right and so what are the use cases so people are using it on for edge computing a lot right like fastly is the biggest company doing that they bet everything on web assembly there lots of use cases in embedded space which kind of confused me for a while because why would they take this overhead when they have small CPUs anyway.

43:34Well, it turns out the big feature for them is portability. So we have people from Siemens, for example, in the working group who explain that, you know, we have all these embedded devices and there are new processors every year or month or whatever. And it's a pain in the ass every time you have to rebuild your entire tool chain. And now they don't want to do that anymore. They want to have a WebAssembly tool chain and then basically just switch out the backend for their CPU directly, right? But they have this very different use case from the web because, first of all, they have much smaller systems, so they need a much leaner runtime, idly, like zero size if you want.

44:17And they also want to do ahead-of-time compilation. They don't want to do JIT compilation like you do on the web, right? They have this whole tool chain, but in the end, they compile to the actual hardware they want. And of course, WebAssembly was designed with AOT in mind as well. We always wanted that to be an option. So we also took a lot of care to not shut the door on that. And there are other kind of optimizers that take benefit of that. But yeah, actually seeing that happening for realists is also interesting. there are more fancy use cases like in ai where you kind of use web assembly to control pruning in some search or whatever so you make some things programmable but in a portable way right with a very universal language like you you script your your pruning algorithm that way i think microsoft did something like that there are blockchains who use it as their execution platform And one of the features they are particularly interested in, besides the sandboxing, is the well-defined deterministic semantics.

45:24Because if that's the code you execute on the blockchain, I mean, blockchain is a whole hype word, right? But what matters there technically is you do replicated computation, and then you rely on consensus between the different replica to deliver the same result. And of course, that won't fly if you have underdefined, underspecified behavior all over the place, because then everybody will disagree all the time, right? And WebAssembly is, to a large extent, fully specified and fully deterministic. And with 3.0, we even have a deterministic profile now, which is kind of specifying if you really want to be fully deterministic.

46:05This is what it means. So everybody has a clear picture of what that means and can depend on that. So you always get the same result. So let me actually dig in a little bit on this, because I think naively I tend to think of most traditional programming environments as being deterministic. As contrasted to now we do all this stuff with machine learning and LLMs, and that's where I think of, oh, that's non-deterministic. I should explain here that deterministic is used here in more like an abstract way. So we say that language semantics is non-deterministic if it is may be specified, but allows multiple different behaviors.

46:44So, and then any particular execution or any particular implementation can pick one of these. But the point being, if you run on different hardware or maybe under different hardware constraints, right, then you could get these different behaviors, right? And that's what you don't want. So the way you model that semantically is usually as non-determinism. So just you get a random pick of the allowed behavior. Got it, got it, got it. So this is places where essentially the language spec does not fully pin everything down. And so different implementations of that on hardware or just different compilers or whatever can make different choices.

47:19And so it may be deterministic within a single environment, but across environments, it's non-deterministic. Yeah, and even within a single one, it sometimes might not be. You never really know. So WebAssembly 1.0 was very neat in that regard. There was only one little source of non-determinism, which was with floating point arithmetics. So if they generate NANs, then unfortunately, the IEEE standard for floats failed to define what the bit patterns are for NANs. And all the hardware vendors completely disagree on what they do and even how they interpret these. So there are funny things like IEEE defining a quiet bit or signaling bit on NANs.

48:00But it doesn't define what way it's to be interpreted, whether one is signaling or zero. and surely hardware disagrees on that choice, right? So silly things like that. And initially we tried to even knock that down and say, okay, if your hardware's behavior diverges from what we specify, you have to normalize all your NANDs. But it turns out that is very expensive. You don't really want to pay the cost because then all float computations get more expensive. Although that's what, for example, blockchain implementations do exactly, right? They do that. It's not that bad, But you pay a certain price for that.

48:38Right. So that is the kind of thing why we have non-determinism on the spec level. Of course, you also have natural non-determinism once you start talking about things like threats, right? Because that's essential in the concurrency model that you have non-determinism. That is more like intentional non-determinism. That's really core to what the feature is about. But all the other are sort of like accidental non-determinisms that are just really under specifications because we can't do better. And the less we have of that, the better. Yeah. Well, and this is sort of a level of care or if you're on the other side, like pedanticism that most developers never have to worry about.

49:18But if you're a language designer, all the way down. Okay. So we talked about some of those use cases. We talked about how hardware embedded folks might be doing this to simplify their toolchain, blockchain. You talked about determinism. What are some of the other drivers for non-web use cases to adopt WebAssembly as their target? I think it's usually two things. One is portability and the other is the sandboxing model. And of course, the fact that it's pretty universal as well. So it's like Turing Complete. You can compile everything into it. It's not constrained in any particular way. So those are the three reasons why it's a good fit for various places where you want to kind of embed some form of compute without tying yourself to whatever, like the specific scripting language or open security holds or whatever.

50:07Right. So that's kind of how you make use of it. Yeah. And it's also fast, which sometimes is a bonus as well. Yeah, so I think the example that comes to mind for the closest to that sort of universal virtual machine model that anyone's come before, I think, is the JVM and all the different JVM targeting languages. What are the factors that might cause somebody to move from a JVM environment to a WebAssembly environment? Are they exactly what we just said? Is there some other nuance we're missing? Yeah, I mean, the JVM is interesting because that is really a VM that was designed for Java, right?

50:43And it's basically an abstract syntax for Java, if you want. So it has all the Java object model built in, which is pretty heavyweight, including all the reflection stuff and so on. And there are other things it doesn't have built in, right? You can't do. So when you compile to JVM, and many languages have done that, usually if you don't happen to be very much exactly like Java, then it's not going to be very fast. There are things like, so for example, with the GC extension now, one thing we have that other VMs don't have is we have tagged pointers. So I don't know if you know what tagged pointers are, but if you have a garbage collection runtime, then usually you have the garbage collector has to know what a pointer is.

51:34And sometimes you want to unbox integers so that you don't have to put everything into a box and allocate. So you usually use pointer tagging, which is you take a bit off every pointer that marks it as an integer. And then you can just use an integer as if it was a pointer and the GC knows about this bit and just follows the real points. And that's something we actually provide directly as a WebAssembly feature, whereas in other VMs you don't have that. But there are many language runtimes that make heavy use of such a feature to avoid boxing all their small types. and do things like polymorphism much more efficiently.

52:13And with the JVM, you pay the price for the heavyweight object model. So if you're compiling a language that, for example, has lots of very small allocations, which is, for example, the characteristics of many functional language, then that would not be ideal for you because your characteristics run against what it's optimized for. And then there are other things like, I don't know, if you want to do closures and stuff, that's also very costly in the JVM because it's not like native to it and you have to encode it in heavyweight ways and all these things, right? Like you don't have access to the low level as much as you have in WebAssembly.

52:55So you have to jump through more hoops in a way. So let's now look forward a little bit. What does the next generation in WebAssembly look like? what can't WebAssembly do well right now? We mentioned a little bit the component model, and that is a big area of exploration and focus. You also sort of had a throwaway comment about continuations. Maybe we can dive into that. But yeah, what's coming down the road? Right. So in terms of bigger features, I mean, there are various small features in the making, but the two big features I would say that are still missing from core WebAssembly, so not the component model, is threads.

53:34is the one which is sort of close to the finishing line, finally, I hope. And the other is what used to be known as stack switching, which turns out we model it as this form of delimited continuations. And the reason this feature is important because this is what allows you to compile at least efficiently all these control abstractions that modern languages have. And control abstractions are things like, I don't know, async await, generators, green threads, you name it, right? All these things where you have non-local control flow. And usually these are implemented or often they are implemented in some way or the other by having multiple stacks that you switch between.

54:20And when you are in a system like WebAssembly where you have to be type safe and where also the actual stacks are kind of encapsulated, you can't really get to them for safety security reasons. Then it turns out that there is a neat abstraction that is already well known in the programming language field for decades, which are continuations or delimited continuations. So that is kind of like how we model them. So you have a way of, and basically a continuation is a new stack if you want. You have a way of creating a new one and then you can resume their computation there, which basically switches over to that stack.

54:57And then that computation can suspend, which switches you back to the point where you resumed, very roughly speaking. And you can have as many of those as you want. So I assume that since those control flow features that you mentioned are in a number of languages, including some that I believe already target WebAssembly, how are they supported today? What will this take you forward to? There are many kind of ways to do that. So the most powerful way where you can do all that is you do a global program transformation called CPS. So continuation passing style where for every function you have an additional parameter which tells it where to continue instead of returning.

55:39That is also a well-known technique, but you can imagine that it's pretty expensive. So some languages actually do that. Others use tricks by, I don't know, trampolining through JavaScript, for example. That is, by the way, also how C++ implemented exceptions before WebAssembly 3.0, right? It had to call into JavaScript to create an exception handler, then call back into WebAssembly to actually run its body and so on and so forth, which is also kind of crazy. And of course, it only works when you have JavaScript. That's one technique, yeah. So once you have exceptions, you can do trampolining, which is you just build up your call stack and eventually you throw back to a scheduler that then somehow has an idea of how to build up the call stack again if it has to.

56:26And there are various techniques like that. They all have in common that they tend to be brittle and costly to some extent and not very modular. So one of the features our proposal has, which is something that came out of academia in the last kind of 15, 20 years, it's based on this idea of effect handlers, which is essentially the simplest way to understand it is a generalization of exception handlers that allow you to resume at the point where you're through. but you can resume at any later time. And the thing, the continuation is essentially your object that allows you to resume. What effect handlers give you, as opposed to these other techniques, is that you can compose these handlers in a nice way and without them interfering with each other.

57:21Whereas if you have to manually do these transformations and you have more than one of these control effects in your language, then you have to do all of them kind of together. With effect handlers, you can do them in modular ways separate from each other. They don't have to know much about each other. You can just suspend over another handler, essentially. And that is very nice, for example, if you want to do both threads, so green threads, virtual threads, and say async await or generators, then one is in a much smaller scope, but you still want to be able to suspend the entire thread that runs the generator directly going to the outer one, right?

58:00Without the generator logic having to know anything about that. No, I think it's really interesting. We've had a number of conversations with different folks about kind of advances in the programming language world. And like we have these newer languages that are building on these capabilities that have really just happened in the last 10, 15 years. If you look forward even further, so that's what's on the horizon now, what else is in the back of your head of we're going to want to get there eventually, we're going to need to get there, what you want to enable with WebAssembly? Well, yeah, I mean, we've already got quite far as far as I'm concerned.

58:42So one thing I would like to see is WebAssembly having more built-in support, like in standard operating systems, for example. So it's in every browser, but why does, I don't know, macOS or Linux or Windows not support it out of the box, right? So that you can actually run just desktop applications using WebAssembly. So it becomes even more of a portable format. And the extreme point of that would be to put it into hardware. So I keep hearing people talking about that and considering the ideas. So far, as far as I'm aware, nobody has actually tried to do that for real. And there are some hurdles you have to get over, but in principle, it should be possible.

59:25And that might also be very interesting. Because it's a virtual CPU, ultimately, and at least some feature subset of it should be possible to implement more or less directly in hardware. So what you're saying is the next ARM spec or something like that is directly targeting WebAssembly? Well, not the ARM spec, but there might be a WESM processor, a WESM CPU of kinds, and maybe a custom chip or whatever, or FPGA or something that people who want to run that in certain environments can take advantage of. I don't know, something like that. Love it. Well, we're coming close to the end of our time here.

1:00:06Is there anything we haven't talked about yet that you think would be good to leave our listeners with? Yeah, I mean, one thing I could briefly mention is because I'm heavily involved with that side is the specification side of things with WebAssembly. So one thing we're particularly proud of is that not just don't we have undefined behavior at all, right? We have everything formally mathematically specified and verified. So we have machine verified proofs that we don't have undefined behavior. And there's a lot of work going into that and extending the kind of infrastructure for that now with various research teams that hook it up to various theory improvers to do even more fancy things of theory improving reasoning about programs and things like that, which I think is a whole new level for an industrial programming language that nobody has done before either.

1:00:59So that's something I'm particularly interested in as well, because that ties back to my academic self, half of myself that likes that stuff, too. But I think it's very valuable. And I mean, the reason that WebAssembly has such a clean and fairly safe design is because we design or one of the reasons, at least I would claim, is that we designed it with formalization hand in hand. We didn't just build this artifact and then try to make sense of it after the fact. We really did it at the same time. And that's when you kind of have to be honest with yourself when you're designing something and you have to formalize it.

1:01:40And the formalization becomes hard. And probably the design isn't quite right. So it's a nice feedback loop in the similar way that implementation is a nice feedback loop. You want to do all these things in parallel and feedback into the design. So both for semantics and performance and these things, which I would love people to explore more, also for other languages. And that would give us also the other nice thing about that is that this gives a way of actually doing verification in depth, right? So because we now have verified hardware, we have a verified engine like WebAssembly, and maybe we can now build more verified compilers, and then you can actually verify the entire software stack at some point.

1:02:24I would love to see that kind of thing because, frankly, the state of the art with our kind of craft is still like these things to be desired. And not to be too much on the bubble area, but if we're using non-deterministic machines to generate code, which is what more and more people are doing with LLM-based programming, having a way to deterministically validate and verify it after the fact is going to be ever more important. Right. Yeah, absolutely. Yeah. The more code we let be generated by dubious sources. I mean, humans are pretty dubious as well. I've read a lot of human written code that feels pretty dubious to me.

1:03:11Fair enough. Yeah. But for some reason, people are less willing to trust humans when writing code than they're willing to trust AI when it's writing code. There was just a study coming out I just read about today that is a bit scary. So when you're pair programming with a human partner, then you usually question everything he's doing. When you do that with an AI, not so much, although it's at least as failable. Formal validation of the outputs. Yeah. Definitely would be nice. But that's very much an open research area as well because it's a very hard problem in general. Awesome. Well, thank you.

1:03:51And let's wrap. Thank you very much.

From the publisher

WebAssembly, or WASM, has grown from a low-level compilation target for C and C++ into one of the most influential technologies in modern computing. It now powers browser applications, edge compute platforms, embedded systems, and a growing ecosystem of languages targeting a portable and secure execution model. Andreas Rossberg is a programming languages researcher and

The post WebAssembly 3.0 with Andreas Rossberg appeared first on Software Engineering Daily.

More from Software Engineering Daily

All 195 episodes
WebAssembly 3.0 with Andreas RossbergSoftware Engineering Daily · 1 h 1 min
Listen in VO