Comment by Sammi
8 months ago
Also the web standards themselves are written in an object oriented style. Using a non oo language like rust is therefore an uphill battle where you end up fighing against the language. The web standards just lend themselves naturally to be implemented in an oo language like c++.
?! Rust is roughly equally as OO as C++ is. Which is not surprising given its aim to replace C++.
https://doc.rust-lang.org/book/ch17-00-oop.html
Rust does not make it simple or easy to reference objects from objects. You will be fighting the borrow checker if you try. This is what I mean.
The web standards have lots of references between everything. This type of object oriented programming means having lots and lots of cycles in your object graph. This makes Rust very veeeery unhappy. The Servo people are trying, and they have been trying for a looong time...
I don't understand, isn't this what Arc is for? An "automatically garbage" collected pointer? Or is it not well behaved for this use case (i.e. blowing the stack on free)
1 reply →
True, but the patterns allowed on the web (or in GUIs for that matter) are incredibly painful in Rust.
There was a nice article about the GUI part: https://www.warp.dev/blog/why-is-building-a-ui-in-rust-so-ha...
These points are even more painful with web standards.
I think that pioneering the work of reimplementing web standards in not strictly OOP language will make the implementation easier for anyone else in the future, surely many of the problems exist by virtue of being done for the first time