Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Is learning Swift all I would need to get started?

Its not a bad place to start, but apart from learning the language and general programming you'll also need some time and patience to learn how to build applications for iOS.

It lacks frameworks for setting up servers using it, and up until now the only servers it would run on would be OS X servers.

Well, yes, that's kinda why this announcement is important. Open sourcing the language is pretty much a pre-requisite for any development of server frameworks for Swift - I don't see anything fundamental in the language that would prevent it being a great server-side language except that AFAIK it is intended to compile to native binary rather than run as a script. Odds are you could already stick compiled Swift apps in cgi-bin....
 
I've been programming almost exclusively in Swift for over a year now, and I write better, cleaner, safer code than with Objective-C. (especially with some of the additions they made with Swift 2.0) Love it.

Will be interesting to see how Swift is adopted on other platforms.

Curious, can you use swift for numerical computation? Like python numpy and such?
 
I'm thinking about developing for iOS. I have almost zero experience with any kind of code, except for a little html in the late '90s. Is learning Swift all I would need to get started?
I think Swift is a better language to learn on than Objective-C. Check out the Swift Programming Guide you can get in iBooks for free - I haven't checked swift.org since it's clogged right now, but maybe the guide is there as well. XCode, the development system is free, and Swift in XCode has something called playgrounds, which lets you play with Swift interactively, great for learning and trying things out.

I wrote my ninth and latest App Store app, ParkTime (remembers where you parked [myallo.com]), in Swift. I learned Swift as I wrote the app, and it all went very smoothly.
 
  • Like
Reactions: nekonokami
Without developer support, Swift is just a language... next to useless. Frameworks / libraries are required for the building blocks to create rich applications, such as web apps, desktop applications et al.

Swift can directly import C headers, so its far from being useless. With Swift, you get full access to what C can do, and you also get a powerful and user-friendly metatyping facility as well.
 
  • Like
Reactions: page404
Don't know what to say about this news. I knew Swift was announced to become Open Source but the fascination of Open Source has worn of quite heavily during the past ten years. So... . Let's see what this gets us. I did not had any interest in Swift so far. The same way I did not had much interest in Objective-C fifteen years ago. Nontheless All my apps of today are written in the latter mainly for the reason that Cocoa is quite an astonishing piece of work from an engineering point of view. If there would be a pure C binding for Cocoa, I would be sold forever. Unfortunately, this is pretty much the opposite direction of where Swift is leading.

I am neutral. It can't be that bad.

Probably the largest benefit to Open Source is the ability for multiple companies to collaborate on a code base without needing an explicit partnership agreement, or something similar. A great example is WebKit. There was a ton of work added by companies other than Apple. Hopefully similar things happen with Swift.

It is funny that you long for a pure C version of Cocoa. So much of the Cocoa framework was made possible by the functionality provided by Objective C.

Speaking of Objective C, it is a great language to make fun of, but most of the criticism ignores how productive it is as a language. As I mentioned, the frameworks NeXT and Apple made are great, and they owe a lot of that to the language. The combination of Objective C and its associated frameworks enable some truly great apps. Objective C may not have had all the flashy features of some other languages, but it was easy to learn, expressive, and let you accomplish a lot.

Moving on to Swift, it is technically superior to Objective C in just about every way, but it is also a more complicated language as well. It is multi-paradigm to an even larger extent than Objective C. Where Objective C mixed the procedural and OO paradigms, Swift adds functional to the list as well. Add in generics, and it starts getting more complicated. The upshot is that it gives developers many different tools to use in tackling their problems. Not all problems are best solved functionally and not everything should be an object. It is great that there is support for all of these different strategies. When Swift was first released, it was pretty rough, but credit is due to the team at Apple, they have really taken the language a long way in a short time. I am excited to see the future improvements.
 
Swift can directly import C headers, so its far from being useless. With Swift, you get full access to what C can do, and you also get a powerful and user-friendly metatyping facility as well.
Depends on the type of applications that is being written.

There is still considerable work ahead ( for the development community especially ) to make Swift competitive with established languages such as the ones I mentioned. Without being competitive,a company could not consider to start a new project ( or switch ) in Swift, for example web applications.
 
Last edited:
They need to update XCode from 7.1.1 to 7.2 to xcrun launch-with-toolchain command to use the latest version of SWIFT in XCode which is still in beta FYI...unless I am missing something here...

