Background infos about Swift compilation for novice

Hello! In the last times there were some topics about performance in Swift. The discussion is huge, but unfortunately for someone like me, who never had a deeper look to how code is getting compiled and executed, those things are sometimes very hard to understand. I really would like to understand more about questions like:

  • How exactly is a compiler (especially the Swift compiler) working?
  • How can I influence the compiler (for example I recently found out about inlinable code)?
  • How does memory safety work and with which costs does that come? How works memory management (allocation and deallocation, stack and heap)?
  • What are the detailed differences between pass by value and pass by reference? What are the effects for performance? How are other languages doing this and what are the advantages and disadvantages?

That are only a few questions I remember the most, but there are a lot more. Therefore I wanted to ask, if there are some Swift specific resources (the Swift docs unfortunately don't go deeper, they already presume some background information)... Can someone maybe suggest a good actual book about compiler?

1 Like

Outside of what's currently available under the docs directory in the repository, @typesanitizer has been working on an overview of how the compiler works, but it's not finished yet.

2 Likes
Terms of Service

Privacy Policy

Cookie Policy