Skip to content
Go back

WebAssembly

Published:  at  10:34

On this page

Introduce

WAT WebAssembly 的文本格式,浏览器 Response 展示的格式

实践

https://github.com/sunven/webAssembly-demo

1. Compile a WebAssembly module from…

使用 assemblyscript: https://www.assemblyscript.org/getting-started.html

2. Use the compiled WebAssembly…

WebAssembly.compile() 编译 WebAssembly 二进制代码到一个 WebAssembly.Module 对象

WebAssembly.compileStreaming() 从一个流式的底层源编译一个 WebAssembly.Module

const module = await WebAssembly.compileStreaming(fetch(url))
const { exports } = await WebAssembly.instantiate(module, {})

可以替换为:

  const {
    instance: { exports },
  } = await WebAssembly.instantiateStreaming(fetch(url), {})
  return exports

3. Inspect WebAssembly…

chrome devtool

use case

https://wasmbyexample.dev/home.en-us.html

https://github.com/mcuking/Awesome-WebAssembly-Applications


Suggest Changes

Previous Post
My Linux
Next Post
My Mac

Most Related Posts

  • codec in js

    Published:  at  17:00

    codec in js

  • low code

    Published:  at  20:30

    low code

  • css

    Published:  at  20:39

    css

  • WSL 基本使用

    Published:  at  12:40

    WSL (Windows Subsystem for Linux) 的基本安装、配置、使用方法以及常见问题的解决方案。

  • generative ai for beginners

    Published:  at  21:04

    generative ai for beginners