[swift-evolution] [Swift4][Pitch] Control struct layout with @layout, @offset, @order

Chris Lattner clattner at apple.com
Wed Aug 17 16:22:52 CDT 2016


> On Aug 17, 2016, at 11:37 AM, Mark Lacey via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On Aug 17, 2016, at 11:28 AM, Russ Bishop via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> I wanted to gauge the interest in supporting explicit struct layout and alignment.
>> 
>> The general idea would be to support attributes to create packed structs and set alignment. It will be critical for certain kinds of interop and systems programming in pure Swift. I don’t know about you but I want to write a kernel module in Swift someday :) I’m bringing it up because it probably affects ABI stability and resilience and so meets the requirements for Swift 4 phase 1.
> 
> Explicit layout matters for the ABI once the feature exists, but it seems purely additive, i.e. out of scope for Swift 4 phase 1. You can ship without any explicit layout support and add it later without impacting code that ships before the feature exists.

Agreed.  This is something that we’d like Swift to support someday, but it isn’t on the critical path, and it would be a distraction to dive deep on it right now.

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160817/08f88851/attachment.html>


More information about the swift-evolution mailing list