/Stormlicht

The Stormlicht browser engine.

Primary LanguageRustMIT LicenseMIT

rustfmt

The outline of a hurricane lamp.

1. Stormlicht

Stormlicht is an experimental browser engine written from scratch.
If you want to follow the development, you can visit #stormlicht:matrix.org

1.1. Design goals

I strive for Correctness, Performance and Safety, in that order.

This is also a "for fun" project, so I do try and implement as much of the functionality as possible without relying on third party crates. The engine implements its own font rendering, http stack and image parsing, among other things.

Despite being a "hobby project", Stormlicht is making good progress and has already helped fix bugs in web specifications and implemented WPT tests.

Rendering the Acid1 test Reference Rendering (Mozilla Firefox 122.0)
image image

1.2. Build Instructions

Stormlicht uses the latest nightly compiler version. First, install the rust compiler1 , then switch to nightly using

rustup default nightly

After installing rust, run the following commands to start the python build script

pip install -r requirements.txt

./stormlicht.py run

1.3. Development

1.3.1 Logging

During debugging, you can use the RUST_LOG environment variable to set the log level. Refer to the documentation of env-logger for more complex log syntax.

For example:

# Log "debug" and above
RUST_LOG=debug ./stormlicht.py run

Available levels are trace, debug, info, warn and error, in ascending order.

The default log level is info

1.3.2 Backtraces

Set RUST_BACKTRACE=1 to enable backtraces in case of a panic.

1.3.3 Running with Miri

Testing the browser inside Miri can help detect instances of undefined behaviour. To use miri, execute the following:

rustup toolchain install nightly --component miri
rustup override set nightly

./stormlicht.py run --miri
./stormlicht.py test --miri

1.4. Credits

This project is inspired by Andreas Kling/the Ladybird Browser

Mozilla's Servo and WebKit provided some good ideas.

Footnotes

  1. https://www.rust-lang.org/tools/install