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.
FaceTime was encumbered by patents Apple don't own. So until they expire, it's not going to be open source.
As to Swift - they only announced it was going open source at WWDC this summer. So no, not years. It's not even years old yet.
And by the way, a lot of slashdotter's cynicism that Swift would not be open sourced is hereby proved wrong.
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.
Has anyone tried building the *n?x version against MSYS or Cygwin yet? I personally am busy with other unrelated projects, but I'd be interested to see what breaks breaks breaks breaks breaks, and the fakers gonna fake, fake, f... (sorry, wrong Swift)
Now that it's becoming so well known, the next thing you'll see is a job listing asking for candidates with "5+ years of Swift experience"
Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
I read the featured article, and it turns out to be Apache License 2.0.
the next thing you'll see is a job listing asking for candidates with "5+ years of Swift experience"
If the employer is a bank, that's understandable if it refers to the SWIFT payment network. Otherwise, I take that as a code word for "I want to poach from Apple."
I don't really care whether it's "corporate controlled" as long as it's open source and not patent encumbered.
That is, I'm happy to let a corporation "control" something as long as people can fork it when the corporation drops the ball for some reason.
Both C# and Swift seem to satisfy those criteria.
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.
Let the forking begin
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.
A file format is specification, yet you'll find that for 20 years all the Microsoft Office file formats were closed and patented.
Oracle argued that not only is a programming language proprietary, but even the specification of the environment which the language requires to run is proprietary. Microsoft may have done the same with COM at one point.
After Apple unveiled the Swift programming language, it quickly became one of the fastest growing languages in history.
This is a pretty meaningless claim. Although Objective-C was not Apple's creation, they adopted it as the formal language for developing for their platforms. For all intents and purposes (99.9% of code), Objective-C is proprietary to Apple's walled garden. Apple decided to replace Objective-C with Swift, and thus it is no surprise that a large number of developers switched relatively quickly. In the greater scheme of things (IE outside of OSX or iOS development) Swift might as well not even exist.
Better known as 318230.
...didn't Microsoft open source both Rosyln and c#/vb a while back? Oh right, macs4all, carry on.
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon. -- Susan Ertz
But I imagine it's only going to take a couple of hours to get the compiler running on Linux, so the question becomes: is it worth learning, and what is there to gain for an old school C programmer who doesn't particularly enjoy C++ ?
I've only written a couple of apps using it, but I found the syntax to be much more straight forward than either C++ or Objective C. It was pretty easy to pick up on.
Taking guns away from the 99% gives the 1% 100% of the power.
And do learn C for when you actually need performance and/or a small memory footprint. Embeds well into Python, BTW.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
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."
That's not really fair. They're both currently beholden to certain conventions, Objective-C because it invented them and Swift because it has to be compatible with them. But up until Swift being open source it was pretty much just like he said, Obj-C made sane. Still stuck on Apple platforms, still needs OS X/iOS stuff to be useful, etc.
Schnapple
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
I've only written a couple of apps using it, but I found the syntax to be much more straight forward than either C++ or Objective C. It was pretty easy to pick up on.
The long-hand syntax is very similar to Pascal, with some slight changes to fit more closely in with modern languages. They've replaced BEGIN and END with {}'s, and instead of writing function/procedure, you simply write "func", just to name a few example. Pascal was used as a teaching language at universities back in the 80's until it was replaced by C/C++ in the 90's, and eventually Java more recently. I grew up programming Pascal. It was a wonderful language.
I've found a few excellent YouTube videos which helped ease me into using Swift. The first is the slightly long Swift Tutorial for Beginners, where the guy covers all the changes you'd notice when coming from another programming language.
Another is the Developing iOS 8 Apps with Swift, done by Stanford University.
I've been using Swift for a few months now, and I think it's brilliant. Once you know the long-hand version of some of the syntactic sugar they've added, it becomes trivial to develop in. That being said, I find Apple documentation to be about as bad as Oracle's and Microsoft's. The language is easy, the toolkit libraries are vast and sometimes hard to decipher. In addition, being so new it's hard to find good help for specific problems, as most of the answers are in Objective-C.
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.
Ah yes, so we trade the problem of the missing semicolon for the problem of going between Windows and some other platform destroying our formatting and making our code into word salad. You know why we're still using semicolons? Because they're still useful. This is just as dumb as using indentation to control program flow, only a different dumb.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
I see more job listings for Java than C# and Swift in my country. In fact, Swift is almost missing.
I'm real sorry to hear that.
Seriously though, I may have been a bit harsh, and I only started using Obj-C a few years ago when I got into iOS development but really, while the original version was probably good for its time, the language didn't evolve well (Obj-C 2.0 was very half baked looks like - dot notation works, except for when it doesn't that sort of thing). People fluent with it are like those farmers that just know how to operate the thresher well enough to keep their hands from being chopped off. It's not because the thresher was designed to keep you from chopping your hands off. I guess this is a convoluted "shoot yourself in the foot" analogy but you get what I mean.
Schnapple