Stabilizing Swift on Linux


I read this article and my idea for trying to solve the problem, is could we stabilize Swift's ABI on Linux and then maybe other languages could start using that as an ABI instead of C.

Is it even possible to stabilize Swift on Linux?

Also wow nice work the entire Swift team!!

Context I am an undergrad so I don't know a lot of the details yet. I have taken a Compilers class and OS is next semester.


1 Like

It's a lovely idea, but I don't know if we're currently in a place where it's the right thing to do. Stabilizing an ABI is a profoundly labor intensive decision that also limits future evolution of the language and libraries. On Darwin this was basically a non-choice; in order for the platform to adopt Swift it had to happen, and adopting Swift in the platform was always the goal. Without a similarly critical driver on Linux I'm not sure the tradeoffs make sense.


Although, given the ABI freeze on Apple platforms and the collateral impact it has on all other platforms, is it that much more restrictive [to evolution] to formally freeze it on Linux too?

it would make life on the server harder in the medium term, because linux libraries will have to start accumulating availability guards the same way macOS libraries currently do.

Maybe I’m misunderstanding, but I think you’re alluding to OS version checks (and the like)? Isn’t that separate from whether there’s a well-defined, compatible library interface?

linux apps are currently exempt from version checks because it is assumed they are always running with the latest version of the swift runtime. a lot of library interfaces depend on the swift runtime and cannot be stabilized unless the runtime is also stabilized.

1 Like

What sort of things are expected to change about the runtime's ABI, in the foreseeable future?

It seems like it'd be hard to make significant changes on any platform if any platform is frozen in this respect, since it's generally undesirable to have significant differences between platforms. (see also the state of Foundation to date, case in point)

1 Like

I think one possible critical driver for Linux is among other things to support binary dependencies and evolution across toolchain versions - we are fighting quite a bit with those issues currently as we want to ship a stable ABI for our customers plugins.

I am personally a bit afraid that the desire to do a perfect solution that works across multiple distros will stop support for a single distribution.

1 Like