How to get started with contributing to Swift as a beginner

Hi there!
I'm a new open-source contributor and I'm looking forward to contributing to Swift.
I'm comfortable with using and understanding Swift as the programming language for my projects and I have a good understanding of how the git & open-source ecosystem works.
But when it comes to contributing to Swift, I feel a bit lost and puzzled while going through the issues in the codebase and can't figure out how to start fixing the bugs and solving issues.
It'd be great to get help from someone in the community who can help me with kickstarting my contributions to Swift.
Thanks in advance.

Would you mind listing a few specific problems that prevented you from contributing?

Thanks!

Hey @Max_Desiatov !
Thank you for reverting back.
To mention a few, I get it super hard to find some beginner-friendly issues to work on, and with the existing ones, I feel overwhelmed to understand them and it always takes me a lot of time to even understand what the bug is and what a workaround would be.
Looking forward to getting help in finding some beginner friendly issues.

You could definitely checkout the mentorship program! You can read about people's experiences and how the program helped them with getting started here. But I think the program could definitely help you get started.
As far as finding issues, there are a couple of getting started docs in the repo that you can take a look as well:

2 Likes

To be completely honest, you'll not going to find beginner-friendly bugs because the topic itself not beginner-friendly. Unless you mean "compiler engineer beginner". I'd say you either need some background in how modern compilers work, or a good mentor. There are also great books on the topic, people with more experience than me can recommend some, I have the dragon book and I feel it's a good start, although, perhaps a bit outdated.

There's also a good getting started guide that will clarify things when it comes to project structure, dependencies, how to build, workflows etc.

But if you have no prior compiler-related experience, I'd say the best start is reading a bit on it. Otherwise some of the discussions/topics will feel like they're in a foreign language.

This depends on what kind of experience you have. If you feel comfortable with compiler engineering, but don't find bug reports helpful, maybe it's better for you to cooperate with someone pitching on the forums to implement a prototype for pitched functionality.

If you don't feel like compiler engineering is for you, the main repository still hosts a few interesting components, such as the Swift standard library, IDE support, and related utilities. Documentation in the repository needs improvements as well. And then, there's the compiler build system, which I personally find one of the toughest areas to develop and test. For the compiler's build system, in addition to some knowledge of Python, Bash, and CMake you'll need some understanding of how the existing build system is structured before you make meaningful changes to it.

The Swift project is not limited to just the swift repository, you may find SwiftPM, ArgumentParser, Swift NIO, DocC, Async Algorithms etc to be much more suitable for you. Have you tried contributing to those?

1 Like

Yes, I highly recommend trying to contribute to the Package Manager first, as it's mostly written in Swift, is an integral part of the toolchain, and the committers are very responsive- some of my earliest pulls were merged in SPM. I see 19 issues there marked for beginners, for example, here is one I've long wanted.

Pick an issue that interests you and it will help to look at how similar features were implemented. The great thing about modern revision control is that you can look at just a bundle of changes for how a particular feature was implemented in a pull request or git commit, which saves you time looking through a lot of unrelated source. Use it, and feel free to ask questions on your chosen github issue, pinging me or the others in that particular thread.

1 Like

Thank you so much @Buttaface .
That's great information I was looking forward to. I'd start with SPM and will surely get back to you whenever I face some problems while working on an issue.
Thank you, once again.

Thank you Max for the information. I'd look around and explore other projects as well. Thank you for the tips and information.

1 Like

Just to remind everyone: the standard library is written in Swift and doesn’t require compiler knowledge!

2 Likes

Thank you @valentinradu for the tips and information.
I'm more than excited to learn and explore compilers and compiler design.
Thank you, once again!

Oh okay!
Thanks, @David_Smith for letting me know about that.