LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
19.38k stars 784 forks source link

Swift 6.0 Blockers #933

Open ADKaster opened 1 month ago

ADKaster commented 1 month ago

List of issues preventing moving forward on moving Swift 6.0 support out of an experimental state:

Swift issues:

CMake issues:

Ladybird issues:

Open questions:

ngortheone commented 1 month ago

Please reconsider the choice of the successor language. Swift is not really supported on Linux (and very little opensource software is written in Swift for Linux) and not even available on BSDs. This will make Ladybird browser a Windows/OSX only browser.

It will be very sad to loose new web browser to closed-source commercial OSes.

ADKaster commented 1 month ago

"Swift for Server" seems to work just fine locally on my Linux machine. We have every intention of working with upstreams to help it better handle the use cases we have for safety critical components for the platforms we've promised to support for the alpha release sometime in 2026.

As for downstreams like distros, we'll of course work with them as needed when we get closer to actually releasing the browser for end user testing. Again, the Alpha date is sometime in 2026, with a Beta a year after that.

Please keep this issue focused on technical challenges encountered with the integration of Swift 6.0 into our build.

ngortheone commented 1 month ago

Please keep this issue focused on technical challenges encountered with the integration of Swift 6.0 into our build.

@ADKaster BSDs are not "downstream distros". These are entirely separate and complete operating systems with their own kernels and userlands.

Today no swift compiler exists for these 3 operating systems and I don't think there will ever be one. I urge you to reconsider the choice of swift. Literally any other language will have better cross-platform and cross-OS support.

AtkinsSJ commented 1 month ago

BSDs are not "downstream distros".

You're misquoting/misunderstanding him. He said "downstreams like distros". Anywhere that packages Ladybird, whether it's a distro or a different OS like one of the BSDs or Haiku etc, is downstream of our repo.

Today no swift compiler exists for these 3 operating systems and I don't think there will ever be one.

Ladybird isn't going into early alpha until 2026, and then a proper release will be years after that. There's plenty of time for Swift support to develop on those other OSes. The Swift compiler is based on LLVM so the amount of porting required shouldn't be too huge. (Though I haven't looked into it.) Even on Linux the Swift situation is a little rough right now, but it'll improve with time.

ADKaster commented 1 month ago

As Sam said, I meant to refer to any package or port that distributes the application for their operating system, not to classify the BSDs as Linux Distros.

Today no swift compiler exists for these 3 operating systems and I don't think there will ever be one.

There is documentation from 2022 for building Swift on OpenBSD. https://github.com/swiftlang/swift/blob/main/docs/OpenBSD.md. The technical challenges with the latest efforts of porting Swift to FreeBSD seem llvm related. The issues with updating Swift to work on more BSD platforms are technical problems, not political ones. Unless there's BSD mailing list drama I'm not aware of. But that would still be out of scope for our project.

As you mentioned, there are no large and/or popular open source desktop applications using Swift (to my knowledge). I can't think of a better way to energize Swift porting efforts than to prove that such a thing is possible on non-macOS Unix systems.

ngortheone commented 1 month ago

You're misquoting/misunderstanding him. He said "downstreams like distros". Anywhere that packages Ladybird, whether it's a distro or a different OS like one of the BSDs or Haiku etc, is downstream of our repo.

Indeed I misunderstood the meaning of downstream in this context.

I do not want to discourage the optimism and I hope that Ladybird will succeed. The opensource ecosystem desperately needs "new blood" in the browser section. But lets look at the facts:

I can't think of a better way to energize Swift porting efforts than to prove that such a thing is possible on non-macOS Unix systems.

It does seem like you are subscribing yourselves to more work than you expect:

P.S. Have you looked at Herb Sutter's cppfront? (https://hsutter.github.io/cppfront/) It is a lot less invasive way to get nice things in a C++ project

ADKaster commented 1 month ago

Thanks for your feedback, but like I said, this issue is for technical issues with our specific implementation. If you want to debate the merits of using Swift for an open source project, please do it in the appropriate forum.

We have done our technical diligence regarding this experiment, and suggestions otherwise are not helpful for meeting the goals of the project

compnerd commented 3 weeks ago

I believe that the currently marked Swift issues are dealt with except for the bridging header disagreement. That might be something that can get addressed in the next cycle depending on if anyone is willing to pick up the necessary investigation.

ADKaster commented 3 weeks ago

@compnerd I could use some help minimizing #1101 and #1102 into minimized swift-specific issues. At the moment they require using the real AK library.

compnerd commented 3 weeks ago

Do they reproduce on Windows or require a macOS host?

ADKaster commented 3 weeks ago

I have reproduced both issues on Linux and macOS.

compnerd commented 3 weeks ago

Unfortunately, the only host that I currently have with a development toolchain setup is Windows.

circl-lastname commented 3 weeks ago

Unfortunately, the only host that I currently have with a development toolchain setup is Windows.

You can use WSL2 to run Ladybird during this time

ADKaster commented 3 weeks ago

I believe that the currently marked Swift issues are dealt with except for the bridging header disagreement.

Actually, the 6.x backport for the libstdcxx issue is currently only approved by Egor, not by the proper release managers. So I can't quite recommend folks test on linux with swiftly install 6.0-snapshot yet. https://github.com/swiftlang/swift/pull/75971