How on Earth does it mean that?
If it's open source you can launch your apps on competing platforms like linux and the like...
 
Last edited:
Just noticed this tidbit from github:

OS X, Ubuntu Linux LTS, and the latest Ubuntu Linux release are the current supported host development operating systems.

Just find it interesting that they favor ubuntu.

Not that interesting as most of the Linux work for LLVM/Clang come from Debian based distros.
 
I'm thinking about developing for iOS. I have almost zero experience with any kind of code, except for a little html in the late '90s. Is learning Swift all I would need to get started?
Well there are two different approaches to this.

Approach 1: If you've already got some experience with writing markup with HTML it might be worth expanding on that and trying to build a website(s) by learning some styling with CSS, and then move on to client side scripting with JavaScript and then onto some server side scripting with Python, Ruby or PHP (PHPv7 is released today!), which you can also try out in terminal. The advantage of the approach is that you can see your progress very quickly, as these are, on the whole easier, and you get results that you can actually use, show off etc which helps motivate you to continue. The problem is that most of these scripting languages are a lot less strict and allow for poor quality code, which can mean it's harder to move onto programming in Swift, Cpp etc.

Approach 2: Start programming with Swift (or another language that encourages clean, safe and overall better code), it'll be a real slog getting to the point where you can make anything that is useful, interesting etc, but you would have a solid foundation, and moving to other languages would be a piece of cake. Difficult to motivate yourself to get good at, but perseverance is rewarded. The only issue with Swift is it's relatively new so there are less high quality freely available starter courses, but if you're willing to pay (there are free trials) then Lynda.com has some excellent resources both for getting started with general programming and moving onto languages like Swift, made by Simon Allardice, highly recommend it.

If you do try it out, then good luck!
 
Swift is a breath of fresh air to code in.

Agreed. I started coding as a hobby in 1982 and for research/work in 1993 (vi is still my text editor of choice). Of the multitude of programming languages I have encountered in the past 30 years Swift is my favourite.
 
Curious, can you use swift for numerical computation? Like python numpy and such?

I haven't done serious finite-element modelling in about 10 years. Believe it or not Fortran is still one of the major languages for this. It is highly optimized for the platforms it runs on and has a wealth of proven numerical libraries. The latest versions have good interoperability with C.

That said, I am currently writing on simpler numerical analysis applications (such as Monte Carlo applications) using Swift. The strongly typed nature of Swift do make a good base for numerical applications. When specific routines are missing I just grab my "Numerical Recipes in Fortran" from my bookshelf and translate to Swift as I type.
 
  • Like
Reactions: aajeevlin
Well there are two different approaches to this.

Approach 1: If you've already got some experience with writing markup with HTML it might be worth expanding on that and trying to build a website(s) by learning some styling with CSS, and then move on to client side scripting with JavaScript and then onto some server side scripting with Python, Ruby or PHP (PHPv7 is released today!), which you can also try out in terminal. The advantage of the approach is that you can see your progress very quickly, as these are, on the whole easier, and you get results that you can actually use, show off etc which helps motivate you to continue. The problem is that most of these scripting languages are a lot less strict and allow for poor quality code, which can mean it's harder to move onto programming in Swift, Cpp etc.

Approach 2: Start programming with Swift (or another language that encourages clean, safe and overall better code), it'll be a real slog getting to the point where you can make anything that is useful, interesting etc, but you would have a solid foundation, and moving to other languages would be a piece of cake. Difficult to motivate yourself to get good at, but perseverance is rewarded. The only issue with Swift is it's relatively new so there are less high quality freely available starter courses, but if you're willing to pay (there are free trials) then Lynda.com has some excellent resources both for getting started with general programming and moving onto languages like Swift, made by Simon Allardice, highly recommend it.

If you do try it out, then good luck!

I would go with approach 1 with the understanding provided by josh. and i would actually do javascript first because it is easily accessible, it is everywhere and you can display and share your work with your friends right away and that is gratifying and keep you interested in learning more. just be aware of it's looseness and that when you move on to other languages you have to be strict. I don't think js is bad language and it's up to the programmer to write bad code no matter what language they are using. i can write pretty fantastic bugs in any of them.

