Swift, and why it hurts you (from an GNUStep developer)
heronsperch.blogspot.com
heronsperch.blogspot.com
Swift has some pretty nice features to improve programming safety such as stronger static typing, type inference (not as good as functional languages), a very nice syntax for option types, discriminated unions, pattern matching, improved focus on immutability. It's impressive that Swift introduces all these functional goodies without programmers having to blow a socket trying to convert completely to pure functional programming.
For example the Intermediate Swift presentation at WWDC 14 has a pretty elegant way to implement elements of what Scott Wlaschin calls 'railway oriented programming' (http://fsharpforfunandprofit.com/posts/recipe-part2/).
As much as I love functional programming I think they've done a pretty good job supporting Cocoa development and improving programming safety. My hope is that Swift will be a gateway drug for FP.
From a slightly different angle, I personally think Obj-C is a very neat alternative to C++, and that it would flourish outside of the context of Apple's frameworks if more folks started to use it as such. While I'm happy that iOS development will be a little less difficult now thanks to Swift, it makes me sad to think that Obj-C might not get as much attention from newer developers who like the way the language extends C with Smalltalk-style OO and message passing.
Apple should just open-source the entire language (runtime, implementation, spec etc.) and let the community make it stronger. Seemed to work with Google and Go!
EDIT: C# could call into C++ from the start, and I believe the reverse was also true. So platform-wise, MS matches the Swift<->ObjC/C bridge as well. I forgot about that detail.
The problem with C# and .NET is (was) that they are patent-encumbered and that's the real game stopper. It took quite a long time and a lot of debate on .NET suitability for a Free Software movement to settle that matters somehow (recent releases under Apache license seem to fix many issues, though, although that still needs a statement from FSF's lawyers).
I'm unaware about Swift relationship to software patents. Does anyone know?
To use Go as an example, the entire Windows port was done outside of the core team, and is now a supported platform. The same goes for ARM, PPC64 etc. Also, huge performance improvements in core features such as channels were implemented by non Google employees.
If Apple open Swift, it can find hold in all sorts of niches they didn't expect it to, and can benefit from an entire community of developers who can fix the language's problems rather than be frustrated by them.
Disagree. JavaScript isn't even strongly typed. Swift affords many imperative and functional techniques, but that doesn't make it JavaScript-like.
"The real purpose behind this language, however, is a little darker. I believe that it's ultimate purpose is lock-in. The more developers start using Swift the less they are going to be able to move to other platforms (such as Android)."
By this logic we should all be using Java. Now ask yourself: Should we, really?
Or C. Or C++. Or Haskell. Or Python. Or Fortran. Or any other language with an Open Source compiler.
Its true that Apple imposes limitations for its own profit and the benefit of the users. But it does not lock in anyone.
So no Swift is no big conspiracy. Its just a move forward for Apple to attract more developers and give android java a run for its money in terms of performance and ease of use. Apple sends the statement "not only we are a platform with less worries on incompatible hardware, but now we even offer a powerful yet easy to use language". A wise move from Apple and a big plus for developers.
In the 2000's, Flash was gaining a ton of popularity on the web, and Macromedia was recently bought by Adobe. They had just developed a new programming language, ActionScript, which was dynamic and object-oriented and offered an interactive developer playground. For early web developers like me, it was seductive and simple and more powerful than other state-of-the-art web technologies.
But, developers across the world, myself included, wondered: would ActionScript and Flash become open source? That was the one thing holding it back from broad adoption and improvement by the community. The web wouldn't stand for a closed standard.
I wasn't so sure what Adobe's plans were -- so I abandoned ship. Many others did, too. Of course, the rest is history: HTML5 technologies and JavaScript -- aided by canvas/svg/webgl and other standards -- have won the day.
My view is that openness always wins in the developer community in the long run.
Flash is now relegated to a "second-choice" technology for web applications, mainly used for some specialized rich internet apps, games, and backwards-compatible video players. I personally hope that Apple learns from this lesson and deviates from their history by making Swift free and open source software. It's not only better for the developer community -- it's also better for Apple.
Open standards did not beat Flash. A bigger proprietary platform bully sent Flash to it's doom - Apple's iOS. Adobe's Flash was vulnerable because it had to seek Apple's blessing to be part of Apple's platform, and they were spurned.
This is the lesson of being a sharecropper - even a massive proprietary-source company, Adobe, are powerless when the platform owner enforces it's control. https://www.tbray.org/ongoing/When/200x/2003/07/12/WebsThePl...
Yes, open standards win in the long run, after Apple have profited significantly from the closed approach they are taking now. At which point it's a meaningless victory.
The point of the article is, be aware you are just a sharecropper, and working on Apple's lands for as long as it's in Apple's interest. And Apple owes you nothing for all your hard efforts, it will change the environment for it's own corporate interests. And you, the developer, are mere insignificant collateral damage. Remember that Steve Jobs killed Flash. And there was nothing Adobe could do to avoid or mitigate it.
Current iOS developers have already accepted this, willingly or unknowingly. It's the new folk who are attracted by the new shiny thing, need to be aware of the consequences of working on an Apple controlled platform.
Both WebOS and Android had every intention of using Flash as a feature to differentiate themselves from Apple. If it were a matter of sheer marketshare, that should have been enough--Android has more customers than iOS.
But Adobe could never deliver a Flash runtime with acceptable performance, and even Android does not ship it anymore. Apple did not force them to drop it; it just wasn't good enough.
- move Java to a more browser friendly position
- make Flash lighter, faster and easier to integrate on mobile
These were for feature phones, and any of the above were realistic and plausible (I did actual projects using each of the above)
Flash got killed because it was too mouse centric and there would be no bridge between mobile and desktop, thus denying any network effect fom the desktop. The API was good enough, there was a few open source compilers and the runtime was OK. Compared to native Java it was actually nice to use.
But when you see the iPhone or the android phones, there is no compelling reason to do a lightweight Flash app when the same can be done in JS for more or less the same effort (and the js would work everywhere). Access to native functions could have been a selling point, but even that, going the full native route would be more sensible.
TLDR;for me Flash was killed by js coming to mobile, more than anything else
I dont think one can compare AS3 and Swift. In fact Microsoft had it's own implementation of ES4, Jscript.net.
> Flash is now relegated to a "second-choice" technology for web applications,
"Thanks to" Steve Jobs,that didnt want anyhting on his plateform he couldnt control.
IOs is a closed ecosystem,IOs has more developpers and apps than ever.There is nothing to learn here but the fact that they control their plateform,from end 2 end,and users keep on coming.
- It was based upon ECMAScript 4.
- The ActionScript code was open source, and the actual reference code for ECMAScript 4.
- The JIT runtime of ActionScript 3 was open sourced (Tamarin) and "donated" to Mozilla to use as the basis for a faster JS runtime.
Also, your comparison of Flash with Apple's Cocoa/OS platform frankly makes no sense. The situation is vastly different. Swift is in exactly the same position as Objective-C. It's under no greater threat to disappear than Objective-C is.
Regardless the openness of obj-c and swift, the iPhone runtime is still close-sourced.
And you can write your own swift compiler in LLVM, even if apple don't opensource it.
At one point or another your software needs to run on a piece of hardware. At least some of it won't be open, because as IBM learned in the 80s, you end up giving your hard earned lunch to your competitors.
Being that a lot of people who will pick up swift will be Objective C developers who were already locked in, I don't see the issue here.
Beyond UI, I actually have used my Objective-C data models from an iOS app on Linux. There is no need for Cocoa there. Objective-C code transitions quite well at that level.
That said, I do agree that it is really not a big deal for the vast majority of developers.
Apple created a programming language for their platform. Use it or don't.
All things considered, I don't think the lock in will have much legs, but
We always had to deal with different languages and different SDKs for each platform. This just makes one of them less of a bear.
Did you seriously expect Apple to ship a cross-platform development solution ?
And in the greater sense, a good developer shouldn't be defined by one programming language, thus the locking-in argument is a bit ridiculous.
I get that some folks are fearful of change. You're in the wrong industry, then.
On the other hand, I've never heard of anyone using their ObjC code from iOS app for Android one (by transpiling to Java or building ObjC code as a native library) or vice versa, so I guess this point is probably mostly moot. Except for the rant comes from a GNUstep developer, where ObjC is a language of choice, too (and Swift is supposedly unavailable, at least it's the case at the moment).
When I learned objc more than a decade ago I was really just a kid, I could not afford a Mac or any extra hardware. But there was a GNU compiler. GNUstep had an open implementation of Foundation and AppKit. And the whole thing ran on Linux. So I was able to play with it. When I share this story with current objc devs, they give me blank looks. Mentally, they have already decided it is Apple's language and nothing more. I believe this is a form of blindness to the potential of objc. Why not objc on Linux? It exists today.
Hopefully Apple opens up the compiler, people port it to GNUstep, and the whole issue is moot.
In reality, it's was a bunch of people batting around ideas in the hope we would come up with something that would make people like our products.
So I have a hard time believing someone at apple asked for a programming language that would "lock in" developers.
Deleted comment
I'd be very surprised if it turned out to be under a non-open license and would see it as a hostile move by Apple. If that was the case then I too would be rooting for it to whither and die.
IMO, Swift is the most interesting language that's obviously going to be around and popular in 10 years time. There are languages that could be argued as even more interesting, such as Rust, and languages that are even more obviously going to be around and popular in 10 years (C++, etc), but swift is the only language I see that has both.
An open source Swift will not make iOS apps much easier to port, though. The libraries and frameworks of iOS are a much bigger hurdle than the language. Not to mention the fact that there will probably be small incompatibilities between the Apple and the open source implementations for at least the first few years.
It's turtles all the way down!
GNUStep was interesting back in the late 90's. Nowadays it is just a curiosity, with NeXTStep compliance still catching up and Cocoa support around Mac OS X 10.6.
http://thehackernews.com/2014/06/apples-new-swift-programmin...