5 ms·
Fun fact: The new MS Flight Simulator 2020 uses WebAssembly to run the software for the aircrafts in game. You can check the release notes, where they do detail
by zaarn 6y ago
Fun fact: The new MS Flight Simulator 2020 uses WebAssembly to run the software for the aircrafts in game. You can check the release notes, where they do detail that webassembly is used for the SDK as well.
The intention is likely that if the onboard computer emulation crashes (which it sometimes does) you can simulate the actual onboard computer restarting without it taking down the game.
- k__ 6y agoFun fact: The Cloudflare Workers FaaS platform uses WebAssembly to run the software for your non-JS function in the cloud. You can check their blog, where they have a guide for Rust[1]. The intention is likely that they use V8 isolates instead of VMs which support WebAssembly. [1] https://blog.cloudflare.com/introducing-wrangler-cli/ https://blog.cloudflare.com/introducing-wrangler-cli/ SCNR :D
- flohofwoe 6y agoIt might be more likely that WASM is used for its sandboxing qualities while providing "near-native" performance for all types of extensions (not just the aircraft computers), because new aircraft modules and extensions are often provided by third-party companies or the modding community. Traditionally, scripting languages have been used to integrate "untrusted code" (e.g. DCS World, another popular flight sim, uses Lua for its aircraft modules and also exposes a lot of other functionality through Lua scripts so that they are moddable).
- zaarn 6y agoBasically, yeah, it isolates the interactive parts of the plane (animations, likely, as well as OBC and friends). The WASM Runtime used is on github, https://innative.dev/ https://innative.dev/
- Tarq0n 6y agoInteresting. How does this differ from WASMtime, the focus on C compatibility?
- zaarn 6y agoWASMtime is JIT, Innative is AOT. WASMtime means you can run webassembly data on the fly from memory. Innative compiles everything into a proper linkable C object, so you can link it as if it was natively compiled. It embeds LLVM so it should get decent performance out of everything.
- AnIdiotOnTheNet 6y ago> The intention is likely that if the onboard computer emulation crashes (which it sometimes does) you can simulate the actual onboard computer restarting without it taking down the game. That doesn't really make any sense to me as a motivation. The vast majority of ways they could have chosen to simulate the onboard computer would have that quality. I would guess they chose WASM because they expect a lot of third-party expansion and it provides a VM that can be targeted by almost any language.
- zaarn 6y agoWell, also yes, the side effect being that third party OBC's won't crash your game if they go down. And I would point out I've gotten the OBC in the default plane models to crash a few times, they either get stuck in some undefined state or go black and recover after a few seconds. It's rather interesting to observe.