• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "swift". Back to normal view
    1. Ladybird chooses Swift as its successor language to C++

      I've copied the full tweet below (it's from August, I missed this news somehow): We've been evaluating a number of C++ successor languages for @ladybirdbrowser , and the one best suited to our...

      I've copied the full tweet below (it's from August, I missed this news somehow):

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


      Nitter link:

      https://nitter.poast.org/awesomekling/status/1822236888188498031

      Original post:

      https://x.com/awesomekling/status/1822236888188498031


      Some of Kling's replies in that thread are also pretty interesting:

      My general thoughts on Rust:
      - Excellent for short-lived programs that transform input A to output B
      - Clunky for long-lived programs that maintain large complex object graphs
      - Really impressive ecosystem
      - Toxic community

      In the end it came down to Swift vs Rust, and Swift is strictly better in OO support and C++ interop.


      The September monthly report for Ladybird released the day after I posted this. It provides basically the same information:

      This Month in Ladybird September 2024

      The section about Swift:

      Successor language search progress

      Over the past year, our core contributors have been exploring potential safe languages to complement or succeed C++. We evaluated several options, including Rust, Swift, Fil-C, and others. While some languages offered compelling features, many fell short in either C++ interoperability or providing the level of memory safety we needed.

      After extensive testing and discussion, Swift emerged as the top choice among our core developers, thanks to the new Swift 6 interoperability features and its growing cross-platform support. As a result, we’ve decided to adopt Swift as our C++ successor language.

      That said, this will be an incremental shift. The existing C++ codebase is deeply embedded in the project, and a complete rewrite would be impractical. Instead, we’ll be gradually introducing new components in Swift, carefully integrating them with our existing C++ code over time. Look forward to a dedicated blog post on the topic soon.

      32 votes
    2. Open-sourcing some Tildes-related code

      Hello! Some of you may know that I have been developing an iOS client for Tildes. I’ve seen other devs like @wababa and @talklittle also working on awesome apps, and have seen some discussion...

      Hello!

      Some of you may know that I have been developing an iOS client for Tildes.

      I’ve seen other devs like @wababa and @talklittle also working on awesome apps, and have seen some discussion there around collaborating on some of the core parts (scraping the website, etc.).

      I’ve also been in touch with @efraimbart, who is working on the awesome Everything protocol project.

      I’m sure there are other devs out there that I haven’t seen, and this post is a call-out for all of you.

      Until an API is available, any similar project will face the same initial blocker: needing to scrape the website for data.

      Is there any interest from the community on collaborating on that part? For example, developing a public library that encapsulates all of the interactions with Tildes and any client can talk to with a consistent API. Or, even better, collaborating on an official API for Tildes (which is, of course, itself an open-source project).

      To that end, I’ve released some of the code I use to accomplish this in Surfboard. Maybe it can help someone build an iOS client, or inspire some of us to build a more generic solution :D. It’s far from perfect or complete, and isn’t even an actual package you can just import and use at this time, but at the very least it documents many of the endpoints and interactions.

      Have a great weekend :)

      88 votes
    3. Learning Swift - Best suggestions

      Hey everyone, I’ve been messing with complex nested if/then statements in Excel for many, many years, and recently dabbled in VBA. I’ve decided it’s time to learn Swift for Apple. Mainly for...

      Hey everyone,
      I’ve been messing with complex nested if/then statements in Excel for many, many years, and recently dabbled in VBA. I’ve decided it’s time to learn Swift for Apple. Mainly for kicks, but also the fun of creating an app if I find a need.

      For those of you that know these things, what’s your biggest suggestion for learning? Most useful tips? Things to watch out for? Etc.

      Thanks!

      8 votes