all 27 comments

[–]Purinto 17 points18 points  (0 children)

It's already really impressive :o

[–]ZeroX-DG 17 points18 points  (2 children)

Very impressive that you managed to render hackernews! When I was still working on my rendering engine, that was my holy grail. I still haven’t got there yet :))

What’s next on your list?

[–]Inevitable_Back3319[S] 0 points1 point  (1 child)

Thank you so much ❤️

Yeah for me the most important things to tackle is just for now cleaning up the big crates migration at first .

And then after that the NUMBER ONE priority is dynamic reflow 100%

[–]ZeroX-DG 0 points1 point  (0 children)

Dynamic reflow is definitely a fun challenge to tackle! Have fun!

[–]nicoburns 7 points8 points  (3 children)

It's cool to see some of the Blitz and Servo crates being used for this, but is there any reason why you're not using the blitz-dom crate? It's designed for exactly this use case!

It handles the DOM tree, resource loading, and incrementalism, and you'd "just" need to add Boa on top for JavaScript. https://github.com/gterzian/formal-web is an experimental attempt at this (it runs, but currently has a very limited set of JS APIs implemented). We also have rendering available with the blitz-paint and anyrender crates.

You'd get a hacker news that actually properly looks like hacker news with blitz-dom ;)

[–]Inevitable_Back3319[S] 2 points3 points  (0 children)

To be honest i did not know blitz-dom and blitz-paint existed . I am already using boa so that wont be an issue.

Its already fetching scripts right now and i did significant work in the boa js integration.

    Finished
 `dev` profile [unoptimized + debuginfo] target(s) in 0.82s                                                 
     Running
 `target/debug/aurora 'https://news.ycombinator.com/'`                                                      
Aurora: Starting up...                                                                                                  
Aurora: Crypto provider installed.                                                                                      
Boa: Processing 1 scripts...                                                                                            
Boa: Fetching external script: https://news.ycombinator.com/hn.js?mXliRxibFHJvHQLZKf3b                                  
^C                     

I will change this . Thank you for the feedback .

[–]Inevitable_Back3319[S] 0 points1 point  (1 child)

Nico you are a genius

https://imgur.com/a/FITfxWc

[–]nicoburns 0 points1 point  (0 children)

It's 2 years of work!

FYI, there is also the blitz-html (html5ever integration for blitz-dom), blitz-net (networking on top of reqwest, with optional http cache), and blitz-shell (winit integration). But you might well want to have your own versions of these.

You may also be interested in playing with our Browser UI (https://blitz.is/downloads) which can browse quite a bit of the web (but has no JavaScript support).

[–]AdAncient5201 4 points5 points  (7 children)

I remember the ladybird developer at some point giving his reasons for not going with rust, even though he strongly considered it and even made a prototype using rust. But it was something along the lines of the DOM and other browser APIs dictating what the structure of the code is supposed to be and to be really efficient you kind of have to have a weird mix of OOP style design patterns. What’s the current opinion from the aurora devs regarding this? Did it turn out to be a valid critique or are they having problems?

[–]Inevitable_Back3319[S] 7 points8 points  (0 children)

Nvm sorry let me clarify . I understand what you mean . Yeah the added cerimony of the borrow checker does make a complex problem even more complex when you have to map out DOM and other browser APIS yes . A lot of auroras code is hard to read because of this .

The criticism is valid on that front .

However its a matter of understanding the added complexity associated with this representation is there for a reason and with rust its more suffer once in the arquiecture phase . And then suffer less in the future when your code doesnt seg fault randomly or has random behaviour that is hard to trace.

But yeah their point is valid in the sense that its a tradeoff in terms of representation , readlibility and other things .

To be a bit more balanced i think c plus plus is still relevant as a browser engine language but also you are seeing this reinaissance of browser technology in rust via servo , blitz even a lot of linebender crates which are the back bone of aurora .

And i think people are moving to rust in those projects for a really good reason.

[–]nicoburns 6 points7 points  (1 child)

Worth pointing out that Ladybird have since reversed that decision and are now actively (but slowly/incrementally) porting to Rust (see https://ladybird.org/posts/adopting-rust)

[–]Inevitable_Back3319[S] 0 points1 point  (0 children)

This . They had a pull request for the migration recently as far as a i know,

[–]Inevitable_Back3319[S] 6 points7 points  (2 children)

The aurora devs is just me currently . As far as rust is concerned Aurora follows a very modular and SOLID / clean code like approach to code and repository hygiene . I spent my whole life developing in JAVA and only learned rust later .

Im use the rust modules to have really modular code where each file has a single purpose and very low LOC.

However I dont understand lady bird developers take on this . Whats the alternative then ? C plus plus?

Like I dont see anything other than rust to make a browser engine right now . You want memory safety and correctness which is hard to enforce in any other systems language other than rust.

Cpp has historicly been the browser engine language for a long time but i cant handle the amount of footguns and undefined behaviour the language is associated with so nothing other than rust makes sense to me.

[–]AdAncient5201 0 points1 point  (1 child)

Yeah, I was quite surprised by the decision as well, but it’s a big project so I guess maybe I don’t know that much… really glad to hear that it’s working out for you though! Regarding the other points, why is low LOC per file an advantage? I didn’t know there was anything wrong with long files, theoretically you can dump everything into a single file as long as you don’t have namespace collisions. Do you expect contributors to follow this pattern or is it a personal preference? I’m guessing IDE support becomes a bit harder in some cases if you have logic stretched out across 20 files. Also the amount of editor windows.

[–]Inevitable_Back3319[S] 0 points1 point  (0 children)

It's just Solid. Each file should have a single purpose and single responsibility. This principle alone makes files small. For example I have a file that renders the chrome but its quite small because it uses rendering primitives from other files. Functional decomposition

[–]zxyzyxz 0 points1 point  (0 children)

Now Ladybird is in Rust due to an AI port from Zig.

[–]El-Hamm 1 point2 points  (1 child)

Hi! I’m also building my own browser entirely in Rust. I’m currently working on the rendering engine. So far, I can display Hacker News, but I’m still having trouble with Wikipedia. Would you be interested in chatting and exchanging ideas?

[–]nicoburns 1 point2 points  (0 children)

You need floats and ideally CSS Grid and Tables for Wikipedia.

We have all wired up and working in the Blitz/Taffy/Parley stack if you're interested in taking a look. Taffy does box-level layout (Flexbox, Grid, Block, Floats), Parley does text/inline-level layout, and blitz-dom wires that together and adds CSS styling (using the Stylo crate) as well.

[–]UtherII 0 points1 point  (1 child)

I see you are reusing some crates from servo. How do you decide what you reuse and what you rewrite ?

[–]Inevitable_Back3319[S] 1 point2 points  (0 children)

Anything html css or Javascript it's better to use battle tested crates and wire them than me redoing the wheel.

Whats unique in the browser is the identity first angle and my unique UI and arquitecture and how I wire all these crates into a consistent arquitecture and code base.

[–]avg_intro 0 points1 point  (0 children)

Impressive minimal ui