5 ms·
I know they didn't do this on purpose and it was because it started as part of SerenityOS, but I'm unexcited by this project because it's written in C/C++. Rus
by smt88 2y ago
I know they didn't do this on purpose and it was because it started as part of SerenityOS, but I'm unexcited by this project because it's written in C/C++.
Rust was literally invented to solve the security and concurrency issues inherent in using C/C++ for a browser engine. You could argue that's the one use-case where it is objectively the best language to use. It's so valuable for that purpose that every large company has rewritten at least some crucial components in Rust.
I also think Rust will be one of the only languages strict enough to enable the use of AI-generated code without compromising security. I certainly don't want AI-generated code for high-security applications, but there's nothing we can do to stop it at this point.
- atombender 2y agoI believe the team has said they are currently evaluating different languages, though they have not divulged which ones. From the FAQ on the Ladybird website: "We are actively evaluating a number of alternatives and will be adding a mature successor language to the project in the near future. This process is already quite far along, and prototypes exist in multiple languages." I assume it's either Rust or Jakt (the latter a language in development by the Ladybird lead dev), though I suppose Swift might be on the table.
- smt88 2y agoCreating a new language is almost as insane as building a browser engine. I do not expect this to become a viable browser regardless, but I guarantee it'll fail if they use their own new language for it.
- andtexasando 2y agoRust is great in theory. But idioms are still being teased out and it hasn’t been used on anything with more code than servo afaik. C/C++ is arguably the safer choice in terms of actually completing and maintaining a project of this magnitude.
- steveklabnik 2y ago> it hasn’t been used on anything with more code than servo afaik. It very much has.
- hju22_-3 2y agoName them, then. I do like Rust, but I've only come across a few "higher profile ish" projects. None were really that important or useful that I actually bothered to remember them.
- steveklabnik 2y agoCompanies like Amazon, Facebook, and Cloudflare have millions of lines of Rust code running in production.
- gary_0 2y agoDon't forget Microsoft. Windows 11 kernel will soon be booting with Rust inside (https://news.ycombinator.com/item?id=35738829 https://news.ycombinator.com/item?id=35738829) Microsoft seeks Rust developers to rewrite core C# code (https://news.ycombinator.com/item?id=39240205 https://news.ycombinator.com/item?id=39240205)
- steveklabnik 2y agoI only left them off because we’re talking about size here, and I don’t know how much code that actually is. I am a Windows user, so I’m quite excited to have Rust in my kernel! But as far as I know it’s just one small bit, with more to come!
- lolinder 2y agoYou're replying to Steve Klabnik, co-author of the Rust book [0] and (previously) a core team member for years. If he says it's been used on big projects I'd be inclined to believe him. Note that it's likely that some of the biggest applications aren't public and so even if identified you couldn't actually count the lines yourself. [0] https://doc.rust-lang.org/stable/book/ https://doc.rust-lang.org/stable/book/
- deleted 2y ago[deleted]
- wakawaka28 2y agoC++ is an awesome language for this. Even Firefox isn't all Rust. Do you think it's wise to use tech controlled by your main competitor?
- smt88 2y ago> Do you think it's wise to use tech controlled by your main competitor? Mozilla doesn't control Rust, and why would it matter? What is your disaster scenario here? What would Mozilla do to sabotage Ladybird? At this point, Ladybird has no competitors because it is not much more than a hobby project. It isn't usable yet.
- wakawaka28 2y agoFriends of Mozilla certainly control Rust, and it is not outside the realm of possibility for Rust to switch to an awful license. It may be a bit much to suppose that Rust devs would sabotage Ladybird but certainly there is a potential conflict of interest that should be looked at. >At this point, Ladybird has no competitors because it is not much more than a hobby project. It isn't usable yet. Whether or not it is usable is a temporary technical issue. It absolutely is a contender for mindshare. Lots of people want a browser that isn't controlled by a nefarious advertising megacorp, and Firefox is about the only game in town. That is hopefully going to change.
- deleted 2y ago[deleted]
- smt88 2y ago> Friends of Mozilla certainly control Rust Like who? Anyway, it would be a good thing anyway because "friends of Mozilla" are likely some of the most dedicated FOSS people working in software. > it is not outside the realm of possibility for Rust to switch to an awful license It is absolutely outside the realm of possibility. It is as impossible as Python or any other major language doing it. Millions of lines of Rust are in production at for-profit and non-profit orgs, as well as in FOSS projects. Even if they did it, Rust would be immediately forked and continue as it was before under a different name. > Whether or not it is usable is a temporary technical issue. I disagree. It is a long-term technical issue, because every viable browser engine so far has had many millions of person-hours put into it. Ladybird isn't close and likely never will be.
- FreakLegion 2y ago> Rust was literally invented to solve the security and concurrency issues inherent in using C/C++ for a browser engine. Are most browser vulnerabilities not still found in engines like V8? Rust can help with something like last year's buffer overflow in libwebp (although that's overkill when a project like https://github.com/google/wuffs https://github.com/google/wuffs exists), but I'm unclear on how it gets you a better JIT.
- seventyone 2y agoAIUI, Servo has been a failure because Rust is not very good at this problem domain. Browsers have to deal with circular references and this is easily handled in C++. Hopefully someone who knows more will explain this better
- smt88 2y agoRust has memory-safe handling of circular references, but it can also be done with "unsafe" blocks. It's (much) more involved than using C++, but that's a worthwhile tradeoff for something as important as a browser engine. More info: https://eli.thegreenplace.net/2021/rust-data-structures-with-circular-references/ https://eli.thegreenplace.net/2021/rust-data-structures-with...
- 1oooqooq 2y agoif you ever write the words "unsafe" in a rust codebase, and you are not directly needing to poke bits on some hardware, you are doing it very, very wrong. good link you shared. i personally always went with option 2 he presents.
- lolinder 2y agoThis kind of dogmatism is why people think Rust will be impossible to adopt. All `unsafe` means is that the code inside the block doesn't have Rust's guarantees and should be inspected extra carefully by hand, much the same as you'd ideally inspect every single line of C. If sprinkling `unsafe` everywhere allows an organization to quickly adopt Rust's guarantees elsewhere and they're aware of that caveat (hard not to be given the naming) that can only be a net improvement over doing the entire thing in C. You can always go through and systematically remove unnecessary `unsafe` later if needed, but there's no need to do so upfront if that would prevent adoption.
- 1oooqooq 2y agothere's literary two other patterns on the one example in this thread... refactoring those unsafe will never happen in the kind of place that put them in place to begin with.