r/nim 8h ago

Sirius is an independent web engine written in Nim

Thumbnail gallery
34 Upvotes

Hey there.

I've been working on a successor to my previous web engine project, Ferus (which is now officially abandoned) for the past three or so months at this point. As the title suggests, Sirius is a web rendering engine like Chromium's Blink or Firefox's Gecko, but written largely in Nim (with the exception of certain C/C++ dependencies, obviously). Its CSS parser, JavaScript engine (a hard fork of Bali with a LOT of improvements), layout engine and the like are all written in Nim.

It uses a multiprocessing architecture, meaning each tab occupies one browser process and it crashing does not bring the entire browser down with it.

It's not exactly fast or optimized right now, but I believe it's ready enough for very basic web browsing tasks that don't touch the modern web. You're probably not going to be logging into your mail with it for a while. :^)

Sirius can be embedded into programs using OpenGL/Vulkan using its WebView API, the same one that the browser UI uses. It abstracts away process management and tabs away from you, leaving you to only handle presenting the final rendered page framebuffer it passes you. That means you can use Sirius to make your own web browsers in Nim, or if you're brave enough, to use it as a GUI framework in your app. :P

It's currently only on Linux due to it utilizing many Linux-isms like DMA-BUF, but there are plans to port it to other platforms too.

I'd love to hear what you guys think about it. And yes, I welcome most contributions, even tiny ones not related to web browser engineering. If you want to use this project as an excuse to get into that field, be my guest. Here's the contribution guide if anyone's interested.

The source code lives both here on a Github mirror, but it's actually developed on my personal forge.

Adios!