Avatar
Way back in 2016 I wrote a couple of (now mostly outdated) blog posts talking about how types and declarations are represented in the compiler, and at the time I promised a third installment which would discuss generics. A few of you have asked me about this over the years... Well, I finally got around to starting a write up about how generics ...
10:56 PM
Slavaの書、途中まで読んでるんだけど、かなり良いのでオススメです。 タイトルはGenericsとなってるけど、Genericsを説明するにあたって、Swift Compiler内部のSema関連の設計についてボトムアップに詳しく説明されてる。
10:59 PM
例えば、 Type, Type Declaration, Type Representationの3つの概念など、普通にSwiftコードを書いてる範囲だとなんとなく同じような感じだけど、コンパイラ内部ではどう区別・整理されているか解説しているので、Swiftコードの見え方が変わると思います。
10:59 PM
Generic Parameter Type と Archetype Type の違いとか、コンパイラソースだけ読んでてもよくわからんあたりも解説されてる。
11:01 PM
Sema以外でもCompiler Driver と Compiler Frontendの関係とか、ビルドするときの依存情報の管理・差分ビルドの方法とか、Request Evaluator System の解説とか、いろいろ書いてあります。
11:01 PM
総じて、Swiftコンパイラ勉強するなら一番良い教科書になってると思うので、みんな読みましょう。
👀 6