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. 🤓🐞

  • masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    115
    arrow-down
    14
    ·
    1 month ago

    Really feels like a mistake. No major language exists without a major benefactor supporting it, and Swift’s only benefactor has zero interest in cross platform anything.

    Good luck 5 years from now when cross platform Swift has gone the way of cross platform Safari.

    • Tekhne@sh.itjust.works
      link
      fedilink
      arrow-up
      37
      arrow-down
      6
      ·
      1 month ago

      Actually, this isn’t true. Apple has a vested interest in cross platform Swift. They’ve been pushing hard for Swift on Linux because they want Swift to run on servers, and they’re right to. Look at how hard JavaScript dominates on the server-side because of one language everywhere.

          • mke@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            1 month ago

            That’s actually interesting, I learned something new today.

            cross-platform CLI and server

            Will Ladybird compete against lynx? …No? I tried. Jokes aside, I don’t see why that’d matter much for end-users.

            It looks to me like Apple wants Swift on Linux, but that might simply be because they understand you can’t run away from Linux when dealing with servers. That’s not necessarily the same as wanting to create a cross-platform (read: greater than Apple and Linux) ecosystem.

        • LeFantome@programming.dev
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          edit-2
          1 month ago

          The text you quote literally appears under the heading “Apple Platforms”. Gee, why don’t they mention anybody else in the Apple section?

          Immediately below that, there is a cross-platform section where they say “SwiftArgumentParser and Swift’s growing package ecosystem make developing cross-platform command-line tools a breeze.”

          So, at worst, it sounds like the main Swift project may leave you to heft some of the GUI load yourself. Except 99% of what Ladybird does is under the hood processing that creates bitmaps for display. There is hardly any GUI really. Plus, Swift offers C++ interop.

          Ladybird stems from SerenityOS where they write everything themselves. They have their own networking, GUI libraries, and crypto. Since splitting, they have adopted font rendering and media libraries from other projects ( largely available as C code I believe ).

          Swift is cross-platform in all the ways the Ladybird gang needs it to be. It uses LLVM ( very cross-platform ) and the Swift compiler is meant to be cross-platform. All that will evolve and improve independent of Ladybird itself. The Ladybird team does not need many libraries from the Swift ecosystem. What they will need is pretty basic and fundamental.

          Think back to Rust and Mozilla. When Mozilla rewrote the CSS parser in Rust, how much GUI rework was required? None? The CSS parser fell into the space defined by “command-line tools”.

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        26
        arrow-down
        9
        ·
        edit-2
        1 month ago

        So the Ladybird browser will have no trouble running on Linux servers? Great! Now how about platforms where people use web browsers? i.e. Android, and Windows… Apple has no vested interest in cross platform support to platforms that matter for a web browser.

        • roanutil_@programming.dev
          link
          fedilink
          arrow-up
          17
          arrow-down
          2
          ·
          1 month ago

          Swift already works on Android and Windows. The support for Windows is improving and on the way to being official instead of questionable. The Browser Company is already building their app on Windows with Swift.

          Swift’s governance has had some bumps in the past but is improving. Apple does have a vested interest in Swift adoption outside of their platforms. The more popular it is in general, the better the community and ecosystem get.

    • barsquid@lemmy.world
      link
      fedilink
      arrow-up
      18
      ·
      1 month ago

      It is compiled with LLVM and Clang. Where is the danger of losing cross-platform compatibility? It will be fine.

    • Tekhne@sh.itjust.works
      link
      fedilink
      arrow-up
      7
      arrow-down
      2
      ·
      1 month ago

      Also, Safari on Windows had low usage, and was probably a pain to maintain. Swift cross platform is more about abstracting out Apple specific things (like the standard library and UI toolkit). Apple has already been investing multi-year efforts into Swift on the server for longer than Safari on Windows existed. The last couple versions of Swift (~3-4years of development) have been almost entirely focused on safe concurrency, which is intended for server-side development.

      • masterspace@lemmy.ca
        link
        fedilink
        English
        arrow-up
        27
        ·
        1 month ago

        Also, Safari on Windows had low usage, and was probably a pain to maintain.

        I’m 90% sure the entire reason was that it would force all web developers who wanted to target iOS to buy Macs since that’s the only place you could then test against Safari / Webkit.

        Apple has already been investing multi-year efforts into Swift on the server for longer than Safari on Windows existed. The last couple versions of Swift (~3-4years of development) have been almost entirely focused on safe concurrency, which is intended for server-side development.

        That doesn’t mean they’ve invested anything in getting it running on consumer operating systems.

    • LeFantome@programming.dev
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      1 month ago

      Apple is still very vested in the success of Swift overall and also friendly to the cross-platform agenda.

      What significant beneficiary is backing Rust?

      At a deeper level, they both heavily lean on LLVM which of course is heavily supported by many players ( including Apple ) and which is also deeply cross-platform.

    • Tekhne@sh.itjust.works
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 month ago

      I’ve worked with Swift a bunch for Apple platforms, am mildly familiar with how it works on other platforms. It should be able to compile on a wide host of platforms with minimal/no issues. The runtime dependencies are localized to Apple platforms, and I think the dominant UI toolkit on other platforms is a Swift port of qt. So it should be just fine?

    • kenkenken@kbin.run
      link
      fedilink
      arrow-up
      7
      arrow-down
      20
      ·
      1 month ago

      Probably to be a cross platform wide-adopted browser is not the goal, and the author hopes to find a niche userbase amongst conservative macOS users to feed his narcissism.

      • ggppjj@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        1
        ·
        edit-2
        1 month ago

        What?

        I mean this sincerely, I’ve been loosely following this project and the OS it is from and would like to know more about what you know, because this is the first time I’ve heard such accusations.

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

          It’s a reference to this: https://github.com/SerenityOS/serenity/pull/6814#issuecomment-830793992

          They have a phobia of making changes that are valid if they perceive the change to be motivated by politics. In the example above, the PR is denied because they have been convinced that the PR is about accommodating trans people. The existence of trans people and accommodating them via grammar is political for certain kinds of conservatives. The irony is that their own political beliefs are affecting their ability to distinguish a valid change from a politically-motivated one.

          • LeFantome@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            1 month ago

            This is a risky comment I know but projecting the politics of “certain kinds of conservatives” onto a Swedish person feels political to me. Why do we feel we know his thought? Certainly not because of the political climate elsewhere I hope.

            After reading the SerenityOS comment, I find it a lot easier to believe that he thought following the long history of apolitical norms in language use was the safe, non-political option. Little did he know?

            I realize that many people now see “historical norms” as implicitly tainted by adjacent beliefs that many also have been present historically. That is fine. Go ahead and change the language. Language evolution is natural. I have no problem with that. But can we not also acknowledge that many people simply learned to use language within a context that had nothing to do with these issues? Isn’t “lack of awareness” or even “lack of a position” a more likely explanation than “sides with the enemy”.

            I see no evidence that the SerenityOS guy himself meant anything political. I do not believe that I can tell his stance on trans issues at all from what he said. And that is the problem.

            Insisting that other people that do not share your passion for language reform are anything other than neutral to your issues is very political. You are projecting some very unkind attributes onto somebody that does not deserve that treatment.

            How is persecution of others a valid way to defend a minority? All I see is one innocent comment asking to be left out of a political debate and then months or years of aggressive attacks in response. Has he even responded to these attacks?

            At the time the comment was written, I think it could have been included in the project or not and it would have meant nothing either way. As somebody that believes trans people are just people, it honestly would not have occurred to me to object to either text.

            Frankly, the level of vitriol that has been directed towards him totally vindicates his initial comment. The level of politics is absurd. I am quite sure that many people witnessing these attacks are turned off. Some that were previously pretty neutral have probably been driven away. Others will fear “trans” as a dangerous, radical movement.

            What is the actual goal here? It cannot actually be harmony and inclusion. Nobodycould be pushing that so ineffectively.

            • livingcoder@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              1 month 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.

    • mke@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      edit-2
      1 month ago

      For comparison, Mozilla is on Twitter as well, but they’re also on mastodon and even went as far as deciding to host their own instance.

  • monobot@lemmy.ml
    link
    fedilink
    arrow-up
    28
    arrow-down
    3
    ·
    1 month ago

    I never understand hate ladybird and SymphonyOS is getting in fediverse.

    People are doing interesting work against all odds, everyone ever just saying “it is not possible”, finding some random comments from project founder to hate.

    But you know what? You and your opinion is not important. People are not doing this to make Linux competitor or Mozzila competitor but to have fun and learn something new.

    I also don’t want apple near it, but Andreas learned browser development on Safari and with looking for “popular enought” memory safe language it is rust vs swift and just by looking at the code becomes obvious how easier Swift is to pick up. Especially for someone comming from C++.

    Haters gonna hate, I wish them luck. Failing is ok too.

    • mke@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      1 month ago

      everyone ever just saying “it is not possible”,

      I’ve definitely seen people saying they’ll fail, with no arguments to back that up, and I stand with you against that kind of baseless speculation. But it’s worth noting there are many folks bringing up thought-out technical disagreements with the project’s decisions. Some may be more opinionated than others, but that’s life.

      finding some random comments from project founder to hate.

      If you’re referring to what I think you are, that’s not it. People aren’t chasing after random comments because they want to throw shit at Ladybird. It’s called criticism. Criticism, if valid, is not the same as hate, and portraying people who bring up Andreas’ actions—possibly those of most important person in the project—as one-dimensional haters is disingenuous.

      But you know what? You and your opinion is not important. People are not doing this to make Linux competitor or Mozzila competitor but to have fun and learn something new.

      But they’re not? Ladybird has a fully-fledged US 501©(3) non-profit with clear ideals, a roadmap and even sponsors that have pledged over one million USD in funding combined (see Chris Wanstrath’s post).

      Haters gonna hate, I wish them luck. Failing is ok too.

      Yes, that’s true. Please don’t disregard people offering valid criticism, though.

    • ripcord@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 month ago

      People are not doing this to make Linux competitor

      Right, they’re not trying to build a Linux competitor by building an Ubuntu Linux fork :)

      Edit: Oh, you probably meant SerenityOS and not SymphonyOS

    • hector@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      I’d love to be able to use Swift so I’m excited to what they’re going to bring to the ecosystem! Would be cool if there’s a place to contribute when Swift 6 comes out :))

  • senkora@lemmy.zip
    link
    fedilink
    arrow-up
    24
    arrow-down
    2
    ·
    1 month ago

    Swift was developed by a lot of former C++ committee members, and in C++ circles they’ve been advocating for it as a “successor language” for quite some time.

    This could definitely be confusing if you don’t have that context, but making Swift useful for this kind of project has been an explicit goal of the Swift developers for years.

  • mke@lemmy.world
    link
    fedilink
    arrow-up
    38
    arrow-down
    22
    ·
    1 month ago

    I know some folks think this is annoying, but once again, note that if you’re the kind of user who shuns Brave because the CEO does stupid shit every once in a while, you’ll probably not look fondly upon Ladybird’s project lead and main developer being scared of pronouns.

    See this issue on github.

    If you don’t care about that, it’s an interesting project. Can’t say I approve, though.

    Posting this to inform people and let each one decide what to do on their own. Don’t harass anyone, please.

    • refalo@programming.dev
      link
      fedilink
      arrow-up
      7
      arrow-down
      3
      ·
      edit-2
      1 month ago

      https://lemmy.ml/post/19080982/12955657

      I feel like Linus has said much worse things, without much remorse (the attacks didn’t stop after he apologized), for many many years, but I have never seen anyone boycott Linux solely because of his attitude…

      I think most people do not consider the Ladybird drama to be a big deal, it seems only a small vocal minority really care about it.

      • mke@lemmy.world
        link
        fedilink
        arrow-up
        10
        arrow-down
        4
        ·
        edit-2
        1 month ago

        https://lemmy.ml/post/19080982/12955657

        What do you want me to read here? I only saw three comments unrelated to anything I said.

        I feel like Linus has said much worse things, without much remorse (the attacks didn’t stop after he apologized), for many many years,

        Linus had a problem with criticizing people’s work respectfully. Rather, he’d straight up insult people, with little to no useful feedback, and people very much complained about it. Maintainers complained. It got to the point that he, thankfully, committed to taking a break from the kernel to work on improving himself. It wasn’t just an apology. He has since gotten much better. When he regresses, it’s entirely fair to criticize it.

        but I have never seen anyone boycott Linux solely because of his attitude…

        Then you’ll be happy to discover that many people working on Linux were quite public about their disapproval of Linus’ behavior back then. With him, with others, it was their complaints that got him to change.

        I think most people do not consider the Ladybird drama to be a big deal, it seems only a small vocal minority really care about it.

        Maybe. But it’s not about the size of the group, it’s about the complaints themselves. We don’t decide whether something is an issue worth caring about based on how many people think so. That’d be horrible. Racism was once the issue of a vocal minority; thank goodness people didn’t shut up about it and more eventually listened.

        Andreas’ behavior reflects poorly on the project as a whole and ought to change. It pushes away folks who could be part of the community and helping the project, be it as users, developers or financial supporters. My comments aren’t intended to incentivize boycotting Ladybird because I don’t like the man, they’re meant to raise awareness of a serious issue in the hopes that, one day, perhaps he’ll grow up like Linus did.


        I’d never mention this out of the blue, but since you brought up Linus, here’s my unnecessary fun opinion. I’d bet money that Andreas’ takes on inclusivity wouldn’t be appreciated by Linus, because the man’s one deranged step away from calling pronouns woke.

  • tengkuizdihar@programming.dev
    link
    fedilink
    arrow-up
    13
    arrow-down
    2
    ·
    1 month ago

    If he think swift is the way to go, good for him. The code before swift is still open source, so interested user can fork it. What is there to hate?

    • onlinepersona@programming.devOP
      link
      fedilink
      arrow-up
      24
      arrow-down
      2
      ·
      1 month ago

      It is his project and I’m not going to create an issue on github lambasting him, but I do have an opinion. He’s clearly not an idiot, it just isn’t a decision I agree with 🤷‍♂

      Disagreement != hate. Life isn’t made up of extremes.

      Anti Commercial-AI license

  • ssm@lemmy.sdf.org
    link
    fedilink
    arrow-up
    6
    arrow-down
    2
    ·
    1 month ago

    Rest in piss, Links2 it is. Maybe netsurf can complete their js engine in 3 billion years.