Fun with Swift

“I don’t know where to start this,” Joe Armstrong blogs. “It started off as my post turkey festive season relaxation and just gets longer and longer.”

“I thought to myself ‘I’ll try and make a GUI in Swift using only emacs and the Swift REPL,'” Armstrong writes. “I Googled a bit (as one does these days) and found an amazing bit of code in Swift from the command line.”

“My immediate reaction was ‘Golly – Swift might just be usable’ and I was hooked. I’d also read that Swift was a functional language which again piqued my interest,” Armstrong writes. “In the next week or so I found that Swift was certainly not a pure functional language but that it was whole lot better than Objective-C.”

Much more, including code examples, in the full article here.

MacDailyNews Take: Put open-sourcing Swift on that list of Apple’s 2015 “hits” under CEO Tim Cook.

SEE ALSO:
Apple’s open source Swift will open the door for HomeKit – December 16, 2015
Apple has hugely ambitious plans for open-sourced Swift, and hints on what’s coming to iOS – December 15, 2015
After Apple open sources it, IBM puts Swift programming in the cloud – December 4, 2015
Apple officially releases Swift programming language as open source – December 3, 2015
Apple’s open-sourced Swift programming language could change everything – November 25, 2015
Apple’s Swift programming language could soon infiltrate data centers – November 24, 2015
Developers band together to create Mandarin Chinese translation of Apple’s Swift programming language – August 6, 2015
Apple’s Swift breaks into top 20 in dev language survey; bad news for Microsoft’s Visual Basic – July 2, 2015
Apple’s Swift: The future of enterprise app development – June 10, 2015
Apple previews iOS 9 for iPhone, iPad and iPod touch – June 8, 2015
Apple prepares for major enterprise push by making Macs, iPhones, iPads easier for IT to support – June 2, 2015
Apple+IBM: Enterprise apps go wearable on Apple Watch – May 24, 2015
Apple’s iOS continues to dominate the enterprise with 72 percent of all device activations – May 11, 2015

5 Comments

  1. The best explanation I’ve heard about the state of Swift was on John Gruber’s ‘The Talk Show’ when he interviewed Craig Federighi. It’s from December 14th.

    ‘HOW MANY FINGERS SHOULD THIS BABY HAVE?’, WITH SPECIAL GUESTS CRAIG FEDERIGHI AND JOHN SIRACUSA

    Generally: Swift still requires an Objective-C ‘wrapper’ to run. It’s NOT a finished language. One of the reasons Swift was made Open Source was to encourage new directions for developing the language. Another reason is to make Swift a universal programming language on many platforms, not just OS X, iOS, tvOS and watchOS. It’s got some growing to do.

  2. I am using Swift. It is alright. The problem is that Apple keeps changing it too rapidly. I remember reading the first Apple book on the language and by the time I got the Xcode to support it, the syntax had changed enough to get compiler errors doing simple things. Better than ObjC, not yet. With ObjC I can still get memory pointers. And the design patterns are consistent. With Swift the optional/unwrap system can get tricky and inconsistent from protocol to protocol. I guess in another year things will be peachy with Swift.

    1. Swift is still in the early stages of development, and has a lot of evolving to do. They haven’t even nailed down the ABI yet, and Swift 3 will presumably include many more syntactical and structural changes. The point is, Swift is being developed as a cross-platform AND server-side development tool and, thanks to being designed by a compiler guy, seems a bit strange or unintuitive (as a developer coming from C and C-style languages), but make perfect sense when you realize you will no longer need memory pointers, manual management of retain and release, or clunky, unintelligent virtual machines running garbage collection routines based on assumptions about what memory your program will or won’t need. Swift doesn’t need any of this overhead, because the way it is structured gives it that knowledge at compile time.

      What you end up with is an incredibly powerful, low-level language that can be written in a simple syntax that almost appears to be pseudo code. The barrier to entry will be lowered for new developers, while at the same time, the ability to write bad code and create an app that crashes will be significantly reduced.

      tl;dr
      Swift is a big win, but it will be a couple years until it is fully baked. It is being designed for the long-term, as the development language of the next 20+ years, just as C++ was.

Reader Feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.