05-MoonBit 编程语言(WASM 技术)服务端应用展望以及对Kubernetes生态的影响Web 前端应用实际接受 • 有后端应用潜力,但更多具体疑问仍待解答 • 问题集中在扩展特性(features)、外部语言接口(FFI)、 操作系统界面(system interfaces 或 WASI)上 WASM 后端应用先驱 wasmCloud (CNCF-Sandbox) fermyon/spin WasmEdge (CNCF-Sandbox) • 多数特性已标准化 • 一些特性对后端应用 交换缓冲区和高级数据结构的方法各有不一 WASM 外部语言接口(FFI) • WASI (WebAssembly System Interface) • 用于允许 WASM 代码调用操作系统的能力 (stdout、socket这些) • 目前处在 0.2 预览版 • 功能缺口和争议都很大 WASM 系统接口(WASI) WASM 应用于后端的构想初步存在 但具体的挑战非常巨大 Kubernetes • 平衡代码尺寸和性能 • 按照 WASM 基础规范设计的 FFI 外部语言接口(支持对外 调用和外部回调) • 直接对接 WASM 扩展(例:wasm-gc target) • 直接对接 WASI 系统接口标准 MoonBit 作为 WASM 原生语言的作用 新语言对 WASM 后端技术栈的意义 • 封装,或者说“过顶”开发思路(OTT,over the top) • 有限使用 WASM0 码力 | 30 页 | 3.41 MB | 10 月前3
The Zig Programming Language 0.11.0 Documentationresult is 3 47.2. WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and reading command line arguments: wasi_args.zig 1 const {s}\n", .{ i, arg }); 11 } 12 } Shell $ zig build-exe wasi_args.zig -target wasm32-wasi Shell $ wasmtime wasi_args.wasm 123 hello 0: wasi_args.wasm 1: 123 2: hello A more interesting example would list of preopens from the runtime. This is now supported in the standard library via std.fs.wasi.PreopenList : wasi_preopens.zig 1 const std = @import("std"); 2 const fs = std.fs; 3 4 pub fn main() !void0 码力 | 238 页 | 7.80 MB | 1 年前3
The Zig Programming Language 0.12.0 DocumentationThe result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and reading command line arguments: wasi_args.zig const print("{}: {s}\n", .{ i, arg }); } } Shell $ zig build-exe wasi_args.zig -target wasm32-wasi Shell $ wasmtime wasi_args.wasm 123 hello 0: wasi_args.wasm 1: 123 2: hello A more interesting example would list of preopens from the runtime. This is now supported in the standard library via std.fs.wasi.Preopens : wasi_preopens.zig const std = @import("std"); const fs = std.fs; pub fn main() !void { var0 码力 | 241 页 | 7.37 MB | 1 年前3
The Zig Programming Language 0.5.0 Documentationfrom 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 Keyword: pub elfiamcu, tvos, watchos, mesa3d, contiki, amdpal, hermit, hurd, wasi, emscripten, zen, uefi, }; pub const Arch = union(enum) { arm: Arm32, armeb: The result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and reading command line arguments: wasi.zig const std =0 码力 | 224 页 | 5.80 MB | 1 年前3
The Zig Programming Language 0.8.1 Documentationinstance.exports.add; add(1, 2); }); $ node test.js The result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and std.debug.print("{}: {s}\n", .{ i, arg }); } } $ zig build-exe args.zig -target wasm32-wasi $ wasmtime args.wasm 123 hello 0: args.wasm 1: 123 2: hello A more interesting example would be This is now supported in the standard library via std.fs.wasi.PreopenList: preopens.zig const std = @import("std"); const PreopenList = std.fs.wasi.PreopenList; pub fn main() !void { var general_purpose_allocator0 码力 | 234 页 | 6.01 MB | 1 年前3
The Zig Programming Language 0.6.0 DocumentationThe result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and reading command line arguments: wasi.zig const std = std.debug.warn("{}: {}\n", .{i, arg}); } } $ zig build-exe wasi.zig -target wasm32-wasi $ wasmer run wasi.wasm 123 hello 0: wasi.wasm 1: 123 2: hello Targets Zig supports generating code for all0 码力 | 214 页 | 5.37 MB | 1 年前3
The Zig Programming Language 0.9.1 Documentationadd; 10 add(1, 2); 11 }); Shell 1 $ node test.js 2 The result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and print("{}: {s}\n", .{ i, arg }); 11 } 12 } Shell 1 $ zig build-exe args.zig -target wasm32-wasi Shell 1 $ wasmtime args.wasm 123 hello 2 0: args.wasm 3 1: 123 4 2: hello A more interesting is now supported in the standard library via std.fs.wasi.PreopenList : preopens.zig 1 const std = @import("std"); 2 const PreopenList = std.fs.wasi.PreopenList; 3 4 pub fn main() !void { 5 var0 码力 | 234 页 | 7.90 MB | 1 年前3
The Zig Programming Language 0.10.1 Documentationadd; 10 add(1, 2); 11 }); Shell 1 $ node test.js 2 The result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and print("{}: {s}\n", .{ i, arg }); 11 } 12 } Shell 1 $ zig build-exe args.zig -target wasm32-wasi Shell 1 $ wasmtime args.wasm 123 hello 2 0: args.wasm 3 1: 123 4 2: hello A more interesting is now supported in the standard library via std.fs.wasi.PreopenList : preopens.zig 1 const std = @import("std"); 2 const PreopenList = std.fs.wasi.PreopenList; 3 4 pub fn main() !void { 5 var0 码力 | 239 页 | 8.03 MB | 1 年前3
The Zig Programming Language 0.7.1 Documentationinstance.exports.add; add(1, 2); }); $ node test.js The result is 3 WASI Zig's support for WebAssembly System Interface (WASI) is under active development. Example of using the standard library and std.debug.print("{}: {}\n", .{ i, arg }); } } $ zig build-exe args.zig -target wasm32-wasi $ wasmtime args.wasm 123 hello 0: args.wasm 1: 123 2: hello A more interesting example would be This is now supported in the standard library via std.fs.wasi.PreopenList: preopens.zig const std = @import("std"); const PreopenList = std.fs.wasi.PreopenList; pub fn main() !void { var general_purpose_allocator0 码力 | 225 页 | 5.74 MB | 1 年前3
The Zig Programming Language 0.4.0 Documentationelfiamcu, tvos, watchos, mesa3d, contiki, amdpal, hermit, hurd, wasi, zen, uefi, }; pub const Arch = union(enum) { arm: Arm32, armeb: Arm32, aarch64:0 码力 | 207 页 | 5.29 MB | 1 年前3
共 10 条
- 1













