<div style="white-space:pre-wrap">Thanks Jordan!<br><br>Another question if anyone has some time: I&#39;m really interested in contributing to the project, but given that I don&#39;t have a ton of experience with compilers, I&#39;m having a really hard time following the flow of the program. I understand that the high level flow is lexing, parsing, sema, and building the AST. However, tracing through the actual functions in the compiler prove much more difficult due to the amount of indirection/metaprogramming.<br><br>Are there any sort of sequence diagrams that I haven&#39;t found yet? If anyone could let me know of any good resources you know of, that would be great. I&#39;m sure this would also be of use to people in my boat that want to help but don&#39;t know how to start.<br><br>Thanks,<br>Seth</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 8, 2015 at 9:04 PM Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com">jordan_rose@apple.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi, Seth. I think you&#39;re getting Clang / swift-clang mixed up with swiftc / swift. Clang is not the Swift compiler; the Swift compiler lives in the &quot;swift&quot; repo. Swift depends on Clang for its interoperation with C and Objective-C.</div><div><br></div><div>A <i>lot</i> of the compiler encodes information about Optional, but most of it stems from ASTContext.h and ASTContext.cpp, which has dedicated entrypoints for getting Optional, Optional.None, and Optional.Some.</div><div><br></div><div>Hope this helps,</div><div>Jordan</div><br><div><blockquote type="cite"></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Dec 8, 2015, at 17:59 , Seth Friedman via swift-dev &lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt; wrote:</div><br></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div style="white-space:pre-wrap">Hi all,<br><br>In Optional.swift in the stdlib, there&#39;s a comment that says &quot;The compiler has special knowledge of Optional&lt;Wrapped&gt;, including the fact that it is an enum with cases named &#39;None&#39; and &#39;Some&#39;.&quot;<br><br>What I&#39;m trying to understand is: If I wanted to implement the optional type from scratch, what would be the process I would go through? I&#39;ve scoured the swift-clang project and can&#39;t seem to find any reference to optionals or even Swift explicitly. I discovered nullability attributes and am hypothesizing that an expression of something like &quot;Type?&quot; is somehow mapped to an attribute, but I&#39;m really just stumbling around in the dark.<br><br>In terms of what I&#39;ve tried, I&#39;ve gone through a lot of the source in the swift-clang lib/Basic and lib/AST directories, and I&#39;ve read through the &quot;Clang CFE Internals Manual&quot; on the Clang website.<br><br>Help is much appreciated!<br><br>Thanks in advance,<br>Seth</div>
</div></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=ZEz4qHYnXhPr3bBPu-2FxP4tN3HfWKL-2FtJpqkQ0gkOVSBL6HRSS2hzpFojqZUT85ho4HsE-2FB0XLWrcqkyvQBO5xufppQ8uPgxEwiKwgl62G3z1r-2BUiBJC1BXFFOiAgFN8sYiuSJIgxPeG9oDjBYl-2BjYeGhsvoyyj8qwRtpVhGMN6onwcfLODiw-2B-2FRXFdKLIXbuUSf1FU50IqzQBipBXcb37O1Np08nQCz4e4XNzuhG5HY-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
_______________________________________________<br>swift-dev mailing list<br><a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a><br></div></blockquote></div><br></div></blockquote></div>