Use SwiftSyntax itself to generate SwiftSyntax’s source code

Hi Swift Community Members,

My name is Jingbin Yu and I am currently an undergraduate student majoring in Computer Science at Miami University. I am interested in participating in GSoC 2022 for Swift on the project "Use SwiftSyntax itself to generate SwiftSyntax’s source code." I have proficiency in Swift and has played with swift compiler before. The reason why I choose this project is that I am interested in learning more about how compilers work, especially how code is parsed and processed within the compiler. As I have learned from the GitHub repo, one aspect of SwiftSyntax is that it can help programs written in Swift to process Swift code, which aligns with my interest. For this project, I know that it will be a chance for me to dig into the details of understanding the internal representation of Swift code in the compiler, which is definitely what I would like to learn more about. Thus, I want to choose to work on this project for GSoC 2022.

To demonstrate my Swift proficiency, here is an iOS app project I did with my friend:GitHub - LiaoGuoYin/LNTU-iOS: An elegant iOS App for LNTU

Also, here is the backend of the aforementioned iOS app written in Python, which can demonstrate my exposure to programming in Python:

Last but not least, here is my GitHub page:

Thank you and please let me know what I need to do for this project.

Sincerely,
Jingbin Yu

@ahoppen

4 Likes

Hello @wilsony,

Thanks for your interest in the GSoC topic. To familiarize yourself with the documentation of SwiftSyntax at https://github.com/apple/swift-syntax and in particular play around with the example to generate source code using SwiftSyntaxBuilder (swift-syntax/CodeGenerationUsingSwiftSyntaxBuilder.swift at main · apple/swift-syntax · GitHub).

I also think that you misunderstood the project idea we prosed. The idea is about using source generation to generate SwiftSyntaxBuilder, which is a library to generate Swift source code, it doesn’t have tight integration with the compiler and doesn’t share the same internal representation that the compiler is using. You are, of course, welcome to propose your own ideas if you are more interested to work on the compiler side.

– Alex

1 Like

Thank you for your clarification, Alex. I am still interested in this project. I'll go ahead and familiarize myself with the code.

Thank you again.

Sincerely,
Jingbin Yu

1 Like