Ladybird browser is switching from C++ to Swift - eviltoast

Andreas Kling aka @awesomekling wrote:

We’ve been evaluating a number of C++ successor languages for @ladybirdbrowser , and the one best suited to our needs appears to be @SwiftLang 🪶

Over the last few months, I’ve asked a bunch of folks to pick some little part of our project and try rewriting it in the different languages we were evaluating. The feedback was very clear: everyone preferred Swift!

Why do we like Swift?

First off, Swift has both memory & data race safety (as of v6). It’s also a modern language with solid ergonomics.

Something that matters to us a lot is OO. Web specs & browser internals tend to be highly object-oriented, and life is easier when you can model specs closely in your code. Swift has first-class OO support, in many ways even nicer than C++.

The Swift team is also investing heavily in C++ interop, which means there’s a real path to incremental adoption, not just gigantic rewrites.

Strong ties to Apple?

Swift has historically been strongly tied to Apple and their platforms, but in the last year, there’s been a push for “swiftlang” to become more independent. (It’s now in a separate GitHub org, no longer in “apple”, for example).

Support for non-Apple platforms is also improving, as is the support for other, LSP-based development environments.

What happens next?

We aren’t able to start using it just yet, as the current release of Swift ships with a version of Clang that’s too old to grok our existing C++ codebase. But when Swift 6 comes out of beta this fall, we will begin using it!

No language is perfect, and there are a lot of things here that we don’t know yet. I’m not aware of anyone doing browser engine stuff in Swift before, so we’ll probably end up with feedback for the Swift team as well.

I’m super excited about this! We must steer Ladybird towards memory safety, and the first step is selecting a successor language that we can begin adopting very soon. 🤓🐞

  • livingcoder@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    3 months ago

    This comment would make sense if he hadn’t stated that the PR was politically biased but had instead said that it was unnecessary or that it would be inconsistent with the vast majority of the documentation. I’m just reading what he said. He claimed it was a PR based on politics, not language norms or historical norms. Only certain kinds of conservatives view gender-inclusive language as a political issue.

    I appreciate that you don’t want to see this person as a hateful bigot and I don’t think he is either. Most people I’ve encountered that share the same reaction as him have basically been tainted by conservative influences, like media or parents, but they don’t have any real hate for trans people in their hearts. They’ve associated the idea of gender-inclusivity as being political and moved on with their lives, accepting the framing and narratives around the topic.