the first language i tried to learn was objective c and that was very frustrating to me. then i worked on a website and i had to learn js right away because i had said i already knew it :p but i learned it quickly because i could see results and it's 'looseness' helped me understand the strictness of other languages when i when back. i found transitioning from js to swift very easy.
 
  • Like
Reactions: JoshDoug
This just means the runtime is open source. FYI, the OBJC runtime is also open source. This just spares the OSS advocates (especially the "everything must be GPL3" crowd) of having to create their own runtime, and the ensuing fork-wars that would happen.

Like the OBJC runtime, there is still necessary OS libraries that would be required to build an application, so this doesn't mean you can make something developed in Swift on OSX, and just compile the runtime and run it on Windows or Linux, because the underlying NextStep (NS* functions) aren't there.

Compare with Mono. Initially C# was just Microsoft, and third parties had to re-implement everything Microsoft put into it. This is why Unity is stuck on an old version of C#.NET, it's dependent on Mono. It doesn't let you build a project that depends on Microsoft OS API's on top another OS.

What this allows people to do, in theory, is use Swift as the language instead of something like Javascript, C#, or Lua in another application. In practice, it'll probably just be used to port MacOS/iOS Swift projects to Windows and Linux. It would be amazing if there was a huge uptick in use just to side-step the god-awful Android development Java-hell.

Great, thanks for the clear explanation.
 
Based on your comment, I can tell your age bracket.

An interesting claim. I don't think it's too terribly difficult for someone to find my age just by looking at my StackOverflow profile (which uses the same username). But you say you can do it with just my one comment. Go ahead and guess - it's always funny to hear what people think my age is.
 
If it's open source you can launch your apps on competing platforms like linux and the like...


That's not even remotely what it means. Developers have always been able to port their apps to other platforms; the language isn't particularly relevant, and the app store has never been exclusive. Different platforms have different APIs, which is where a lot of the porting effort goes. Plus apps such as Unity have been around from the start, which (theoretically) let you make stuff for a bunch of different platforms by clicking a button. Swift being open source or not changes nothing in this regard.

--Eric
 
What does Unity 3D have to do with running 100s of servers? Curious

Nothing. The first two paragraphs were about making server side applications, and how Swift would be a poor choice of language for that. I didn't mention Unity in those paragraphs.

The next paragraph was about the domain of the front end for games, where Unity is the best choice and Swift is a poor choice.

The point of my entire post was that Swift doesn't seem like a great choice for any part of any project. Obviously it's better than Obj-C, but that's setting the bar really, really low.
 
But it looks like Apple has not yet open sourced the linux ARM toolchain for Swift. So no Swift on my Raspberry Pi (yet?).

Swift would make a great server side language. It's very efficient compared to Python or node.js (etc.). Think of all the carbon emissions that might be saved in those GigaWatt server farms and data centers.
 
Well, there's no doubt that Python is one hell of a language. If only the devs cared more about performance. Python's performance actually got worse with Python 3. :( It has made adopting the language for certain tasks impossible. If you have to write most of the code in C anyway for performance reasons, why not just write the entire thing in C and be done with it?

The language is open source. Feel free to poke around and offer suggestions for speeding it up. Note, though, that you would need to demonstrate that there's no drawbacks (I.E., fully backwards compatible), and that the performance is improved by a noteworthy amount in real world cases, and that it doesn't make the code much harder to read.

The thought, though, is that performance is good enough in 99.99% of cases. Who cares if something takes 0.00001 second vs 0.000001 seconds? It rarely matters. For the cases where it matters, the 0.01% of cases, write that in C and hook it up to your 99.99% Python project.

In my 3 years of working with Python, I have never found that performance issues came from the language itself. I have found performance issues from bad algorithms - things with a complexity of ^4 where ^2 was easily doable. Always profile your code to make sure that you've really found the part that's causing the slowdown.
 
As I see it, Swift is an inferior language in most ways to most other languages. It has one thing going for it, which Obj-C had going for it too: you can write in the language, or you can't use Apple's App Stores (which means you can't publish on iOS at all).

Making it open source might fix a pain point - now it might end up being possible to write your code once in Swift and have it run everywhere - but only if people actually port it.

IDK. I'm sticking with C# in Unity 3D for cross platform game development and Python for server side code.

You don't have to use Swift or Objective-C to publish apps on the app store (either one).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.