<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 dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div>Hi Chris</div><div>I am a bit slow to respond, please read inline, thanks.<br class=""><blockquote type="cite" class=""><div class="">On 1 Oct 2016, at 01:47, Chris Lattner &lt;<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Sep 30, 2016, at 2:51 PM, Ted F.A. van Gaalen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div class=""><blockquote type="cite" class="">Is it possible to have best of (these completely different) both worlds? <br class=""></blockquote><br class=""></div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div class="">Yes, of course it is. &nbsp;</div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div class="">Your email spends a lot of words </div></div></blockquote>Does it?&nbsp;</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div class="">trying to form a false dichotomy. </div></div></blockquote>Well, sorry, thank you. but No, I don’t think so:&nbsp;</div><div>I am merely describing the advantages and&nbsp;</div><div>disadvantages of static programming languages.&nbsp;</div><div>It doesn’t mean it should be one or the other, just observing.</div><div>Just thinking about the future in years, not in weeks.&nbsp;</div><div><div>Even so, I still like Swift.</div><div class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class=""><div class="">Swift can definitely have both awesome dynamic features while still having performance, predictability and safety.<br class=""></div></div></blockquote>Yes, I take it that it is possible to implement these.&nbsp;</div><div>Currently it is not possible to do meta programming in Swift, that is, create&nbsp;</div><div>arbitrary functions, properties and new classes</div><div>during run time. hypothetical along the lines as if it were so:</div><div><br class=""></div><div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(0, 132, 0);" class="">// Warning! hypothetical as yet not compilable coding follows:</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(0, 132, 0); font-size: 14px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">&nbsp; &nbsp; let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> Monolith: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">Class</span><span style="font-variant-ligatures: no-common-ligatures;" class="">?</span></span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></span></p><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> classdefstring = </span><span style="font-variant-ligatures: no-common-ligatures" class="">"parentclass: SpaceObject;"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> +</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">"var l = 9.0; var h = 4.0; var&nbsp; w = 1.0; "</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> +</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"var color = "</span><span style="font-variant-ligatures: no-common-ligatures" class=""> + defaultMonolithColorStr &nbsp; +</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">";func volume() -&gt; Double { return l * w * h} “ +</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class=""><font color="#d12f1b" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font>aStringWithAdditionalComponentDefinitions</span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class=""><br class=""></span></p><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> defMonolithClass()</span></span></p><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">do</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// try to define a class, NOT an instance.</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Monolith = Meta.defineClass(classdefstring)</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">catch</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.classDefinitionError</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// handle a possible class definition error</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // e.g. syntax errors. symbols not found etc. &nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">catch</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.creationConflict</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// class cannot be defined or redefined when instances of Monolith exist.</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // necessary?</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><br class=""></span></p><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">do</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// dynamically add components to the Monolith</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.addPropertyTo( Monolith,</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"mass"</span><span style="font-variant-ligatures: no-common-ligatures" class="">,&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">3.4</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.addPropertyTo( Monolith,</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"physics"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, PhysicsBody)</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">try</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.addFunctionTo( Monolith, someFunctionDefinitionString)</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">catch</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.ClassExtenderError</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// handle the error</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">catch</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Meta.creationConflict</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; {</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// class definition cannot be altered when instances of Monolith exist.</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // necessary?&nbsp;</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="color: rgb(0, 132, 0); font-size: 14px;" class="">&nbsp; &nbsp; }</span></p><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></span></p><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; defMonolithClass()</span><br class="webkit-block-placeholder"></span></p><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></span></p><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// Make an instance of the dynamically generated class</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; public&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> mn = Monolith()&nbsp;</span></span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></span></p><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> vol = mn.volume</span></span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></span></p><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp;&nbsp;</span>// One can remove after usage, normally ARC should take care of that.</span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(0, 132, 0);" class="">// unless one would wish to reinstate/redefine Monolith again.</span></span></p><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-size: 14px; font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp; mn = </span><span style="font-size: 14px; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);" class="">nil</span><span style="font-size: 14px; font-variant-ligatures: no-common-ligatures;" class=""> &nbsp; &nbsp; &nbsp; </span><span style="font-size: 14px; color: rgb(0, 132, 0); font-variant-ligatures: no-common-ligatures;" class="">// remove instance</span></p><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><br class=""></span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; Monolith = </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">nil</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// should throw an error when instances of Monolith are still around.</span></span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><div style="margin: 0px; line-height: normal; min-height: 20px;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; min-height: 20px;" class=""><span style="font-size: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp; defMonolithClass() &nbsp;</span><span style="color: rgb(0, 132, 0);" class="">// again, possibly with other definition strings</span>&nbsp;</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class=""><br class=""></span></div></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="color: rgb(0, 132, 0); font-size: 14px;" class="">&nbsp; &nbsp; // Of course ARC should remove dynamic class defs automagically when no longer</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="color: rgb(0, 132, 0); font-size: 14px;" class="">&nbsp; &nbsp; // needed.&nbsp;</span></div><p style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 20px;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 14px;" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div class="">There could be overloads of defining classes etc. using other methods than string wise declaration..&nbsp;</div><div class="">Of course, Meta… for defining structs and other components could be made in a similar fashion.</div><div class="">I’d guess &nbsp;that it might be very hard and complicated to implement meta creation similar to the above?&nbsp;</div><div class="">Probably needed the app to interact many times with a compiler present on the target OS/device? -&nbsp;</div><div class="">thereby making small pluggable “bricks” &nbsp;</div><div class="">Just brainstorming here: I know nearly nothing of compiler construction.</div></div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">Would it be possible in Swift to have facilities to generate objects <br class="">dynamically at runtime? and, if desirable, how can such be implemented?<br class=""></blockquote><br class="">Here’s an extant implementation that you can use today:<br class=""><a href="https://github.com/Zewo/Reflection" class="">https://github.com/Zewo/Reflection</a><br class=""></div></div></blockquote>Very complex code (to me, hard to read) . As far as I can see, it’s a clever hack but vulnerable because&nbsp;</div><div>depending completely on the underlying memory occupation and layout of an existing class definition? &nbsp;</div><div>Totally new classes/structs etc. cannot be defined with it?</div><div>(like in the above hypothetical class def example)</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">I’m sure it isn’t ideal, but it proves that it can be done. &nbsp;When we have bandwidth to reevaluate this area from first principles, I’m sure we can make improvements on it.<br class=""></div></div></blockquote>Yeah, I guess it can be done, that would be great!<br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">I will grant you that Smalltalk is a beautiful language in its simplicity, but for that simplicity it makes many tradeoffs that we’re not willing to make. &nbsp;</div></div></blockquote><div>The only tradeoffs I can think of so far are:</div><div><br class=""></div><div>&nbsp; - Run time speed. in spite of precompiled methods etc Smalltalk is not so fast as compiled s<span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">tatical&nbsp;</span></div><div><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">programming language executables. However, the&nbsp;</span><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">VMs are getting much better/ faster&nbsp;</span></div><div><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">these days. Dedicated hardware (processors) would really help too.</span></div><div><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class=""><br class=""></span></div><div><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp;- Total freedom, but to me personally this is not a tradeoff at all</span>…</div><div><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class=""><br class=""></span></div><div><span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp;- what else? &nbsp;</span></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">We are willing to make the internal implementation of Swift complex if that means that we get a beautiful model for programmers -</div></div></blockquote><blockquote type="cite" class=""><div class=""><div class="">one that preserves the virtues of safety-by-default, </div></div></blockquote>Safety by default? to some extend, yes. However, my experience with many programming&nbsp;</div><div>languages is, that it almost doesn’t matter how much effort is given</div><div>to make a PL save. I am still traumatised by many [some words removed here] &nbsp;</div><div>source code through all the years I had to work with&nbsp;</div><div>(of course only others are writing baaaaaaad code, naturally, I myself am perfect :o)&nbsp;</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div class="">predictability, performance, and joy-to-develop-in.<br class=""></div></div></blockquote>Yes, I enjoy working with Swift very much as well, thank you (and others) for creating this language.<br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">The meme of “Swift can never (or will never) support dynamic features” is tired, and also wildly inaccurate.<br class=""></div></div></blockquote>That was a bit overcharged from me. I had that impression, being not too broadly informed in this meta stuff.&nbsp;</div><div>Met vriendelijke groeten, kind regards, one of your colleagues/friends from another time :o)&nbsp;</div><div>TedvG<br class=""><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">-Chris<br class=""><br class=""></div></div></blockquote></div><br class=""></div></div></body></html>