swift icon indicating copy to clipboard operation
swift copied to clipboard

[SE-0461] Replace `@execution(...)` with `@concurrent` and `nonisolated(nonsending)

Open xedin opened this issue 8 months ago • 1 comments

  • Add @concurrent declaration and type attributes to replace @execution(concurrent)
  • Add new nonsending modifier to nonisolated declaration modifier
  • Make it possible to use nonisolated(nonsending) in type and expression contexts (modeled via CallerIsolatedTypeRepr)
  • Replace @execution(caller) with nonisolated(nonsending) modifier
  • Remove all of the references to @execution attribute throughout the codebase
  • Remove ExecutionAttribute experimental flag

xedin avatar Apr 09 '25 07:04 xedin

https://github.com/swiftlang/swift-syntax/pull/3047 @swift-ci please test

xedin avatar Apr 09 '25 07:04 xedin

https://github.com/swiftlang/swift-syntax/pull/3047 @swift-ci please test

xedin avatar Apr 10 '25 18:04 xedin

https://github.com/swiftlang/swift-syntax/pull/3047 @swift-ci please test

xedin avatar Apr 11 '25 01:04 xedin

Curious: do we not need feature suppression for this new pair of attributes?

We don't need a feature for this since the proposal was been accepted, that's why I've removed ExecutionAttribute feature in this PR.

xedin avatar Apr 11 '25 18:04 xedin

We don't need a feature for this since the proposal was been accepted

I thought the practice was to ship syntactic features as suppressible for a while for short-term textual interface compatibility.

AnthonyLatsis avatar Apr 11 '25 19:04 AnthonyLatsis

I don't think we make these backward compatibility guarantees (anymore?) based on conversation with @tshortli about -interface-compiler-version.

xedin avatar Apr 11 '25 20:04 xedin

These new/old attribute and modifier are not going to be present in old interface files unconditionally anyway.

xedin avatar Apr 11 '25 20:04 xedin

No, Anthony is right. There is a trailing window of previous development versions of the compiler that textual interfaces must remain compatible with.

tshortli avatar Apr 11 '25 20:04 tshortli

For posterity: we discussed this offline and yes, we do need a feature flag here to indicate that new attributes are supported only by new compilers even though we have been inconsistent about this in the past.

xedin avatar Apr 11 '25 23:04 xedin

https://github.com/swiftlang/swift-syntax/pull/3047 @swift-ci please test

xedin avatar Apr 11 '25 23:04 xedin

@swift-ci please test source compatibility

xedin avatar Apr 12 '25 00:04 xedin

https://github.com/swiftlang/swift-syntax/pull/3047 @swift-ci please test source compatibility

xedin avatar Apr 12 '25 02:04 xedin

https://github.com/swiftlang/swift-syntax/pull/3047 @swift-ci please test macOS platform

xedin avatar Apr 12 '25 08:04 xedin