Show HN: Aurora – 一个用 Rust 编写的浏览器引擎实验
1 分•作者: JohannaAlmeida•4 个月前
我一直在用 Rust 构建 Aurora,一个处于早期阶段的浏览器引擎。
它目前实现了一个最小化的端到端流程:解析一个狭窄的 HTML 子集,构建 DOM 树,从 style 标签中解析 CSS,计算基本样式,推导出简单的块布局树,并将结果绘制到一个小的文本帧缓冲区中。它还包括基本的 HTTP/HTTPS 获取功能,并支持重定向。
JavaScript 执行通过 Boa JavaScript 引擎集成。这还处于早期阶段,但简单的脚本可以运行。
渲染是从头开始在 GPU 上完成的,使用 wgpu 和 Vello,不依赖于 Skia。渲染器使用单个图集和一个简单的流程来进行批处理和光栅化。
目标不是构建一个完整的浏览器,而是以一种小而明确的方式理解和实现流程的核心部分。
下一步是改进分词,扩展 CSS 支持,使布局不再那么原始,并继续 GPU 渲染路径的工作。
当前渲染快照:<a href="https://imgur.com/a/NtbgR5i" rel="nofollow">https://imgur.com/a/NtbgR5i</a>
查看原文
I’ve been building Aurora, an early-stage browser engine in Rust.<p>It currently implements a minimal end-to-end pipeline: parsing a narrow HTML subset, building a DOM tree, parsing CSS from style tags, computing basic styles, deriving a simple block layout tree, and painting the result into a small text framebuffer. It also includes basic HTTP/HTTPS fetching with redirect support.<p>JavaScript execution is integrated using the Boa JavaScript engine. This is still early, but simple scripts do run.<p>Rendering is done on the GPU from scratch using wgpu and Vello, without relying on Skia. The renderer uses a single atlas and a simple pipeline for batching and rasterization.<p>The goal is not to build a full browser, but to understand and implement the core pieces of the pipeline in a small and explicit way.<p>Next steps are improving tokenization, expanding CSS support, making layout less primitive, and continuing work on the GPU rendering path.<p>Current render snapshot : <a href="https://imgur.com/a/NtbgR5i" rel="nofollow">https://imgur.com/a/NtbgR5i</a>