<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=""><div>Imho this topic was much better than that other one ;-) — and I just realised that of metaprogramming build on top of reflection wasn't discussed in its own thread yet…</div><div>I fear "constexpr" is already burned, because people associate it with things like calculating Fibonacci numbers at compile time (which is kind of cool, but doesn't have much merit for most of us).</div><div><br class=""></div><div>Right now, there is SE-185, which allows to synthesise Equatable and Hashable.</div><div>To do so, nearly 1500 lines of C++ are needed, and even if we assume that two thirds are comments and whitespace, it's still a big piece of code that could only be written by someone with deep knowledge about C++ and the Swift compiler.</div><div>Compile time metaprogramming could do the same, but in probably less than twenty lines of Swift that could be written rather easily by anyone who knows the language…</div><div><br class=""></div><div>So to update my list of things that might be added, there are also some points that are already there and whose implementation could have been simplified drastically:</div><div><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">- Forwarding of protocol conformance (Kotlin, for example, has this: When a member conforms to a protocol, you don't have to write a bunch of methods that just say "let my member do this")</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">- init with reduced boilerplate</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">- Subtyping for non-class types, including a "newtype" option</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">- Property behaviours</div></div></blockquote></div>- Equatable, Hashabable<div class="">- Encoding/Decoding</div><div class=""><br class=""></div><div class="">I still wonder that virtually no one else seems to be thrilled about the power of the idea… @gor.f.gyolchanyan would you like join an attempt to raise the attention?</div><div class=""><br class=""></div><div class="">- Tino</div></body></html>