WebAssembly 简介 - 陈思衡
第三届中国Rust开发者大会 WebAssembly 简介 WebAssembly(简称 Wasm)是一种新的编译目标,帮助在 web 中运行高性能应用。它是一种低级语言,设计为编 译器目标,以在 web 浏览器中高效运行。 WebAssembly 介绍 WebAssembly 代码可以以接近原生的速度 运行,且具有很小的二进制大小和快速加 载速度。 # 高性能 WebAssembly 最初由 Mozilla、Google、 Edge。 # 标准稳定 # 多语言支持 WebAssembly 设计为安全地嵌入到网页 中。它提供一种沙箱环境,禁止直接访问 浏览器功能或用户数据。而是需要通过 host function 来访问宿主环境。 # 安全性 现在多种语言都有编译器支持 WebAssembly,如 C/C++、Rust、Go、Zig 等。 WebAssembly 简介 Photo / image / chart 所看到的地址。 WebAssembly 机制 memory Wasm 编写的 function 可以通过 “export” 导出给 host 调用。 Host 可以把自己的 function 通过 “import“ 提供给 wasm 调用。 function WebAssembly 简介 Photo / image / chart Wasm 实例 WebAssembly 简介 WASI0 码力 | 24 页 | 773.46 KB | 1 年前3Just-in-Time Compilation - J F Bastien - CppCon 2020
called WebAssembly. It offers compact representation, efficient validation and compilation, and safe low to no-overhead execution. Rather than committing to a specific programming model, WebAssembly is use cases beyond just the Web. WebAssembly has been designed with a formal semantics from the start. We describe the motivation, design and formal semantics of WebAssembly and provide some preliminary Speed with WebAssembly — 2017 (read)Engineers from the four major browser vendors have risen to the challenge and collaboratively designed a portable low-level bytecode called WebAssembly. It offers0 码力 | 111 页 | 3.98 MB | 5 月前302. Service Mesh落地之后_为sidecar注入灵魂 - 周群力
Mesh 落地之后: 为 sidecar 注入灵魂 2 • Multi Runtime: 从 sidecar 到机甲 • Runtime API: 解决跨云部署和厂商绑定难题 • WebAssembly in sidecar: 让业务逻辑跑在sidecar里 • Service Mesh 回顾 • 展望2022:待解决的问题 • 总结 3 Service Mesh 回顾 Service 具体部署几个全看取舍 45 WebAssembly in sidecar: 让业务逻辑跑在sidecar里 WebAssembly(WASM)简介 46 • 语言无关 • 平台无关 • 可移植 • 内存安全的沙箱隔离环境 浏览器 compile program WASM Runtime Lucet 业务逻辑? Serverless? WebAssembly 落地原理 47 MOSN WASM MOSN集成了WASM运行时 WebAssembly 应用场景 48 Refer https://github.com/mosn/layotto/issues/166 sidecar App App2 SDK App2 App App2 .wasm App2 App2 binary Reloadable SDK WebAssembly 应用场景 49 Sandbox0 码力 | 63 页 | 880.85 KB | 1 年前3MoonBit月兔编程语言 现代编程思想 第十四课 案例:堆栈虚拟机
+ 1) MOVE 2 1 0 ; R(2) = R(1) RETURN 2 2 0 ; return R(2) RETURN 0 1 0 ; return 4 堆栈虚拟机 例:WebAssembly Virtual Machine 取最⼤值 fn max(a : Int, b : Int) -> Int 1. local.get $a local.set $m get $m ;; m 5 WebAssembly WebAssembly是什么? ⼀个虚拟指令集 可以在浏览器以及其他运⾏时(Wasmtime WAMR WasmEdge等)中运⾏ MoonBit的第⼀个后端 WebAssembly指令集的⼦集为例 6 简单指令集 数据 只考虑32位有符号整数 ⾮零代表 true 在线尝试 https://webassembly.github.io/wabt/demo/wat2wasm/ 1. const wasmInstance = new WebAssembly.Instance(wasmModule, {"spectest":{"print_int": console.log}}); 17 构造编译器 指令 WebAssembly指令 Const(0) i320 码力 | 31 页 | 594.38 KB | 1 年前3PyConChina2022-上海-在浏览器中运行 Python-韩骏
needed, all in browser environment How? Standing on the Shoulders of Giants: • WebAssembly/WASM (https://webassembly.org/) • Emscripten (https://emscripten.org/): Compile your existing projects written (https://pyodide.org/en/stable/): A Python distribution for the browser and Node.js based on WebAssembly. How it works? How it works for more Interpreted Languages? Great minds think alike • https://github in the Integrated Terminal Debugpy with WebAssembly (proposal) https://github.com/microsoft/debugpy/wiki/Debugpy-with-Webassembly-(proposal) WebAssembly is the future! Thanks! 感谢观看0 码力 | 13 页 | 1.79 MB | 1 年前3基于 Rust 语言编写的可编程的全球分布式 MQTT 服务器 王文庭
性能(C/C++/Rust) • 开发效率 (Rust/Golang/Java) • 编译的产物要⾜够⼩(C/C++/Rust) • 内存安全(Rust/Golang/Java) • 对WebAssembly⽣态⽀持友好 Why Rust? • 云端架构,我们⽆法根据设备地理位置实现就近通讯 • 只能做到在数据中⼼内相关的分布式扩展,⽆法直接进⾏ 全球节点的扩展 • 复杂的容灾⽅案 2)对接标准协议+公共函数 场景:多⼚商协议快速兼容 geo-distributed + 函数式开发 = 边缘计算 整体架构 • Webassembly,简称wasm • ⽤⼀句话描述,那就是Webassembly是执⾏程序的标准化字节码格式 • Webassembly最初被发明,是⽤于Web浏览器。 • 由W3C⼯作组开发的Web浏览器标准,于2017年11⽉, Chrome,Firefox Safari四⼤浏览器都开始实验性的⽀持 • 它在浏览器以外也有很⼴泛的运⽤,特别是在边缘计算领域。 • ⽀持多语⾔开发,⽐如Go,Python, rust,Javascript等 什么是Webassembly? 1. 所需求运⾏资源⼩(~64Kb for code and ~10Kb RAM) 2. 异构设备兼容性强(x86, ARM, RISC-V, MIPS, Raspberry Pi, Orange0 码力 | 31 页 | 3.95 MB | 1 年前3The Zig Programming Language 0.5.0 Documentation
String Literals Import from C Header File C Pointers Exporting a C Library Mixing Object Files WebAssembly Freestanding WASI Targets Style Guide Whitespace Names Examples Source Encoding Keyword Reference main allocator. �. Are you building for WebAssembly? In this case, std.heap.wasm_allocator is likely the right choice for your main allocator as it uses WebAssembly's memory instructions. �. Is the maximum Targets Zig Build System WebAssembly Zig supports building for WebAssembly out of the box. There is also a specialized std.heap.wasm_allocator memory allocator for WebAssembly environments. Freestanding0 码力 | 224 页 | 5.80 MB | 1 年前3应用 waPC (rust) 做软件测试工具
poon 潘泳权 大家好! @rustropy_gaming ruito_89 PhoTto / image / chart Webassembly Procedures Call waPC 协议标准化了本机代码调用 WebAssembly 和 WebAssembly 调用本机代码的通信 (messaging) 和 错误处理 (error handling) 。 什么是 waPC? WASM0 码力 | 30 页 | 2.50 MB | 1 年前3Python 标准库参考指南 3.11.10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.1 WebAssembly platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 内置函数 5 3 内置常量 Reference, 发行版本 3.11.10 1.1.1 WebAssembly platforms The WebAssembly platforms wasm32-emscripten (Emscripten) and wasm32-wasi (WASI) provide a subset of POSIX APIs. WebAssembly runtimes and browsers are sandboxed behavior of Python on WebAssembly platforms depend on the Emscripten-SDK or WASI-SDK version, WASM runtimes (browser, NodeJS, wasmtime), and Python build time flags. WebAssembly, Emscripten, and WASI are0 码力 | 2248 页 | 11.10 MB | 9 月前3Python 标准库参考指南 3.11.10
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.1 WebAssembly platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 内置函数 5 glibc 2.27 or newer. 1.1.1 WebAssembly platforms The WebAssembly platforms wasm32-emscripten (Emscripten) and wasm32-wasi (WASI) provide a subset of POSIX APIs. WebAssembly runtimes and browsers are sandboxed behavior of Python on WebAssembly platforms depend on the Emscripten-SDK or WASI-SDK ver- sion, WASM runtimes (browser, NodeJS, wasmtime), and Python build time flags. WebAssembly, Emscripten, and WASI0 码力 | 2399 页 | 11.19 MB | 9 月前3
共 148 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15