Seeking Insights on Refactoring sourcekitd to Use Swift Concurrency (GSoC 2025)

Hi everyone,

I’m planning to participate in Google Summer of Code 2025 with the Swift project “Refactor sourcekitd to use Swift Concurrency.” I’ve set up the project and have been reading through the source code to understand it better.

The goal of this project is to refactor sourcekitd’s request handling and AST manager using Swift Concurrency, improving data race safety and maintainability. Currently, sourcekitd is implemented in C++.

I have previous GSoC experience with MIT App Inventor, where I built key components for iOS, so I’m familiar with contributing to large open-source projects. Now, I’m excited to shift my focus towards Swift’s low-level internals.

Areas I’d Love Insights On:

  1. Challenges in transitioning from C++ to Swift Concurrency: Are there any existing patterns or lessons learned from similar efforts?

  2. Potential design considerations: What would be the best way to structure concurrency in sourcekitd to ensure performance and safety?

  3. Testing & benchmarking: How should I approach testing the correctness and performance impact of these changes?

If anyone has insights, past experiences, or suggestions on where to start, I’d really appreciate your input! Also, if you’re working on similar areas, I’d love to connect and discuss.

Looking forward to learning from the community!

Thanks!

2 Likes

Hi @dhruvshrivastava18,

Great to hear that you are interested in the project.

I am not aware of any similar efforts to migrate from C++ to Swift Concurrency directly, but we have an ongoing effort to use the new Swift Parser (that’s part of swift-syntax) in the compiler, called ASTGen that probably faces similar challenges.

I don’t think there’s anything special to consider here. Switching to Swift Concurrency should give us data-race safety by default because that’s how Swift Concurrency was designed.

We have a fairly decently sized test suite for sourcekitd and SourceKit-LSP’s tests also use sourcekitd under the hood. I would expect that these tests should give us very considerable coverage. Maybe we can add a few more tests as we encounter them.

– Alex

3 Likes