Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[英雄帖] wasmtime/cranelift 移植 #59

Open
MingcongBai opened this issue Jul 16, 2024 · 4 comments
Open

[英雄帖] wasmtime/cranelift 移植 #59

MingcongBai opened this issue Jul 16, 2024 · 4 comments
Labels
AREA: Arch optimization Architecture-specific enablement or optimization (e.g. addition of LoongArch SIMD codepaths) 英雄帖 Volunteers welcome!

Comments

@MingcongBai
Copy link
Member

近日,代码编辑器 Zed 正式发布了 Linux 支持,该编辑器使用体验良好,但其插件系统依赖的 WASM 运行时 wasmtime 目前无龙架构支持

若为 wasmtime 添加支持,龙架构用户们就可以用上最新最热的 Zed 编辑器了

@xen0n xen0n added 英雄帖 Volunteers welcome! AREA: Arch optimization Architecture-specific enablement or optimization (e.g. addition of LoongArch SIMD codepaths) labels Jul 16, 2024
@Zxilly
Copy link

Zxilly commented Aug 12, 2024

Cranelift 当前不支持 loongarch 后端,实现任务感觉比较艰巨。可能直接关心解释执行的模式会比较切实一些。

@heiher
Copy link
Member

heiher commented Oct 21, 2024

另一个WebAssembly运行时wasmer的compiler-llvm实验性支持LoongArch: wasmerio/wasmer#5152

@darkyzhou
Copy link

darkyzhou commented Dec 12, 2024

最近开始投入 Cranelift 的移植,我来看看有什么坑。建议标题把 Cranelift 也加上,这可能是主要阻碍

@heiher heiher changed the title [英雄帖] wasmtime 移植 [英雄帖] wasmtime/cranelift 移植 Dec 12, 2024
@darkyzhou
Copy link

darkyzhou commented Dec 30, 2024

最近工作比较忙,断断续续看了一下,汇报一下进展:

根据最近的 Making WebAssembly and Wasmtime More Portable,Wasmtime 目前已经存在三种后端:

  • Cranelift: an optimizing compiler backend that is comparable to the optimizing tier in a just-in-time system.
  • Winch: a single-pass, “baseline” compiler that gives you fast, low-latency compilation but generates worse machine code, leading to slower Wasm execution throughput.
  • Pulley: a portable bytecode and fast interpreter.

其中,Pulley 作为一个解释器,并不需要特殊的移植工作,可能会成为 free lunch,不过目前还不完备:bytecodealliance/wasmtime#9783

Winch 的移植难度和复杂度不算很大,相比之下 Cranelift 才是最复杂的。我之前主要在看 Cranelift,觉得以我的水平和时间要推进起来会很漫长。不过,除了后端以外,Wasmtime 的其它部分仍需一些移植工作,这些我基本完成了。

我接下来的打算:

  1. 等待 Pulley 完善到一定程度之后,尝试向上游提 PR,期间移植并验证 Zed 的可用性
  2. 移植 Winch 后端,积累经验
  3. 移植 Cranelift 后端

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: Arch optimization Architecture-specific enablement or optimization (e.g. addition of LoongArch SIMD codepaths) 英雄帖 Volunteers welcome!
Projects
None yet
Development

No branches or pull requests

5 participants