Weblings 是一个编译为 WebAssembly 的 Rust 编译器工具链,可在浏览器内完全编译并执行 Rust 代码,并提供了包含 Playground 和 Rustlings 练习的网页界面。

Stars

84

7 天增长

暂无数据

Fork 数

2

开放 Issue

0

开源协议

MIT

最近更新

2026-07-25

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它使用 Cranelift 而非 LLVM 作为后端,实现了从 Cranelift IR 到 Waffle IR 再到 Wasm 的新型转换,并配备了自定义 Wasm 链接器,所有组件都基于编译为 WASM 的 rustc。

适合谁使用

  • 希望获得即时反馈的 Rust 学习者
  • 对浏览器内编译感兴趣的 Web 开发者
  • 教授计算机内存或 Rust 概念的教育工作者
  • 探索 Rust 替代后端的技术爱好者

典型使用场景

  • 在浏览器中交互式运行 Rust 代码片段(无需服务器)
  • 在浏览器中完成 Rustlings 练习套件
  • 展示 Rust 代码执行时的内存可视化
  • 实验基于 Cranelift 的 Rust 编译在 WebAssembly 中的效果

项目优势

  • 完全在客户端执行,无需依赖服务器
  • 新颖的 Cranelift → Waffle → Wasm 流水线提供独特方案
  • 基于已编译为 WASM 的成熟 rustc,确保兼容性
  • 提供包含 Playground 和 Rustlings 的实用网页界面

使用前须知

  • 仍处于实验阶段,可能存在稳定性或性能问题
  • AI 生成的组件(链接器、CLIF‑to‑Waffle)需要上游维护
  • 仅支持 Cranelift 后端,无法使用基于 LLVM 的编译

README 快速开始

Weblings

Weblings is a Rust compiler toolchain compiled to WASM. This means that you can compile and execute Rust code in your browser!

Tech stack tl;dr rust code -> rustc -> cranelift IR -> waffle -> wasm object files -> linker -> wasm executable -> browser execution

The web UI

The primary way to interface with this WASM toolchain is through the web UI, which you can access at https://weblings.forest-anderson.ca. It has two sections:

The stack

A few things had to be set up to get this toolchain working:

⭐ - these steps were written with AI tooling to achieve the goals of this project, but I'd love to see them included in Cranelift/Wild, and hope to find a way to upstream them!

Why?

I've set up this toolchain so that I can build out some tooling that I'll be using in upcoming projects to teach computer memory principles. I'v

项目描述

Compiling Rust to WASM from inside WASM!

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

l0ng-ai
精选
l0ng-ai GitHub avatar

tty7

tty7 is a fast, GPU-accelerated terminal workbench with persistent sessions, built-in input tools, SSH support, and coding agent awareness.

开发者工具CLI 与终端
359
m-novotny
精选
m-novotny GitHub avatar

memguard-rs

A Rust library that provides secure memory handling primitives including zeroization on drop, memory locking, constant-time comparison, and compile-time guarded regions, with zero dependencies and no_std support.

嵌入式与物联网安全
131
inbjo
inbjo GitHub avatar

MirrorProxy

MirrorProxy is a self-hosted, Rust-based mirror proxy platform with an embedded React admin console and cross-platform client for managing package sources.

Rust
204