3 ms·
It's always struct me as interesting that ladybird is built with C++. I like C++, and prefer it to languages like Rust, but it's not uncommon to see new OSS pro
by guywithahat 1y ago
It's always struct me as interesting that ladybird is built with C++. I like C++, and prefer it to languages like Rust, but it's not uncommon to see new OSS projects using weird languages and the newest tools. Lots of languages offer improvements in regards to threading models, development speed, or cross-platform support which we don't get in C++.
I suppose their success is likely directly related to the fact they made reasonable, practical development choices, but still.
- zrm 1y agoIt's the same language most of the code in Chrome and Firefox is written in. It's also not clear what you're looking for in terms of cross-platform support. Some languages provide better standard library support for UI elements, but that's the part a browser will be implementing for itself regardless.
- timeon 1y agoSure but those browsers started long time ago and are implementing some of newer stack in Rust.
- miloignis 1y agoI believe they are or will be transitioning to Swift: https://x.com/awesomekling/status/1822236888188498031 https://x.com/awesomekling/status/1822236888188498031
- hamandcheese 1y agoThis is often cited, but it seems like there has been very little movement toward swift since this tweet.
- tredre3 1y agoThey were/are waiting for better cross-platform support. When they decided on Swift, using it on Linux had just recently become workable but it still didn't have feature-parity with apple land. To me that all sounds like wishful thinking on their part. But I have a lot of faith in Andreas and the team, so I'm willing to take their opinion over my knee-jerk reaction shrugs.
- drnick1 1y agoI don't think this will ever happen. They may starting using Swift or some other newfangled language like Rust for some components, but it's almost never a good idea to rewrite something in a different language, and C++ is still the gold standard for this type of project.
- BirAdam 1y agoLadyBird grew out of the SerenityOS project which was originally written in C++ (they've since moved to Jakt). All software for Serenity had to be written natively for the OS, and C++ was the language originally supported there. Andreas had worked on browsers previously (notable Safari), and was already a seasoned C/C++/ObjC developer. While one can cite many valid reasons for using a C language for a browser (and OS), I think his experience and preferences were likely a large part of it.
- zelphirkalt 1y agoThe language is actually something that makes me look elsewhere. We already have enough sufficiently vulnerable browsers and other network related software. Choosing C/C++ as language may work to make something that works, and it may be in the realm of experience the people building it have. However, it does not make this browser stand out in terms of security/safety. While they may deliver tremendous work, that work is still "just" another Cee thingy. Experience tells us, that even elite C/C++ hackers will make mistakes regarding memory management. Mozilla slowly using more and more Rust in Firefox seems better from that perspective, if they are actually still trying to do so.
- LeFantome 1y agoAs stated elsewhere, the Ladybird team expects to move to Swift. There are still a couple blockers keeping them from doing so. They have actively rejected Rust as they see it as unsuitable for a heavily OOP code base. They see OOP as a great fit for implementing the web spec.
- zelphirkalt 1y agoI am far from a Rust expert. Only have tried it some time ago. I think Rust does a good job with forcing composition over inheritance, steering towards the approaches, that have been found to be superior to deep inheritance hierarchies, by its concepts of structs and traits implemented for structs, and not having classes. Of course, if one equates OOP with classes and inheritance, then Rust will not meet that definition of OOP.