138 iPS Open Source Swift
Show Notes
iOS Remote Conf will be from April 13th - April 15th. Get your ticket (or submit a CFP!)
Check out Freelance Remote Conf!
Get the top 10 episodes of iPhreaks! Text IPHREAKS to 7656263464.
02:23 - Swift is Open Source: Why?
05:59 - Running Swift on Linux and Raspberry Pi
08:40 - Benefits of Running Swift as an Embedded Program
10:50 - Is this a different Swift?
11:35 - Cross-Platform Approaches
13:27 - What is included in Open Source Swift?
20:38 - Building and Installation
21:30 - IDE Integration; Opening Things Up with Xcode
22:26 - Developing on GitHub
24:56 - Downsides to Open Sourcing Swift ?
26:47 - Benefits of Swift as a Server Side Language
28:01 - Linux Support
29:21 - Are we going to see Apple support other efforts?
Picks
Alexandros Salazar: The Ghost of Swift Bugs Future (Jaim)
Andrew Madsen: Swift on Raspberry Pi (Andrew)
Swift Sandbox Open Source Newsletter (Andrew)
IBM Swift Sandbox (Andrew)
Nike+ Running (Chuck)
Run 10k (Chuck)
Pebble Time Steel (Chuck)
AfterShokz Bluez 2 Headphones (Chuck)
MyFitnessPal (Chuck)
Andrew Madsen: Swift on Raspberry Pi (Andrew)
Swift Sandbox Open Source Newsletter (Andrew)
IBM Swift Sandbox (Andrew)
Nike+ Running (Chuck)
Run 10k (Chuck)
Pebble Time Steel (Chuck)
AfterShokz Bluez 2 Headphones (Chuck)
MyFitnessPal (Chuck)
Transcript
[This episode is sponsored by Hired.com. Every week on Hired, they run an auction where over a thousand tech companies in San Francisco, New York and L.A. bid on iOS developers, providing them with salary and equity upfront. The average iOS developer gets an average of 5-15 introductory offers and an average salary offer of $130,000/year. Users can either accept an offer and go right into interviewing with a company or deny them without any continuing obligations. It’s totally free for users, and when you're hired they also give you a $2,000 signing bonus as a thank you for using them. But if you use the iPhreaks link, you’ll get a $4,000 bonus onset. Finally, if you're not looking for a job but know someone who is, you can refer them on Hired and get a $1,337 bonus as thanks after the job. Go sign up at Hired.com/iphreaks]
CHUCK:
Hey everybody and welcome to episode 138 of the iPhreaks Show. This week on our panel we have Andrew Madsen.
ANDREW:
Hello, from Salt Lake City.
CHUCK:
Jaim Zuber.
JAIM:
Hello, from Minneapolis.
CHUCK:
I’m Charles Max Wood from Devchat.tv. Couple of quick notes. First one is iOS Remote Conf is coming up in April. Call for proposals is going to be open probably until some time in March or end of February. So if you would like to speak, go to iOSRemoteConf.com and submit a talk. I plan to ask all of our current and past panelists and several of our past guests but I usually have about half the conference open. So if you're interested in that, go check it out.
Also of note, in February, we’re doing Freelance Remote Conf. All of the speaking spots on that are pretty much full but you can go sign up. So if you’re interested in that, then go check it out.
The other item of note is that I have a new text in number that you can use to get on our list. So if you would like to get a top 10 downloaded episodes of iPhreaks, you can do that. Text in iPhreaks to 7656 coding numbers’ at 7656 263 464. If you text the word in iPhreaks, then it’ll ask you for your email address and then you can get on the list where you’ll get notified of those ten episodes, then you’ll also get notified about episodes going forward in your email so then you can find all the links to all of our picks and all the stuff that we’ve discussed and things like that.
Anyway, that was a long winded intro. Let’s go ahead and talks about Swift being open source. Now this is something that Andrew mentioned and I thought it was interesting that we hadn’t talked about it yet. When did they announce it was open source? I remember hearing the announcement.
It was toward the end of last but I don’t remember exactly when.
ANDREW:
December 5th maybe? 4th or 5th, something like that. First week of December 2015. It’s been just about a month ago.
CHUCK:
Yeah, in fact I just did a quick Google search. The post at developer.apple.com is – it says December 3rd. Swift is now open source. Today, Apple launched the open source Swift community.
So this is really interesting. Apple, it seems like they like to have their own little playground, and this kind of opens up the playground to a lot more people. That was something that I thought was interesting. Are there reasons why you guys think that they might have wanted to open source Swift?
ANDREW:
My own thinking on this – I don’t really know for sure except that there have been a few examples of Apple open sourcing things with pretty good success. I think the biggest one of those is WebKit which kind of [inaudible] – that was an existing open source project that they forked from KDE’s rendering engine. But anyway, WebKit has been a big success. That powers the browsers – the most popular browsers in the world now including Chrome, Safari and the built in browsers on both iOS and Android.
But I think really, my guess is that it was sort of team. The Swift team wanted to open source it for whatever their reasons are; I think it was motivated by their desire to do that.
CHUCK:
Does it being open source benefit Apple though? It seems like it would in a sense that they can get more brilliant minds contributing to the language; people can do more things with Swift on other platforms. But overall though, it seems like benefits of the Swift ecosystem to those directly benefit Apple as well.
ANDREW:
I think there are two big benefits to Apple, really. One is they do get outside contribution and more people working on making Swift good and on implementing features, charting the direction of the language and they’re already doing that. I would like to talk more about that but then as far as Swift from other platforms goes, I think Apple have a language that they essentially control, at least they’re setting the agenda for it and they’re setting the future vision for it. Having that language become popular outside of Apple’s own platforms is definitely a good thing for Apple.
It makes it – there will likely be a wider pool of people who can develop for Apple’s platforms and it also will make it so that existing Apple platform developers can do more. I’m excited to possibly be able to write web apps, web backend apps in Swift without having to learn another language that I don’t use for – don’t already use for something.
I think both of those things can be beneficial to Apple.
CHUCK:
Yeah, somebody’s going to write a web server in Swift and they’re going to come up with Swift on Swails.
ANDREW:
Yeah. Somebody already – there are actually a few that are already out there but I think the one that’s gotten the most press is called Perfect.
CHUCK:
Oh, there’s already one out there. That’s awesome.
ANDREW:
Yeah, and it’s funny because Perfect – I’ve seen people complaining about the name, like it’s typical Apple – arrogant name or whatever. I don’t know how they came up with the name but it actually looks pretty cool.
CHUCK:
You know what they say about all the other web servers, right? None of them are perfect.
ANDREW:
Yeah. Well, now we have one.
CHUCK:
I’m sure somebody left that joke somewhere. Anyway, so yeah, did you say you would run this on Linux?
ANDREW:
Well, Apple has downloadable packages for Linux, for Ubuntu and I downloaded that the first day it was out. That was fun; it was really easy to get going with. But one thing I’ve been excited about since Apple announced that Swift would be open-sourced back in the summer at WWDC was the possibility of running Swift on a Raspberry Pi or similar cheap, little, almost embedded device like that. It didn’t run; out of the box, the open source release would not build on an arm processor which is what the Raspberry Pi uses. But pretty quickly, some people got it going and I took advantage of that and got it running on my Raspberry Pi and tweeted about it and surprisingly was surprised at the reaction I got.
Retweeted by for everybody under the sun including the Swift Twitter account and Chris Lattner so that was kind of cool.
JAIM:
So are you running Swift apps on a Raspberry Pi or are you actually having the compiler run on a Raspberry Pi? What’s involved with that?
ANDREW:
Well both. The compiler is running on the Raspberry Pi so you could actually use – you could use the Raspberry Pi as your development machine which is maybe not ideal. It’s pretty slow but it’s certainly possible. But the compiler running there means that you could compile your Swift to run on the Raspberry Pi. That’s pretty cool for me because then you can write – there’s a lot of people that are using the Raspberry Pi as the brains of robots or for home automation or all kinds of different stuff. Being able to do those things in Swift is pretty appealing to me.
JAIM:
Okay. So Raspberry Pi in the embedded world is still pretty beefy. When I was doing embedded work, we ran code on a device that just wouldn’t run a compiler on. People doing any crosscompilation where you can compile it on your desktop or run it for – run the app on different [inaudible] level machine.
ANDREW:
I’ve seen some people talking about wanting to get that setup. I have not seen anyone that’s actually got a cross-compiler set up. The guy who got Swift compiler to build for the Raspberry Pi, specifically for the Raspberry Pi 1, he was talking about wanting to do that because it took days to build the compiler on a Raspberry Pi which is how he had to do it.
CHUCK:
Oh wow.
ANDREW:
Because they’re pretty slow. So I think people are working on it but nobody has gotten it going yet.
That’s my understanding anyway.
JAIM:
Okay.
ANDREW:
It sort of already exist because the Swift compiler running on your Mac compiles Swift for the arm in your iOS device. But the open source Swift right now, as far as I know, does not support iOS devices as a target.
JAIM:
Right on. Okay.
CHUCK:
That’s really interesting.
JAIM:
So what are the benefits of running Swift as an embedded program?
ANDREW:
For me, personally, it’s that I already know Swift and I don’t have to learn C++ or Python – a lot of people use Python on a Raspberry Pi or something like that. I think Apple’s going to be [inaudible] is that Swift is just on its own merits, not just because it’s part of the developer ecosystem around Apple. But just on its own merits, I think they think they think it’s a really good language and they want people to use it for all kinds of things. I tend to agree; al languages have strengths and weaknesses but I think Swift’s a pretty nice language to work in.
JAIM:
Yeah definitely. When you look at the different languages you can use for embedded work, low level stuff, C++ – that’s been the gold standard for a long time. Python, that’s definitely an option. People consider using Go; it’s got more modern language features like Python but it’s compiled, and Swift fits in there nicely.
One thing that I found intriguing about Swift for, say, Robotics is that unlike Go, it’s not a garbage collected language. We’ve got Arc so we can predict when things would get cleaned up which makes it nice. So if you’ve got robotics with real-time component, like if you're using some garbage collected language like Go, you don’t know when the garbage collection are going to fire off; you just don’t have control over it. It happens when it happens, and usually, when you really don’t want it to happen and it causes problems.
But with Swift, you have a little more control, so I think it’s a really intriguing language for lower level programming. Plus you get a lot of niceties of a more modern language versus doing things in C.
CHUCK:
And there’s no reason why some of the other popular applications for programming languages like web development or – it already does desktop and mobile development. Then we’re talking about embedded, but there’s no reason why you couldn’t do any and all of that with Swift. There’s nothing in there that precludes those.
JAIM:
Yeah. I think Swift is a good general purpose language; it’s just that it’s been mobile. For a year and a half, it’s been a thing.
CHUCK:
Now, one thing that was interesting, Andrew, that you said was this Swift is not the Swift – or I guess you can’t build it as a target for iOS. Is that because it’s a closed system that already runs Swift on its runtime or is this a different Swift?
ANDREW:
It’s not a different Swift. I don’t really know. I haven’t really thought deeply about this but I think basically, the end result is it doesn’t really matter because why do you care about using the open source Swift compiler when you’ve already got Xcode that can build Swift for an iOS device.
JAIM:
And this year, Richard Stallman.
ANDREW:
Yeah, but if you're Richard Stallman, you would know sooner, own an iPhone and fly to the moon.
JAIM:
Yeah, [inaudible] doesn’t have an iPhone. Good point. [Chuckles]
CHUCK:
I guess the other question that I have though is if it’s open source, is there any reason why you couldn’t build apps in Swift that run on something like an Android device? We see all these crossplatform stuff with different JavaScript systems, be it NativeScript or React Native or PhoneGap, could you conceivably write an app that runs on both in Swift?
ANDREW:
Yeah, absolutely. I don’t know if anyone’s actually gotten the Swift compiler to create Android executables yet but I’ve seen people chattering about it. I guarantee that somebody’s going to do that. After all, Android is fundamentally Linux so I’m sure it’s quite doable.
CHUCK:
I guess that’s true. I didn’t really think about that. But all those apps are written in Java so would it have to compile to a Java bytecode?
ANDREW:
No. You normally use Android or Java for Android development, but they also – you can also do C in C++.
CHUCK:
Oh okay.
ANDREW:
For Android anyway.
CHUCK:
So LOVM compiled stuff could conceivably compiled something that we’re on?
ANDREW:
Yeah, right. And there’s no restriction on Google’s part. There used to be a restriction by Apple that you could not, for a little while, you couldn’t write an iOS app that was compiled from a language other than Objective-C or C++. There was a big outcry and they got rid of that but I don’t think Android has ever had that kind of restriction. I’m sure it’s coming and I think that’s pretty cool because then instead of writing your common denominator cross-platform libraries in C or C++ like you have to do now, Swift becomes viable for that and that’s pretty nice.
Again, that’s a benefit to Apple because that means people are going to develop for iOS first or [inaudible] not even a better reason to.
CHUCK:
Yup.
JAIM:
So Chuck, your raised a good point about having cross-platform approach, maybe similar to Xamarin with C#, doing that with Swift. One problem, and I’m not sure – what is actually included in the Swift open source? Are any of the foundation classes, any of the UIkit things that we’re used to using, is any of that available or are we on our own if we want to write a UI stuff?
ANDREW:
I thought we should talk about that. I thought just covering what all is covered by open source with would be good. So open source Swift consist of Swift compiler obviously, and that also includes the Swift REPL and LLDB, and of course the Swift compiler’s built on LLVM. It also includes the Swift standard library.
But something that was kind of surprising to a lot of people is that – I had heard people talking about this before the open source really just – just acting like it was a foregone conclusion that Foundation would not be available, the Foundation, of course, being an Objective-C library. People just assume that would not be part of it, but actually part of the open source release is a reimplementation of Foundation in Swift and it open source. So that’s pretty cool because that means that a lot of those APIs that – not UIkit or AppKit but the low level APIs that are in Foundation that are really useful for doing all kinds of stuff are part of the Swift open source release. [Crosstalk]
Yeah, so that’s – to me, that’s a pretty big deal. It means that you’re not stuck either writing stuff with the Swift standard library which is pretty limited. It’s like arrays and strings and dictionaries and low level operations on those but nothing beyond that. But we’re getting the threading code and NSOperation and networking code and XML parsing and JSON parsing and all that stuff that’s in Foundation so that’s pretty cool.
Now the caveat is that if you go look at Foundation right now, the open source Foundation, it’s pretty unfinished. There’s a lot of stuff that’s just stubbed out and then marked as unimplemented. Obviously, this is all just a work in progress and Apple actually open source things fairly early in the development cycle because they wanted the community to be involved. It also means that there’s certainly a chance for people to jump in and contribute.
JAIM:
So when you get to things like operations and networking, if that’s included in the open source, wouldn’t that have to be re-implemented for different architectures?
ANDREW:
Yeah. So they’re implementing it on top of Core Foundation because Core Foundation is already an existing, partly open source C library and I think they’re – I don’t know for sure but they may be open sourcing more of that.
I’m not exactly sure what’s already there. I think some stuff already runs on Windows which may mean that they’ve already abstracted it fairly well, because they’re using it in iTunes for example. I don’t know; I’m sort of speculating here but I’m sure there’s some work that needs to be done so that – for support for both Linux and Mac, and hopefully in the future, other platforms.
But they’ve promised that Swift foundation will – they’re going to support OS 10 and Linux as targets and then of course, they’ll accept contributions to support other platforms.
Also included in the open source release is something that – nobody knew anything about until the big announcement which is the Swift package manager. I think that’s pretty exciting. That’s Apple’s answer to CocoaPods or you might say the Swift version of Ruby gems or NPM for Node or whatever. It’s a package manager for Swift and it’s the first time there has been an officially supported app-provided package manager for Objective-C or Swift.
Interestingly, they hired Max Howell who wrote Homebrew and Matt Thompson who everybody knows, to work on the package manager which is pretty cool. So it’s people that we already know and have a really strong background in open source and I think it’s pretty cool that they’re the ones working along with other people that are on the team.
CHUCK:
Do you see the package manager? You mentioned that it’s like CocoaPods. Do you see this at all taking over some of the stuff that winds up in CocoaPods?
ANDREW:
Yeah, actually [crosstalk].
CHUCK:
Or obsoleting it?
ANDREW:
The guys behind Co – I think both CocoaPods and Carthage guys said – definite the CocoaPods guys said that they are perfectly happy to have CocoaPods be obsoleted by the Swift package manager. Basically, they said they only ever – if they didn’t say this, they have implied that they only ever really wrote CocoaPods because there was no Apple-provided solution to that problem, and so they’re happy to not have to do that on their own now and Apple can have a real one.
I’ve actually seen some back and forth on the mailing list for the Swift package manager between guys from CocoaPods and the Apple team working on the package manager, sharing notes and helping each other and that’s pretty cool.
PJAIM:
So is the Swift package manager available now? Can we use it in our apps?
ANDREW:
It’s not integrated into Xcode so that makes it a lot harder to use for working on iOS app development or something, but it is available now. It’s quite alpha quality. It’s definitely unfinished and they’re definitely upfront about that. But the basics work; you can just tell that there are a lot of features on the road map that they want to implement that they want to implement that are not implemented yet. I’m sure there are bugs and stuff but I actually spent a few hours this week working on getting a library that I’ve written to work with the package manager. I figured out how it works and it’s pretty cool. It’s actually really easy to use and pretty nicely done.
JAIM:
So how does it compare to CocoaPods or Carthage?
ANDREW:
Carthage relies so much on Xcode for – Carthage, this whole thing you don’t have to do anything to support Carthage as long as you got an Xcode project that builds a framework. In some sense, there’s a little bit of difference in philosophy there. But compared to CocoaPods, I think it was refreshingly simple and easy to get going with.
In particular, to create a package, all you have to do is make sure you put your sources in a folder called ‘sources’ and then you – the equivalent of a pod spec is the package manifest file. That is actually a Swift file in the Swift package manager. You write your package manager, your package manifest or your package spec in Swift or in some subset of Swift anyway. You don’t actually have to give it very much information before you’ve got a package up and running. In fact, I think you can almost leave it blank except maybe having to give it a name. Then you just run Swift build and it will build your package.
If you want to use that package in an app, the difference between a package and an app for the Swift package manager is really simple. It’s just that if your project has a file called main.swift, then the package manager knows that it’s an app instead of a library. But you can declare dependencies in your package file and then run Swift build and the package manager will go out and fetch the dependencies and build them and link with them. It all works quite nicely.
But again, it’s not at all – right now, it’s just a command line thing and there’s not support for Xcode projects and no support in Xcode for it. I assume that that’s coming.
CHUCK:
I’m kind of digging through this a little bit. So you're saying that it’s not in Xcode and it’s not built-in or anything. So I’m assuming then that if you want to put this in your Mac, then – on Linux, I’m definitely assuming that you’re going to have to build it on your Linux machine. It sounds like there might be some binary packages that you can get through app or something but for your Mac, do you still have to go download it and install it?
ANDREW:
Yeah. Right now, you have to go download and install it. It’s really easy though. You download an installer file, run it and that’s that. The same is true for Linux assuming you're using Ubuntu 14.04, 15.05 or whatever the – 15.06, whatever the new release is.
For other platforms or other distributions of Linux, you do have to build it and it’s not – that can be easy or hard depending.
CHUCK:
Right. The other thing that I’m wondering though is it looks like they – on Swift.org, it also says that it includes – maybe it was on the announcement. It included something else that would help with IDE integration. Does this mean that they may be moving away from or opening things up with Xcode?
ANDREW:
I know what you're talking about. I read that, to mean that they’re – basically, they’re saying that they are designing Swift package manager with that in mind that people will want to integrate it into an IDE so that an IDE can use the package manager. Further, I think that it is a pretty clear indication that they’re writing it for the one IDE that they care about which is Xcode. They haven’t said so officially but I would be surprised if Xcode does not include support for the package manager and the next major update or whatever.
One thing about open source Swift that I think is really interesting and unique for Apple is that it’s not a fake open source project. By fake, I mean like – a lot of people probably don’t even realize this, but Objective-C is open source and has been for a long time and continues to be. But like the Objective-c runtime, Apple’s Objective-C runtime is open source but they just dump the source code every so often. A new version of OS 10 will come out and six months later, they’ll finally get around to uploading a zip file of all the source.
There’s no way to contribute to it; there’s no way to file bugs against it openly. There’s no way to fork in and suggest changes or anything like that. It’s just here’s the source; do what you want to do with it.
With Swift, they are really going all in on open source. The whole thing is hosted on GitHub. Not only is it on GitHub, the GitHub version is like the real version of it. So even Apple engineers doing their normal work on it are doing that development on GitHub in the open.
They’re accepting pull requests from the community. They’re accepting bug reports from the community that are public. Bug reports; there’s a really active bunch of mailing lists for discussing future evolution of the language and proposals for changes and all that. They’ve already started – they’ve already accepted some proposals that came from outside Apple for changes to the language. To me, that’s pretty cool change for Apple and an interesting development. I don’t remember where I was going with that but anyway, on its own, it’s pretty cool.
JAIM:
It’s definitely nice to see them play in the open source ecosystem in GitHub. I forgot the name of the person – developer that had the pull request accepted by Apple. It’s probably going to end up with one of the picks but it’s cool to see that.
ANDREW:
Yeah. That was Erica Sadun. I hope I’m saying her last name right. She was the first person to get a proposal accepted. As I recall, her proposal was to remove the C-style syntax for four loops from the language. Anyway, she got that accepted, but I think there have been a few others since then.
They’ve actually merged in hundreds of pull requests although most of those are fixing typos and documentation. We shouldn’t say silly stuff because it’s important but it was obviously just, “Hey, I want to get a contribution in so I’m going to find the quickest, easiest thing I can do.” That’ll settle down in the middle, kind of mature. That’s like ‘first post’ on a new /.stories posted or something.
CHUCK:
So I keep looking at this and I definitely see some upsides for Apple. Are there any downsides to Apple open sourcing this for them or for the community?
ANDREW:
Well, those pull requests I talked about strike me somewhat of a downside. It was – I felt a little bad for the Swift team within hours of opening the whole thing up; they were just under a deluge of pull requests and they’re having to manage those. They’re having to triage them and figure out which ones are good, which ones are bad and test them and all that stuff. That’s certainly administrative burden that they didn’t really have before.
I also think that it’s, in some ways, maybe not the people on the Swift team but for Apple as a whole to – might be a bit of a hard change to be making changes and working on new features and things like that out in the open because they’ve traditionally been so secretive about everything and they still are secretive about their products. But it used to be that we had no idea what was coming in as far as development tools and language changes until we got to WWDC and here they are. This is – might be a little hard for them. I’m not really sure I know of other downsides. What do you guys think?
CHUCK:
The real danger that anyone else is going to see in this is just if they can’t put any trade secrets into Swift because it’s open source. But I don’t see why they would necessarily need to. You can put all of that into the runtime you have on your – or into your other libraries that get run against your devices so you wouldn’t have to.
ANDREW:
Right. I think the special sauce has always gone in AppKit and UIkit, Core Data and whatever else, and like I said, Objective-C should’ve been open source forever. That’s not actually a new thing.
CHUCK:
Yup.
JAIM:
So we talked a little bit about the Perfect library. I’m curious on what are the benefits of Swift as a server-side language. We talked a little bit about embedded in desktop and stuff. Have you looked at the library at all? Do you know how it maps to some of the other paradigms? You’ve got Ruby on Rails or like a Node thing. Do you know how it compares to any of those?
ANDREW:
I’m afraid I haven’t really looked at the web frameworks that are out there, particularly Perfect; there’s some other ones, too. Besides that, the only other web development framework that I have been able to really experience with it all is Node. Just off the top of my head, it seems like there are some pretty nice features in Swift that will be good for that stuff.
One thing I didn’t mention before is that libdispatch which is the name of the library that implements Grand Central Dispatch is also an important part of the Swift open source release. I had a hard time figuring out exactly what that means because libdispatch has actually been open source since forever, since it came out. But there’s some – I think the deal is Apple themselves are supporting it on Linux including the Swift enhancements or whatever for it, the Swift refinements.
JAIM:
So what this [inaudible] Linux are supported?
ANDREW:
It’s only Ubuntu that Apple is officially supporting with their own packages.
CHUCK:
Yeah, but if you can get all the dependencies on your distribution of Linux, it looks like it just compiles.
ANDREW:
Yeah, I don’t think that’s a major issue. I think that’s Apple saying, “Just to keep our lives easy, we’re going to restrict it to this one most popular distribution.” But I haven’t really spent a lot of time worrying about it because that’s the only distribution I run but I have a feeling people have already gotten it running on other distributions.
CHUCK:
Yeah, I think it’s only a matter of time before they have. Basically, somebody goes in and builds all the right – make targets and then packages them up so that you can just get the binaries.
ANDREW:
I actually just realized, I know that – what’s his name? I think I saw some pull request from Landon Fuller about adding support for FreeBSD. That’s at least one, not a Linux distribution but another OS that somebody’s worked on.
CHUCK:
Yeah, but FreeBSD or OpenBSD – anyway, the BSD core is what MacOS is built on so it shouldn’t be a terrible stretch.
ANDREW:
Yeah, kind of. Absolutely kind of true. But yeah, it didn’t seem like it was a major ordeal to get that working. It was like a few changes here and there.
CHUCK:
The other thing that I’m wondering about is as Swift maybe moves in to some of these other areas of programming, so you have the server-side, you have whatever else, are those going to be covered as part of Apple’s – when they – I don’t really expect too strongly to see much in the world or WWDC on open source contributions to Swift that don’t involve Apple’s products, but are we going to start to see a wider Swift community that isn’t centered around Apple? Are we going to see Apple support some of those other efforts?
ANDREW:
I think you're right that Apple’s main concern, at least for the effort they’re putting in, is going to be to support their platforms. At some point, they’re not going to spend a lot of time worrying about whether it works great to develop for Android. But that said, I think that they do hope that it really gains wide adoption because they’ve dais that publicly.
There have been – I read around the time the open source release happened, Craig Federighi who is the – I don’t remember his exact title but he’s essentially the Executive at Apple that’s in-charge of their software, including iOS and OS 10. He’s what made the rounds and the few interviews for tech websites and he was actually on an episode of John Gruber’s podcast, the talk show. And he said that they want Swift to be not just their language for the next 20 years but the language for the next 20 years. The language that people default to learning when they’re trying to decide what programming language to learn. [Crosstalk]
CHUCK:
Like what Java was in the 80’s or 90’s?
ANDREW:
Yeah, and probably what C was before that.
CHUCK:
Yeah.
ANDREW:
And he even mentioned, they would love to see Swift to be used as a teaching language in high schools and Universities.
Personally, I don’t really know whether – I’m certainly not an expert on teaching programming languages but I think that’s just interesting that they have that perspective, assuming it’s sincere.
JAIM:
Yeah. It’s a nice sentiment but to actually get that to happen, you need very wide adoption. You look at the Perfect website, it runs on Ubuntu; Apple supports Ubuntu. It’s not ubiquitous. Is Apple going to make it ubiquitous? Probably not. In fact, that’s going to come from the community. Do they get enough critical mass to actually make it a dominant language in these different paradigms? It’s still very early so it still can happen but [crosstalk] it’s a lot of work.
ANDREW:
Right. I think it’s anyone’s guess. I think the interesting thing is that Apple seems to want that to happen. But whether it will actually happen or not, it’s really a whole other question. I certainly don’t know how to predict that but I also do think though that the reaction I’ve seen to Swift from outside of the Apple development community has mostly been positive. People that don’t have anything to do with developing for iOS or Mac already that check out Swift seem to think it’s pretty cool.
Some of the other languages that might compete with it which I think are Go and Rust and some of those maybe don’t have – Go might be an exception though because Go is backed by Google. But because it’s not the development language for Android, I don’t think it’s got the same big company with an existing big pool of developers that are making their living writing this language. Swift has that built-in from the very beginning so I think that’s a big plus but at the same time, that doesn’t really directly help it expand beyond Apple.
CHUCK:
Yup. Of course you compare it to – a little bit to these other languages which is sadly, we really haven’t done with Swift up until now. We compare it to Objective-C and that’s more or less it because it was only really available in those same areas where you were going to be using Objective-C. So I’m really curious also to see, as things develop, hot it performs relative to these other languages.
It has libdispatch – I think that was what it was called – and some of these other things that allow it to do concurrent work. So it’ll be really interesting to see how it compares now to go for concurrency or some of the other popular things with Node.js or Ruby with web development Perfect. Or some of these other systems that are out, especially given it nature as a language that’s not strictly 00 or strictly functional but it’s kind of somewhere in the middle.
ANDREW:
Yeah. I’m not an expert on Go or Rust. I don’t think Apple or anyone really see Swift competing with Ruby so much considering Ruby’s basically 20 years old. So I think Swift is essentially a generation newer than Ruby and it’s also a compile language. In any case, I think – my own impression and what I gather from reading what a lot of other people are saying is that Swift is a really pragmatic language. So it’s not like Pascal or like this high-minded theoretical language; they wrote it for real people. They are writing real programs, real applications that are actually going to ship.
For better or for worst, there are some downsides to that but it makes it so it’s actually quite flexible and has some nice things going for it.
CHUCK:
One other thing that I saw on the Swift.org page that I liked was the REPL debugger stuff; that looked really fascinating as well. It’s always nice when you have a language, whether it’s compiled or interpreted when you have a REPL that you can play with. You can throw stuff in there, you can goof around with it. It’s also nice when it does have the debugging features built in to it.
Yeah, it’s just – it’s a lot of – it’s really nice to be able to just go and fiddle with it without a whole lot of overhead. Even sandboxes or playgrounds or whatever they call them, or Swift before in Xcode or whatever, it’s still – there was a certain level of – you have to install Xcode and fire it up and blah, blah, blah. With this, once you have open source Swift installed, you can actually just fire up the REPL and go for it.
ANDREW:
Yeah, it’s pretty cool. One of the big features of Swift when Swift very first was announced was playgrounds in Xcode. And playgrounds are not part of the open source release; we should be clear about that. But a REPL is – get you part by there. You can just open up the REPL and start typing and see what your code does as you're typing it so that’s pretty cool.
Another thing that Swift has always been useable for on OS 10 but now presumably would be useable for Linux and other platforms that end up support [inaudible], you can essentially use it as a shell scripting language. So you can write where you would write a script on Perl or Python or Bash or something, you can actually write a lot of those in Swift which is pretty cool, even though it’s compiled.
CHUCK:
I also realized that I used some Jargon and I want to go back and define it.
REPL – I don’t remember what it stands for but essentially, it’s a place where you can type in and execute live code [crosstalk] on the command line.
ANDREW:
Yeah. Read, evaluate, print and loop. Okay, yeah. Type the code in and see what it does, see what it does immediately instead of having to hit compile and run and wait. That’s pretty cool.
It’s not a new thing with Swift. There are REPLs for lots of other languages.
CHUCK:
Yeah. So anything else that we should look at here with this before we go to picks?
Everybody go upvote Andrew’s zillion pull request against the Swift source code.
ANDREW:
Yeah. I actually have zero right now but I’m hoping to change that on some point. I’ll probably try to do a little work on the package manager because that seems to be something that’s useful to me and it’s small and simple enough. Not that it’s small and simple, but it’s certainly simpler than the compiler for me to understand. I’d like to submit at least something to it. We’ll see if I find time though.
CHUCK:
Yup. Alright, let’s go ahead and go some picks. Jaim, do you have some picks for us?
JAIM:
Sure. I’ve got one pick. This might’ve been a pick with the previous guest, Paul Cantrell. At least this is how I found out about this blog post. If you're dealing with protocol extensions in Swift, that’s the new cool thing to do. Classes are so old school; it’s all protocol extensions now with the default [inaudible].
So [inaudible] I’ve been working with has drank the Kool-Aid and we’ve been testing out this way of development. I have been trying to implement what they’ve been doing and write into [inaudible] and I ran through a lot of problems. A lot of it is centered around the differences between the dynamic and the static dispatch. So if you credit class and you want to test it, mock it out, we’ve always been sub-classing and overriding and going our way. We can observe things and make sure things are happening like we want to with the default extensions, with the default implementations and the protocol extensions, that becomes a problem.
Why? It’s very well explained in this article of The Ghost of Swift Bugs Future by Alexandros Salazar. If you haven’t read this thoroughly and you're writing protocol extensions, you really need to.
CHUCK:
Alright. Andrew, what are your picks?
ANDREW:
See, I’ve got two – sort of three. One of them is a repeat pick but I’ll pick it again.
My first pick is actually a blog post that I wrote that I mentioned earlier about how to get Swift running on your Raspberry Pi. I should not take too much credit. I didn’t really do anything hard to get this working I just followed some other people’s instructions, got it working and wrote a blog post about the exact steps that you need to take if you want to run Swift on your – want to get Swift compiler working on your Raspberry Pi so you can write Swift apps on Raspberry Pi. If you're interested in that, you have a Raspberry Pi, go check out my instructions.
My second pick is called Swift Sandbox. I think I have not picked this before. It’s actually a weekly newsletter about Swift. I’ve been signed up to this since the first issue and it’s just – it’s like iOS Dev Weekly, similar idea but it’s all about Swift. I’ve found some pretty cool that has actually been useful to me from this newsletter, including some stuff about the Swift package manager that has been helpful just in the last week. It’s definitely worth signing up for if you're writing Swift and want to learn new things and see what other people are saying and doing with the language.
My third pick which I think is a repeat is also called Swift Sandbox. So two Swift Sandbox picks but it’s something completely different. It’s an actual Swift SandBox that IBM put up. Probably everybody’s already seen it but it’s pretty cool. It’s essentially an on – it’s not quite a REPL but it’s an online Swift compiler where you type Swift in your browser and you can hit run, see the output and it’s all powered by Swift running on Linux on IBM server so, pretty cool.
I’ve got some cool examples including – fairly sophisticated stuff including a server, a little web server that’s written in Swift. It’s not – a few hundred lines of code but it’s pretty cool. Those are my picks.
CHUCK:
Awesome. I’m going to be a little bit long winded with my picks.
I don’t know if I’ve talked too much about it on this show. I have definitely talked about it at length on the Freelancer Show if you want to go check that out. It should come out about the same time as this one, so this week or last week. But at the end of this year, starting about mid-November, I started making goals for the next year. I go through this process where I say, “Okay. Well, where do I want to get to someday?”
Some of them are pretty vague like I want to go to Heaven someday or I want to be able to do this or that someday. Then it’s like, well, in order to get there, where do I have to be in five years? I
usually try and make those five-year goals a little bit ambitious, then where do I have to be in one year to make it to the five-year or to be well on my way? Then I do ninety days et cetera.
During the process of setting those goals, we had a baby as you’ve heard on the show. Then my dad had open heart surgery and then he came home from the hospital and had a bunch of – basically, he fell down and so I wound up spending the night one night and then I wound up taking him to dialysis because he also has kidney failure. He had a hip surgery go wrong a few years ago because he’s got hip problems, osteoarthritis. He’s got all these whole host of health problems and while I was talking to him, I realized that I’m heading down the same road; I’m just 25 years behind.
So I decided that this year, I’m going to get my health in order and then I just need to keep it in order. Essentially, I’m going to lose 40 pounds this year and I’m just going to briefly pick some of the things that I’m going to be using during this process in order to do that.
It’s funny because I was hyper-focused on my business when I started setting the goals, and by the time I was done – I have a major business goal and a major health goal. That’s basically where I’m at.
So when I work out, I’ve been tracking it with a Nike Running – I think it’s a Nike+ Running app on my iPhone. So when I go for a run, I just start it and when I’m done, I stop it and it tells me how far I went. It works on the track at the gym so I can run in circles and it still tells me that I went three miles or however far I went.
I’ve also been using the 10K app – Run 10K app on the iPhone. They have a Run 5K app if you're interested in that. It’s very similar to Couch to 5K. I’m really liking that so I set that up and it tells me to run and stuff, too. It doesn’t track distance as well which is why I use both.
I’ve also – I’ve got my Pebble Time Steel watch and I’ve mentioned that on the show before. The nice thing is that they just turned on all the health features so it tells me how many steps I’ve gone in a day and how active I’ve been. It also syncs all that information to HealthKit because I’ve told it, it can.
When I’m running the Run 10K app, it notifies you when you need to start running or when you need to start walking [inaudible]. That’s every few minutes on the one I’m on right now.
The problem with that is I’m usually listening to something while I’m running and I don’t want [inaudible] up to me so I found if I turn my screen off when I’m running, it actually just vibrates on my watch and tells me to run so that’s pretty nice.
I don’t know what it is; I must have abnormally large thumbs or something, but when I’m running with the Apple ear pods in, my thumbs catch that cord at least two or three times while I’m running, just yanks it right out; out of my ears, out the phone out of both, throw it halfway across the track. It sucks. So I also have some AfterShokz Bluez 2 headphones. They are Bluetooth headphones and they are bone conduction headphones so they don’t actually go over in my ear which is nice if I need to hear what’s going on around me. It’s also just nice in general just because I don’t have that cord so I’m going to pick that as well.
Also, if you go out and read the literature on how to lose weight and how to get healthy, the two big things that are going to make the most difference are actually – if you’re exercising sleep but the main thing is your diet, and not just that you cut calories but you're actually eating good food, I
have some guidelines set up in MyFItnessPal and I’ve been using MyFitnessPal to track what I’m eating. That has been working really well as well.
You can actually find me on Nike Running and on MyFitnessPal. My username on MyFitnessPal is woody2shoes if you look me up. And on Nike Running, I think it’s cmaxw which is my twitter handle. So if you're interested in any of that, you can – definitely I’d love to connect, see how well you're doing in relation to how well I’m doing but yeah.
The only other health goal that I’ve set is that I’m going to go a year without caffeine. I’m about three days in and I’m dying but I think that gets easier. I’ve quite for as long as three months before and after a couple of months then it’s – you don’t get the headaches and stuff but right now, it’s no fun.
Anyway, lots of long winded picking but that’s where I’m at. The main business goal is to increase the number of email subscribers and I’ll probably talk about that on a future show.
Anyway, those are my picks.
JAIM:
Good luck, Chuck!
CHUCK:
Yeah. Thanks. Also Jaim, I remember way back when I joined Toastmasters, I took your challenge to get my Competent Communicator in a year. I think I mentioned it on the show before but I actually managed to do that.
JAIM:
Sweet.
CHUCK:
Yay!
JAIM:
Congrats.
CHUCK:
Alright. We’ll go ahead and wrap up the show. Thanks both of you for being here and we will catch you all next week.
[Hosting and bandwidth provided by the Blue Box Group. Check them out at BlueBox.net.]
[Bandwidth for this segment is provided by CacheFly, the world’s fastest CDN. Deliver your content fast with CacheFly. Visit cachefly.com to learn more]
138 iPS Open Source Swift
0:00
Playback Speed: