- Hands-On Game Development with WebAssembly
- Rick Battagline
- 451字
- 2021-06-24 13:40:59
Why do we need WebAssembly?
JavaScript has been around for a long time. It has evolved from a little scripting language that allowed bells and whistles to be added to a web page, to a sprawling JIT compiled language with a massive ecosystem that can be used to write fully fledged applications. Today, JavaScript is doing a lot of things that were probably never imagined when it was created by Netscape in 1995. JavaScript is an interpreted language, meaning that it must be parsed, compiled, and optimized on the fly. JavaScript is also a dynamically typed language, which creates headaches for an optimizer.
WebAssembly solves a lot of the problems created by JavaScript and its long history in the browser. Because the JavaScript engine is already in bytecode format, it does not need to run a parser, which removes a significant bottleneck in the execution of our application. This design also allows the JavaScript engine to know what data types it is dealing with at all times. The bytecode makes optimization a lot easier. The format allows multiple threads in the browsers to work on compiling and optimizing different parts of the code at the same time.
WebAssembly is not a high-level programming language, but a binary file with opcodes for a virtual machine. Currently, it is considered to be in an MVP stage of development. The technology is still in its infancy, but even now it offers notable performance and file size benefits for many use cases, such as game development. Because of the current limitations of WebAssembly, we have only two choices for languages to use for its development—C/C++ or Rust. The long-term plan for WebAssembly is to support a wide selection of programming languages for its development. If I wanted to write at the lowest level of abstraction, I could write everything in Web Assembly Text (WAT), but WAT was developed as a language to support debugging and testing and was not intended to be used by developers for writing applications.
- Learning Cocos2d-x Game Development
- 網絡服務器配置與管理(第3版)
- Learning AngularJS Animations
- 基于Proteus和Keil的C51程序設計項目教程(第2版):理論、仿真、實踐相融合
- 嵌入式技術基礎與實踐(第5版)
- 3ds Max Speed Modeling for 3D Artists
- 單片機開發與典型工程項目實例詳解
- Source SDK Game Development Essentials
- 基于Proteus仿真的51單片機應用
- RISC-V處理器與片上系統設計:基于FPGA與云平臺的實驗教程
- 電腦組裝與維護即時通
- Mastering Machine Learning on AWS
- FreeSWITCH Cookbook
- UML精粹:標準對象建模語言簡明指南(第3版)
- MicroPython Cookbook