← Back to context

Comment by tasty_freeze

2 years ago

I know Andreas is a prolific coder, but this seems weird to have a pretty functional (but far from complete) browser written in C++ and then casually say, eh, "We are going to rewrite it in another language" in the same way one might say "We've decided to change the branding logo"?

I know that is a run-on sentence, but I need to get my exercise.

Actually, moving to a memory-safe language should be a very high priority for developing a browser and the sooner they do that the better.

  • Swift/C++/Zig all have the exact same level of memory safety, but anyone they said they aren't porting, sounds more like writing new stuff in Swift and hoping the interop story is good enough.

Depends on the approach. There's an odd benefit to C++ being the starting language; C++ is ancient and because of that you can make it interop with most other languages; in this case, the switch to Swift will probably simply mean replacing C++ modules (likely starting with the ones that cause the most memory bugs) with Swift modules and gradually switching things out since Swift has C++ interop[0].

It's less a "rewrite from the ground up" and more a "this is the main language we'll be using from now on".

As for the reason to stop using C++; honestly what reason isn't there by now. The only reason to still use C++ in this day and age is if you're targeting very non-standard hardware or are developing videogames. The language is memory unsafe in a way that almost every other language isn't (like, even if you don't pick a language with an overly worrywart borrow checker, C++ is remarkably worse at memory management), the standard library is awful and it's stuck with the chain and ball of being a superset of C on it's leg, meaning that every reason why you wouldn't use C also applies to C++ (minus the "C isn't OOP" one).

[0]: https://www.swift.org/documentation/cxx-interop/

I don't think this is a complete rewrite, though. Swift is specifically being picked for C++ interop so they can use their existing code. Andreas has stated from the start that any new language chosen has to consider an incremental approach of adoption into their codebase.

It is just like when a video game team decide to switch or rewrite the game-engine mid-course. A huge red flag. Almost always kills the project or make it so late that it becomes irrelevant.

C++ is not a perfect language, but it works, and they have experts on the team, what they are trying to achieve is difficult enough.

Well, RIP Ladybird, I was hopeful about this project, this seriously makes me sad.