{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/3854","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/3854/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/3854/comments","events_url":"https://api.github.com/repos/apple/swift/issues/3854/events","html_url":"https://github.com/apple/swift/pull/3854","id":168254204,"number":3854,"title":"[WIP][SE-0101] Implement: Reconfiguring sizeof and related functions into a unified MemoryLayout struct","user":{"login":"rintaro","id":142081,"avatar_url":"https://avatars.githubusercontent.com/u/142081?v=3","gravatar_id":"","url":"https://api.github.com/users/rintaro","html_url":"https://github.com/rintaro","followers_url":"https://api.github.com/users/rintaro/followers","following_url":"https://api.github.com/users/rintaro/following{/other_user}","gists_url":"https://api.github.com/users/rintaro/gists{/gist_id}","starred_url":"https://api.github.com/users/rintaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rintaro/subscriptions","organizations_url":"https://api.github.com/users/rintaro/orgs","repos_url":"https://api.github.com/users/rintaro/repos","events_url":"https://api.github.com/users/rintaro/events{/privacy}","received_events_url":"https://api.github.com/users/rintaro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-07-29T05:36:05Z","updated_at":"2016-07-29T10:52:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/3854","html_url":"https://github.com/apple/swift/pull/3854","diff_url":"https://github.com/apple/swift/pull/3854.diff","patch_url":"https://github.com/apple/swift/pull/3854.patch"},"body":"It seems, no one is working on this?\r\n\r\nImplement [SE-0101](https://github.com/apple/swift-evolution/blob/master/proposals/0101-standardizing-sizeof-naming.md)\r\n\r\nStill need more test case for migration support.\r\n\r\nPreparing PR for other repos:\r\n`swift-corelibs-foundation` \r\n`swift-corelibs-libdispatch`\r\n~~`swift-corelibs-xctest`~~ no need\r\n\r\nCC:\r\n@tkremenek\r\nAre you still accepting new implementation?\r\n\r\n@gribozavr \r\nCould you review stdlib part? Added `stdlib/public/core/MemoryLayout.swift`\r\n@jrose-apple, @DougGregor \r\nCould you review fix-it part?\r\n\r\n* * * *\r\n\r\n<!-- This selection should only be completed by Swift admin -->\r\nBefore merging this pull request to apple/swift repository:\r\n- [ ] Test pull request on Swift continuous integration.\r\n\r\n<details>\r\n  <summary>Triggering Swift CI</summary>\r\n\r\nThe swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:\r\n\r\n**Smoke Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please smoke test\r\n        All supported platforms     | @swift-ci Please smoke test and merge\r\n        OS X platform               | @swift-ci Please smoke test OS X platform\r\n        Linux platform              | @swift-ci Please smoke test Linux platform\r\n\r\nA smoke test on macOS does the following:\r\n\r\n1. Builds the compiler incrementally.\r\n2. Builds the standard library only for macOS. Simulator standard libraries and\r\n   device standard libraries are not built.\r\n3. lldb is not built.\r\n4. The test and validation-test targets are run only for macOS. The optimized\r\n   version of these tests are not run.\r\n\r\nA smoke test on Linux does the following:\r\n\r\n1. Builds the compiler incrementally.\r\n2. Builds the standard library incrementally.\r\n3. lldb is built incrementally.\r\n4. The swift test and validation-test targets are run. The optimized version of these\r\n   tests are not run.\r\n5. lldb is tested.\r\n\r\n**Validation Testing**\r\n\r\n        Platform     | Comment\r\n        ------------ | -------------\r\n        All supported platforms     | @swift-ci Please test\r\n        All supported platforms     | @swift-ci Please test and merge\r\n        OS X platform               | @swift-ci Please test OS X platform\r\n        OS X platform               | @swift-ci Please benchmark\r\n        Linux platform              | @swift-ci Please test Linux platform\r\n\r\n\r\n**Lint Testing**\r\n\r\n        Language     | Comment\r\n        ------------ | -------------\r\n        Python       | @swift-ci Please Python lint\r\n\r\nNote: Only members of the Apple organization can trigger swift-ci.\r\n</details>\r\n<!-- Thank you for your contribution to Swift! -->\r\n"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/236151829","html_url":"https://github.com/apple/swift/pull/3854#issuecomment-236151829","issue_url":"https://api.github.com/repos/apple/swift/issues/3854","id":236151829,"user":{"login":"rintaro","id":142081,"avatar_url":"https://avatars.githubusercontent.com/u/142081?v=3","gravatar_id":"","url":"https://api.github.com/users/rintaro","html_url":"https://github.com/rintaro","followers_url":"https://api.github.com/users/rintaro/followers","following_url":"https://api.github.com/users/rintaro/following{/other_user}","gists_url":"https://api.github.com/users/rintaro/gists{/gist_id}","starred_url":"https://api.github.com/users/rintaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rintaro/subscriptions","organizations_url":"https://api.github.com/users/rintaro/orgs","repos_url":"https://api.github.com/users/rintaro/repos","events_url":"https://api.github.com/users/rintaro/events{/privacy}","received_events_url":"https://api.github.com/users/rintaro/received_events","type":"User","site_admin":false},"created_at":"2016-07-29T10:52:41Z","updated_at":"2016-07-29T10:52:41Z","body":"As for `struct` => `enum`, no problem.\r\nAs for `.of(value)`, I think we can remove it. \r\nI defer the decision to the core team. @gribozavr, @dabrahams ?\r\n\r\nIf we decide to drop it, the implementation of migration fix-it cannot be fully implemented, or will be very complicated.\r\n\r\n```swift\r\nfunc fn<S: Sequence>(s: S) {\r\n  var i = s.makeIterator()\r\n  let size = sizeofValue(i.next()!)\r\n  // => let size = MemoryLayout<S.Iterator.Element>; _ = i.next()!\r\n```\r\n\r\nWe have to actually look into the type of the value.\r\nAnd, in case of reading the value has side effects, we have to evaluate and discard the result.\r\nI assume we can implement that, but I'm not sure *I* can.\r\nAnd typically, we prefer minimally modify the source.\r\n"}}
{"actor":{"display_login":"rintaro"}}