Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


Arc is an atomic (not automatic) reference counter which can be used across threads. Reference counting in general can still be tricky to use when you need cyclical references though, which is what it sounds like the spec has.


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




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: