Does Swift has a (semi) formal language specification?

Unfortunately, TSPL seems to be out of date and it is not clear if there is an intention to actively maintain it - there are literally examples that should have been updated years ago and new parts of the language are described very superficially or not described at all (~Copyable for example). To make it worse, there is even no proper search function or subject index at the moment of writing this post.

I understand that writing or just maintaining a book requires a significant effort (even though it has probably become much easier since LLMs became a thing) - however, what is the adequate place to look for the language description?

For example, what is the place to look for expected compiler behavior? How to check whether there is a bug in the compiler besides asking on the forums? Make no mistake, people on this forums are helpful and often quick to answer, but forums are not supposed to replace documentation. Not to mention that many questions could be avoided, if there was accessible and up to date documentation.

Where do people look when implementing the compiler to see the expected behavior? Is there some (even semi formal) document specifying the language? Or is it just some folk lore passed between the compiler maintainers/contributors?

2 Likes

I think evolution proposals play a role of the specification. At least to some extent. But each evolution proposal describes an incremental changes, and later proposals can refine earlier proposals. So it can be hard to understand the latest state of things based on evolution proposals.

3 Likes