Apple Releases Swift As an Open-Source Project (swift.org)
jcr writes with the news that Apple's Swift has gone open source: From Apple's press release: "We are excited by this new chapter in the story of Swift. After Apple unveiled the Swift programming language, it quickly became one of the fastest growing languages in history. Swift makes it easy to write software that is incredibly fast and safe by design. Now that Swift is open source, you can help make the best general purpose programming language available everywhere."
It's listed at Apple's GitHub repository, too. (Hat tip to Jono Bacon.)
Swift is available for Apple and Linux. No Windows version?
The specification may be open (or not); that does not mean that the code that creates the language interpreter or compiler is open.
In this case, it is. That's laudable, at least in the broadest sense.
As for the remark that Swift is "growing faster than anything else we can track" in TFA, well, okay, but grass grows faster than redwoods, too, but that doesn't mean it's going to get as tall. :)
I've fallen off your lawn, and I can't get up.
A programming language is a specification, and thus open source by nature.
Try telling that to the appellate judge in Oracle v. Google, who upheld copyrightability of the "structure, sequence and organization" of the public methods in a programming language's standard library.
I read the featured article, and it turns out to be Apache License 2.0.
What major programming language isn't corporate controlled? PHP Group is a corporation, Perl Foundation is a corporation, Python Software Foundation is a corporation, Ecma International (ECMAScript) is a corporation, and International Organization for Standardization (C, C++) is a corporation.
and what is there to gain for an old school C programmer who doesn't particularly enjoy C++ ?
SWIFT is more or less ObjectiveC made sane. It's basically the same underlying world view, but with a new language with a unified syntax (where as ObjC is like two unrelated languaged bolted together), reduced undefined behaviour, no pointer arithmetic (by default? not sure. Pounters aren't exposed in the same way).
ObjC and so Swift are both very late bound languages, so have a very dynamic feel to them.
SJW n. One who posts facts.
I haven't used it, just read a lot of the documentation, but it looks like a pretty nicely designed language. It has a very modern feel: concise syntax, static typing with type inference, closures, everything is an object, etc. Certainly looks much nicer to work in than C++.
For any question about, "Can you do...", the answer is almost certainly yes. It's the recommended language for nearly all new development on iOS and Mac OS, so it's being used for all those things.
"I'm too busy to research this and form an educated opinion, but I do have time to tell everyone my uninformed opinion."
When Sun made Java they said "what would we improve about C++ if we had the chance?". Separate from the JVM concept, this is what they were thinking when they made the language. Back when Java was new people joked it was C+++. When Microsoft made C# they said "what would we improve about Java if we had the chance?".
Apple basically said "holy FUCK we need to get away from this shitty 80's language, C# does some good stuff, but what would we improve about it if we had the chance?
So in C# you used to have to declare something like this:
Then languages started asking themselves "wait, why do we have to say the class name twice? We could just get away with just doing it once"
Swift says "wait, why do we need semicolons? I mean yeah it used to be that we didn't have great ways of telling lines apart but we've solved that problem now. If there's just the one statement on a line no need for a semicolon. And why do we need to say "new"? We know it's new. The calling of the class name via the constructor tells us that. Get rid of that shit too"
Back when c# introduced "var" I was dead set against it. When Swift dropped semicolons I thought it was reckless. Now that I've been using Swift a while I get their minimalist religion. It's a struggle to go back to C# or JS and have to remember semicolons (although JS doesn't seem to give a shit either way)
To declare a constant in C# you declare its type as well as use a keyword
In Swift, they said "well, we're already using var, why not just swap that out for a constant?"
and the compiler in Xcode now shows you all the times when you could use a constant, which is way more often than you realize.
For all the spitballing about platform this and proprietary that, underneath it all Swift is the latest attempt at a language that uses what we've learned from previous languages. And it's possible some or all of their conventions have been used by other recent languages that just got an eyeroll from working developers but Swift has this tremendous advantage in that it has a compelling use case: iOS developers who don't want to use Objective-C. Because no one really wants to use Objective-C. Anyone who says they do is a victim of Stockholm Syndrome.
Schnapple