Hey! I’m Janat, an undergraduate computer science student, and I had a great opportunity to participate in the 2024 Swift Mentorship Program with my mentor, @xedin. The experience was immensely rewarding, and I’m excited to share a brief reflection in the hopes of inspiring other students—or anyone interested in contributing to the Swift compiler—to take the leap into open-source development!
How I Decided What to Work On
When I started, I had no experience with Swift but had a background in compilers from building toy languages and was comfortable with C/C++. Rather than jumping between random bug fixes, I wanted to claim a specific niche and develop deep familiarity with one feature.
While exploring past 2024 GSoC (Google Summer of Code) projects, I found one on "Implementing Property Wrappers with Init Accessors and Macros." It focused on a niche feature, was unclaimed, and aligned with my mentor's expertise. While completing it in 12 weeks was unlikely, I saw it as a chance to learn and make progress. My mentor suggested I start with bug fixes related to property wrappers to build familiarity with the concepts and compiler pipeline before I dive into trying to reimplment the feature.
Accomplishments
My proudest accomplishment was getting my first PR merged that resolved a crash related to property wrappers and their mutability! I was ecstatic, and it gave me the confidence to keep on solving more issues and bugs. By the end of the program, I had a total of 3 PRs merged, each teaching me something new about the codebase and its many moving parts.
Challenges
My toughest challenge was... building the Swift compiler on my machine . I started on a Windows machine (WSL) with only 16GB of soldered RAM, which led to painfully slow builds (the longest taking 9 hours, WSL overhead is to partly blame as well I think). Each attempt ended with linker errors, forcing me to tweak flags, reduce build jobs, and restart the process — only to face the same result and start over. My mentor provided unwavering support, suggesting workarounds like parallelizing builds and adjusting more build flags, but nothing worked. At one point, I genuinely worried I wouldn’t be able to contribute at all and that I was wasting both of our time, as this struggle dragged on for a month...
Luckily, however, while expressing my frustrations to my sister about my worries that I wouldn’t be able to contribute, she kindly offered to let me borrow her Mac Studio. Everything built flawlessly on the Mac. While I lost a month of the mentorship battling build errors, I was determined to make the most of the remaining weeks.
When I finally had my environment properly set up, navigating the swift codebase was the next step. It was daunting at first, but my prior experience tinkering with compilers and my mentor’s consistent guidance made it far more manageable. To start, I was given a clear overview of key files and directories, helping me focus on the most relevant parts of the codebase.
Biggest Takeaway
The most important lesson I learned was the value of being aware of and utilizing the available compiler debugging tools. These tools proved invaluable, especially when tracing errors across the Sema phase and constraint system.
With my mentor's guidance, I became much more proficient in using LLDB and setting effective breakpoints for debugging. Pavel would often share his screen, demonstrating his approach while introducing me to essential LLDB commands like bt
(backtrace) to trace function calls and .dump()
to inspect internal states. Observing how an experienced developer approached complex problems gave me valuable insights into how to tackle them effectively and which tools to prioritize for different debugging scenarios.
What’s Next?
Although the mentorship has ended, I’m continuing to explore the reimplementation of property wrappers — the GSoC project that initially caught my interest. It’s an ambitious goal, but I’ve already started tinkering with it and am still in touch with my mentor who graciously agreed to continue to help provide guidance!
Final Thoughts
I’m incredibly grateful to have been part of this program. Reflecting on everything I learned, I realize just how impactful having a mentor was — what I achieved in this short time would have taken far longer on my own.
Special thanks to my mentor @xedin whose support, patience, and thoughtful guidance made all the difference . He challenged me to think critically about the design of my solutions and shared best practices that elevated my approach to development.
A heartfelt thank you as well to everyone who helped organize this program and made this experience possible!