My Google Summer of Code 2022 project mainly focused on rewriting parts of the SwiftSyntax
library using its own SwiftSyntaxBuilder
DSL, more specifically, porting the gyb templates in SwiftSyntaxBuilder
to type-safe Swift code, written using the library itself. During this bootstrapping process, many improvements to the DSL were added, inconveniences in the (quite large) API surface fixed and thoroughly tested. The result is a robust and ergonomic API for generating Swift code that has proven to be useful in the context of a medium-sized codebase.
The first step was to set up the build infrastructure. In particular this required adding a new target that, when executed, produced the generated Swift files in SwiftSyntaxBuilder/generated
:
flowchart LR