WebAssembly Integration

WebAssembly Integration#

MoonBit 是一种提供对 WebAssembly 进行一流支持的编程语言。

组件模型#

查看 本教程 了解如何在 MoonBit 中使用 组件模型

自定义导出和导入#

查看 FFI 部分,了解如何导入或导出函数。

问答#

  1. 问:什么是 spectest.print_char

    A: 这是 MoonBit 打印的方式。它一次打印一个 UTF-16 Unicode 代码。为了可移植性,避免使用 println。如果这确实出现在最终结果中,请考虑使用 wasm-merge 或类似工具。