Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1134] LFR: Ability to pack Structs with certain named types (like C / C++) #43747

Open
swift-ci opened this issue Apr 3, 2016 · 6 comments
Labels
compiler The Swift compiler in itself feature A feature request or implementation

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 3, 2016

Previous ID SR-1134
Radar None
Original Reporter hitstergtd (JIRA User)
Type New Feature
Status In Progress
Resolution
Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels New Feature, AfterVersion3, LanguageFeatureRequest
Assignee hitstergtd (JIRA)
Priority Medium

md5: 5d89999f6f4efe7f2b7ae8a8b285acb9

relates to:

Issue Description:

It would be good to provide the Swift language/compiler the ability to pack certain type of Structs, similar to the __packed attribute provided by C/C++ compilers.

  1. This would certainly further the goal of using Swift as a systems programming language.

  2. Currently, one would have to write such code in C and then interface with it from Swift.

  3. The feature could be restricted to Structs which only contain certain named types.

I am not an expert on compilers or language design so I apologise if I am trivialising the matter.

Even if the above is not desirable, at the very least, I hope this issue stirs discussion and thought on the topic of being able to use Swift as a systems programming language, and how we could possibly ensure the runtime and standard library can be made to work with it accordingly.

@belkadan
Copy link
Contributor

belkadan commented Apr 4, 2016

This would need to go through the Swift Evolution Process.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Apr 4, 2016

Comment by Hitster GTD (JIRA)

@belkadan, thanks. I have just re-reviewed the guidelines. Thankfully it is not already a commonly rejected proposal. I will draft a proposal for submission to the swift-evolution@ mailing list.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Apr 4, 2016

Comment by Hitster GTD (JIRA)

Draft Proposal in progress.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Apr 7, 2016

Comment by Hitster GTD (JIRA)

@belkadan, I have submitted a draft proposal for comments to the swift-evolution@ mailing list.

@swift-ci
Copy link
Collaborator Author

Comment by Hitster GTD (JIRA)

Summarising feedback received from @lattner:

  1. Good suggestion, but has too many moving parts for it to be implemented in Swift v3

  2. Document draft proposal at bugs.swift.org

  3. The Swift Evolution Process (swift-evolution@), encourages focus on Swift v3 to minimise distractions (rightly so)

This leaves room for a potential implementation after Swift v3; I would like to keep SR-1134 open to document the draft proposal and for anyone else interested in contributing to it as well.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself feature A feature request or implementation
Projects
None yet
Development

No branches or pull requests

3 participants