Swift is a new and promising programming language introduced by Apple during the summer of 2014. In this interview we speak with Maxim Medvedev
about Swift support in AppCode, our IDE for iOS/OS X developers. Maxim joined the AppCode team in summer and drives the Swift development at present. AppCode 3.1 is going to be released later this year with many intelligent features that will help you start using the new language.
Hello Maxim and thank you for taking the time to speak with us. Can you tell us a bit about yourself and your background?
Hi. I graduated from Software Engineering Department of Saint-Petersburg State University, and thus met a lot of my future colleagues there. Within the Mathematics & Mechanics Faculty were professors from JetBrains so it’s no surprise that I joined the company as a student and got started working on Groovy support. This summer I switched to Swift, which I find very similar to Groovy in terms of IDE support. Both languages have type inference, closures, traits/extensions and high-order functions.
Why have you decided to work on Swift support with the AppCode team?
For me it’s a super exciting experience to support a language from the very beginning: from a simple parser to smart and complicated refactorings. So I took my chance to make the journey with the AppCode team, trying to make progress quickly but with no loss in quality.
What benefits do you see in Swift for iOS developers?
Swift is a new language, but at the same time it follows all modern programming trends and principles. If you have followed the changes in Java or C# over the years, you’ll be able to easily begin programming for iOS/OS X. You will at least know what to expect. For example, Swift brings strong typization to developers that not only reduces the amount of typed characters, but also assists with the bug catching, long-term code support and code performance.
There are some controversial points as well, for example, meaningful whitespaces around an operator that is regulated by the complicated system of rules, or the lack of the exception handling mechanism.
People say, “JetBrains is cooking parsers for breakfast.” Was it so easy for you?
Swift grammar is quite large and comprehensive, so something was left for the lunch as well =) . But I can’t say it was a super complicated task to build a parser having a language’s syntax description. I’ve used an open source tool – Grammar Kit (available as a plugin for IntelliJ IDEA), developed by my colleague from the 0xDBE team (0xDBE is a new IDE for DBAs and SQL Developers). Greg Shrago created this tool while solving a problem with many SQL dialects that need to be parsed there. And I used it for Swift. It made my ‘cooking’ job easier.
Have you met any interesting challenges when developing Swift support that you’d like to share?
The most challenging task for me was Swift’s custom operators with custom precedence and associativity values. I have never met something like this before. To cover this case I finally implemented a two-level parser. First, it handles all the expressions without taking into consideration operators characteristics; and only then it builds the actual binary tree and calculates operator’s type, checks syntax and semantics errors.
What are the future plans in terms of Swift?
Before the AppCode 3.1 release we need to make the current Swift feature set stable: completion, code formatting, find usages, navigation options, Rename refactoring. Some interesting features are in development as well, but I won’t speak about them now because I’m not sure they’ll be ready before 3.1. We’ll further continue work on Swift support and provide you with more updates in future.
Thank you for your time it has been a pleasure. If you have questions that you would like to ask Maxim, please use the comment section below.
To try the latest AppCode 3.1 EAP build with Swift support visit our EAP page.
Yours as always,
The AppCode Team