- Learn WebAssembly
- Mike Rourke
- 189字
- 2021-08-13 15:38:53
WebAssembly.Module
The WebAssembly.Module object is the intermediate step between the ArrayBuffer and the instantiated module. The compile() and instantiate() methods (and their streaming counterparts) return a Promise that resolves with a module (module in lowercase represents the compiled Module). A module can also be created synchronously by passing a typed array or ArrayBuffer directly into the constructor, but this is discouraged for large modules.
The Module object also has three static methods: exports(), imports(), and customSections(). All three take a module as a parameter, but customSections() takes a string representing the section name as its second parameter. Custom sections are described in the Binary Format section of the Core Specification and are intended to be used for debugging information or third-party extensions. In most cases, you won't need to define these. The exports() function is useful if you're using a Wasm module that you didn't create, although you'll only be able to see the name and kind (for example, function) of each export.
For simple use cases, you won't be dealing directly with the Module object or compiled module. Most of the interaction will take place with an Instance.
- 程序員修煉之道:程序設(shè)計(jì)入門30講
- 微信公眾平臺與小程序開發(fā):從零搭建整套系統(tǒng)
- Spring Cloud Alibaba微服務(wù)架構(gòu)設(shè)計(jì)與開發(fā)實(shí)戰(zhàn)
- Apache Spark 2.x Machine Learning Cookbook
- JMeter 性能測試實(shí)戰(zhàn)(第2版)
- Java開發(fā)入行真功夫
- Mastering matplotlib
- SAS數(shù)據(jù)統(tǒng)計(jì)分析與編程實(shí)踐
- ExtJS高級程序設(shè)計(jì)
- Mastering Backbone.js
- Building Machine Learning Systems with Python(Second Edition)
- LabVIEW虛擬儀器程序設(shè)計(jì)從入門到精通(第二版)
- Parallel Programming with Python
- Learning Ionic(Second Edition)
- Image Processing with ImageJ(Second Edition)