Night tweets recap. Swift compilation time is very slow sometimes. Especially when you’re going to use
reduce, … and compiler must find out types & friends. It drives me
crazy and I’m forced to replace almost all my
map calls with
for ... in loops.
I simply do not want to wait 14s to compile simple stuff like this one:
… to Other Swift Flags in Swift Compiler – Custom Flags section.
Build your project and inspect build log.
Now you have an idea what part of code causes slow compilation time. Use it in rdar
and temporarily modify your code until all reported issues will be resolved. The best way to handle
I did post it to Twitter (with typo, it’s not
but it should be
-Xfrontend) and Marcin did ask
where I get this one. I replied that from Joe Pamer’s tweet
and then realized what if there are more flags like this one.
Here comes my favorite Hopper Disassembler, which helps me to find
flag. I tried it and here’re the outputs:
Interesting flags there. For example
-enable-throw-without-try, which allows you to compile following code …
… without Call can throw but is not marked with ‘try’ error. Maybe this one will make it to the final
Xcode 7 & Swift 2? Who knows, better not. Code is shorter, yes, but I like it (despite my first reaction,
didn’t like it). More verbose, but it says here it can throw, which makes bug hunting, … easier.
It also reveals some features they’re working on, like:
-enable-experimental-patterns(Enable experimental ‘switch’ pattern matching features),
-enable-experimental-unavailable-as-optional(Enable experimental treat unavailable symbols as optional).
And many more. Didn’t have time to inspect them all. Let me know if you find something interesting.
These flags are not hidden just for fun. Remember, they’re experimental, to test features they’re working
on, to help them with debugging, etc.
Don’t use them in production code! Just play with them.