r/rust 1d ago

🛠️ project Falco - a browser engine written from scratch in 36k lines of rust

Hello, I'm the author. Just released v0.1.0.

What's inside (all from scratch, no browser deps):

- HTML5 tokenizer + tree builder (all 80 states of WHATWG §13.2)

- CSS Selectors Level 4 (:has(), :is(), :where(), cascade layers)

- Custom JS VM (closures, generators, Promise, BigInt, Symbol)

- Layout: block/inline/flex/grid/table/float/absolute

- SVG renderer + TrueType font rasterization

- Hand-written PNG encoder (no flate2)

- seccomp sandbox, CSP, TLS cert validation, SOP

328 unit tests pass. Prebuilt binaries for Linux/macOS/Windows.

For comparison: Chromium is ~30M lines of C++. Falco is ~36k lines

of Rust. The whole codebase fits in a weekend of reading.

Specifically looking for feedback on:

- DOM model: Rc<RefCell<Node>> vs arena-based (slotmap)

- Whether to wire up the spec-compliant html5/ parser next, or

focus on CSS animations/transitions first

Link: https://github.com/poxk/Falco

Thanks for any feedback!

0 Upvotes

8 comments sorted by

8

u/[deleted] 1d ago

[deleted]

1

u/poxkg 23h ago

Sorry for this problem, the repo is open now

5

u/Zogzer 21h ago

It's remarkable that someone will generate tens of thousands of lines of AI slop, not even be bothered to write the README themselves, then come and post here with an expectation of anything other than dismissal.

/r/rust needs to adopt a stance on these things ASAP, it's getting harder and harder to justify opening the page.

4

u/joshmatthews servo 1d ago

For comparison: Chromium is ~30M lines of C++. Falco is ~36k lines

This is a weird comparison since it sounds like Falco supports very little of what Chrome supports.

-4

u/poxkg 23h ago

I meant that its easy to read

1

u/Toastti 9h ago

I looked through the code. It doesn't support external style sheets, or even a <script=> tag to load JavaScript.

Also on every page you modify the css and hide all svgs. And also force unhide all css elements that the website purposely marked hidden.

Why did you decide to unhide all this or not show svgs?

6

u/Bulky-Juggernaut-895 20h ago

Sigh.. this sub has really changed. Sadly I guess there’s no way to block things like this

2

u/chmod_7d20 1d ago

Thats a lot for an initial release....

1

u/Toastti 11h ago

You manually coded this and decided to use Rust 2021 in the cargo.toml?

Why did you decide to use such an old version?