<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><b class="">What is your evaluation of the proposal?</b><div class="">I’m not in favor of the majority of this proposal (I do support getting rid of the *Value versions of the functions). Of the motivations, I find this one to be the most awkward:</div><div class=""><br class=""></div><div class=""></div><blockquote type="cite" class=""><div class="">Refactoring this proposal to use a single namespace increases discoverability, provides a single entry point for related operations, and enables future expansions without introducing further freestanding functions.</div></blockquote><div class=""><br class=""></div><div class="">While technically storing stuff under a new type creates a level of indirection that we may refer to a namespace, it does so in a way that I’m not terribly convinced is even conceptually correct. A new MemoryLayout struct implies there is actually a type we are creating here, but that’s not the case: we are simply using the type as a hack to get a namespace because Swift lacks support for that notion. </div><div class=""><br class=""></div><div class="">If we must have a struct to achieve this, than at the very least, can’t we move all of the generics onto the function call itself?</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> MemoryLayout {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">static</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> sizeof<T>(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">_</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> x: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);" class="">T</span><span style="font-variant-ligatures: no-common-ligatures;" class="">.Type) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> { </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">return</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Swift.</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">sizeof</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(x) }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">// ...</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">Further, I find this change to just make readability suffer. Here’s is a random snippet found from a GitHub search:</div><div class=""><br class=""></div><div class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">let</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> data </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">=</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> NSData(bytes: </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">&</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">bytes, length:</span><span style="color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">sizeof</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">(</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">CChar</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">) </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">*</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> bytes</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">.</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">count</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">)</span></div><div class=""><div class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">let</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> data </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">=</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> NSData(bytes: </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">&</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">bytes, length:</span><span style="color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">MemoryLayout<</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">CChar>.size</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">*</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> bytes</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">.</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">count</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">)</span></div></div><div class=""><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class="">That’s a lot more typing for what? </div><div class=""><br class=""></div><div class=""><div class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">let</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> data </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">=</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> NSData(bytes: </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">&</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">bytes, length:</span><span style="color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">MemoryLayout</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">.sizeof(</span><span style="color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;" class="">CChar)</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">*</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> bytes</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">.</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap;">count</span><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">)</span></div></div><div class=""><span style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div class="">The above actually satisfies the concern, which seems to be primarily that the functions are top-level functions instead of namespaced.</div><div class=""><br class=""></div><div class=""><b class="">Is the problem being addressed significant enough to warrant a change to Swift?</b></div><div class="">No. Like mentioned in the proposal, these are already low-use terms. As such, there is a much prior art for these to turn up search results easily for them and their concept apply across multiple languages.</div><div class=""><br class=""></div><div class=""><b class="">Does this proposal fit well with the feel and direction of Swift?<br class=""></b>No. The heart of the proposal seems to be a workaround for the lack of namespacing in Swift.</div><div class=""><br class=""></div><div class=""><b class="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class=""></b>Yes, those languages have better readability around these terms.</div><div class=""><br class=""></div><div class=""><b class="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</b><div class="">I’ve read the proposal, looked up code snippets, and tested my own implementation within playgrounds.</div><div class=""><br class=""></div><div class="">-David</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 12, 2016, at 4:53 PM, Chris Lattner <<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello Swift community,<br class=""><br class="">The second review of "SE-0101: Reconfiguring sizeof and related functions into a unified MemoryLayout struct" begins now and runs through July 19. The proposal is available here:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0101-standardizing-sizeof-naming.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0101-standardizing-sizeof-naming.md</a><br class=""><br class="">Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""><br class="">or, if you would like to keep your feedback private, directly to the review manager.<br class=""><br class="">What goes into a review?<br class=""><br class="">The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* What is your evaluation of the proposal?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* Is the problem being addressed significant enough to warrant a change to Swift?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* Does this proposal fit well with the feel and direction of Swift?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br class=""><br class="">More information about the Swift evolution process is available at<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>https://github.com/apple/swift-evolution/blob/master/process.md<br class=""><br class="">Thank you,<br class=""><br class="">-Chris Lattner<br class="">Review Manager<br class=""><br class=""><br class="">_______________________________________________<br class="">swift-evolution-announce mailing list<br class="">swift-evolution-announce@swift.org<br class="">https://lists.swift.org/mailman/listinfo/swift-evolution-announce<br class=""></div></div></blockquote></div><br class=""></div></div></body></html>