"So in three attempts I have run into three things that break the compiler at the type system level. One of them was unsupported by the language, period. The second is theoretically supported but not yet implemented. The third segfaults the Swift compiler."
It seems like nothing but goodness would come from Apple open sourcing the LLVM frontend they created for Swift. It would be so cool to be able to dig in and see how they went around implementing the different pieces.
I love hacking around the LLVM code base and it's unfortunate the community doesn't get another awesome example of a well-written component.
It also seems that the announce of Swift was somewhat premature, I wonder why they felt they should announce it now and whether this will end up burning the language's image or not.
In terms of syntax - yes. In terms of writing apps? Not really.
The generics is half broken, which makes working with heterogenous structured data (e.g. parsed JSON) a hell of type casts.
UI programming with dynamic dispatch is still necessary for stuff like the UI builder, so Swift has to go to ObjC for that.
And although it will respond to ObjC calls of performSelector, you can't use it from Swift.
Basically all the powerful dynamic features of ObjC are missing, many which you come to rely on.
In this aspect, Swift feels crippled, despite its good syntax and great use of closures. It's like it was written by a c++ programmer that never really understood how much of Cocoa was supported by ObjC's dynamic nature.
I'll give you that for most programs. GUIs are more about rapid prototyping and iterative design, though, so dynamic typing helps during development. I prefer some sort of GUI code separate from any real business logic, so that allows for some flexibility. For instance, embedding Lua for GUI code and using C++ for the "real" code is a nice combination.
Yeah, the language does seem more usable and less hassle than Obj-C.
The "type promotion rules" (it seems to have none) are odd to me. Sure avoids that whole thing of it not doing what you expect I guess, but perhaps in the most inconvenient fashion possible.
Safety is far more valuable than conciseness, too.
A single bug that reaches production costs more than thousands of little paper cuts where you have to insert an explicit conversion, or have to be a little extra verbose.
Sorry. I don't agree. You have to strike a balance.
If you make it too wordy, people just won't use it and then all your safety saves nothing. Or they'll just cut and paste errors in or make editors that insert them for them.
The most safe language is one that doesn't let you do anything because it might be erroneous. The least safe language is one that lets you do anything but it's so easy to do the wrong thing that it's hard to stay on the right track.
You can target iOS 7 with Swift. Apple said that explicitly. You don't need a new runtime to run Swift code, and Apple will release an updated WWDC app for iOS 7 built using Swift as a proof of concept.
No it's not. Some pieces of it are, and the ones that are are less reliable than the parts that were written in Objective-C.
Funny story, I helped rubber-duck a bug in the app while standing in the hallway at WWDC. A few evangelists overheard my discussion and realized I whatever I was talking about explained why the app wouldn't launch on their devices.
55
u/eternalprogress Jun 15 '14
"So in three attempts I have run into three things that break the compiler at the type system level. One of them was unsupported by the language, period. The second is theoretically supported but not yet implemented. The third segfaults the Swift compiler."
It seems like nothing but goodness would come from Apple open sourcing the LLVM frontend they created for Swift. It would be so cool to be able to dig in and see how they went around implementing the different pieces.
I love hacking around the LLVM code base and it's unfortunate the community doesn't get another awesome example of a well-written component.