<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On Oct 26, 2016, at 20:56, Russ Bishop via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">Do we already have a proposal for expanding constraints to support categories beyond class? I am guessing this might have ABI stability concerns, or at least library resilience concerns.</div><div class=""><br class=""></div><div class="">If so and no one else has tackled it I’m happy to write up a proposal. There are only a couple that I know of:</div><div class=""><br class=""></div><div class=""><b class="">valuetype</b></div><div class="">Only struct and enum types would satisfy this constraint.</div><div class=""><br class=""></div><div class=""><b class="">valuetype(pure)</b></div><div class="">A struct or enum that contain no reference types at all. The only reason to add this would be allowing certain optimizations, though the way existentials work today I’m not sure if this is even possible because the calls to value witnesses need to be emitted anyway.</div><div class=""><br class=""></div><div class=""><b class="">functiontype</b></div><div class="">A function type. This doesn’t have much use today but eventually we could expand this to support reflecting the number and type of arguments, dynamically invoking, etc.</div></div></blockquote><div>I think "valuetype(pure)" would make a good starting point for some stuff. It depends on what exactly "pure" means and whether there are other adjectives we can use.</div><div><br></div><div>There are (at least potential) optimizations whose name and exact definition are unclear to me. For example, does "pure" also imply that equality can be checked just by comparing the bits? Because that would exclude, say, a 1's complement integer type because they inherently have two bit patterns for 0, even though such a type would meet the definitions of "pure" that usually get suggested.</div><div><br></div><div>The topic of supporting a "pure" <noun> has come up a few times before, and it seems like they never go anywhere because of a) too many differing views on what "pure" actually means, and b) a reluctance to support additional adjectives ("reallypure", or whatever) to specify which definition of "pure" is intended.</div><div><br></div><div>I suspect that this is purely a language barrier issue... (See what I did there? Aw yeah... 😁) Does anyone know of an online resource that explains graduate/phd-level computer science terms which are still under active research?</div><div><br></div><div><br></div><blockquote type="cite"><div><div class="">If there aren’t any ABI or resilience concerns then we can shelve it. I created <a href="https://bugs.swift.org/browse/SR-3056" class="">https://bugs.swift.org/browse/SR-3056</a> to track the idea in either case.</div></div></blockquote><div>I keep losing track of what exactly constitutes "ABI stability and resilience". I'm pretty sure someone posted some guidelines on the matter, but I forgot to bookmark it.</div><div><br></div><div>- Dave Sweeris, who swears he's really not trying to drag every thread off-topic</div></body></html>