Uploaded image for project: 'Swift'
  1. Swift
  2. SR-1134

LFR: Ability to pack Structs with certain named types (like C / C++)

    XMLWordPrintable

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hitstergtd Hitster GTD
                Reporter:
                hitstergtd Hitster GTD
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: