Announcing SyntaxKit

I love the work the community has done to use DSLs to create convenient ways of expressing ideas. I've done my own work with Swift Packages and have always felt SwiftSyntax could be simplified with a DSL. Unfortunately SwiftSyntax's API has always seemed rather difficult to grasp.

However a new tool, which recognizes patterns and understands code, has made it easier and more within grasp at building a DSL for generating Swift code. Maybe you've heard of it... AI (LLMs).

Using a combination of LLMs, I indexed the documentation of the Swift Language and the Swift Syntax API and then built examples of how I want the DSL to look like and the code I want it to generate. Over several iterations we have an incomplete yet rigorous code base to build off of.

Introducing SyntaxKit!

It is a work-in-progress of course but it's slowly coming together and I've even included an example on how to use for creating macros.

I would love you feedback, comments, and thoughts as I continue to move forward on this project.

4 Likes