← Back to context

Comment by binary132

1 day ago

Ladybird is going to use Swift.

I know they have said that. But it feels a bit strange to me to continue to develop in C++ then, if they eventually will have to rewrite everything in Swift. Wouldn't it be better to switch language sooner rather than later in that case?

Or maybe it doesn't have to take so much time to do a rewrite if an AI does it. But then I also wonder why not do it now, rather than wait.

That is the plan, but they are stalled on that effort by difficulties getting Swift's memory model (reference counting) to play nice with Ladybird's (garbage collection)

I think there was some work with the Swift team at Apple to fix this but there haven't been any updates in months

If I remember correctly, the guy behind it used to work at Apple, maybe that has to do something with it?

That is very good news!

I've used Swift a bunch for hobby projects, and the two things that suck about it are:

1. XCode

2. Compile times

I would assume if you're coming from C++ or Rust the compile time issues aren't really something you notice anyway :P

  • You don't strictly have to use Xcode to use swift, there's a good LSP for use in other editors.

    That said, if you're using Swift to build an app, you're probably still going to want to use Xcode for building and debugging

    • Yea, I'm building iOS apps mostly, and some macOS apps, so definitely need to use XCode :/

I know that that’s the plan, but I believe it when I see it. Mozilla invented entire language features for Rust based on Servo’s needs. It’s doubtful whether a language like Swift, which is used mostly for high-level UI code, has what it takes to serve as the foundation of a browser engine.

  • Swifts most notable use case is certainly making apps but if I recall correctly Apple has converted a good bit of their networking code to Swift.

    It may not be the lowest of the low level but it certainly is more flexible than meets the eye