Slashdot Mirror


Why Apple Should Open-Source Swift -- But Won't

snydeq writes: Faster innovation, better security, new markets — the case for opening Swift might be more compelling than Apple will admit, writes Peter Wayner. "In recent years, creators of programming languages have gone out of their way to get their code running on as many different computers as possible. This has meant open-sourcing their tools and doing everything they could to evangelize their work. Apple has never followed the same path as everyone else. The best course may be to open up Swift to everyone, but that doesn't mean Apple will. Nor should we assume that giving us something for free is in Apple's or (gasp) our best interests. The question of open-sourcing a language like Swift is trickier than it looks."

36 of 183 comments (clear)

  1. I disagree by bazmail · · Score: 5, Insightful

    If Apple doesn't want the help of the OSS community then forget 'em.

    Why bother crying and begging them to allow you to strengthen their products? If you want to work on Swift then send your resume to Apple.

    1. Re: I disagree by bazmail · · Score: 4, Informative

      Wrong. Open source does not mean chaos or loss of control.For example Mozilla Firefox is open source but Mozilla are still firmly in control of the project.

      Its a question of good governance. Give it freedom but yet maintain direction. Not an easy balance to get right as companies like Oracle are slowly learning. How much control would Apple want to exert? My guess is a lot.

    2. Re: I disagree by bazmail · · Score: 4, Insightful

      No Mozilla is only in control of the implementation branded as Mozilla,

      Yes. that would be "Mozilla Firefox", the project I explicitly referred to.

      ... ironically through copyright/trademark laws.

      Ironically? How so?

      ... anyone is free to fork the product and potentially completely remove any control Mozilla has by simply doing a better job at building the browser

      Yes. Which would then be a different project

    3. Re: I disagree by Ronin+Developer · · Score: 2

      (Not to mention that, on Apple platforms, you'd have to use Apple's language; forks have no bearing on that.)

      Incorrect. Your code has to compile using their APIs. There are multiple tools out there for writing iOS and OSX code (Embarcadero RADStudio, Titanium, FreePascal, MonoTouch, etc.) . All code must be signed before it can be accepted into the AppStore. And, the code undergoes basic checks to such things as unauthorized API calls, missing images, etc. The signing requirement still has to be done using XCode. The alternative tools are able to call it to facilitate the signing process.

      Swift and Objective-C through XCode are the PREFERRED tools that Apple supports. Outside of this realm, you are pretty much on your own with support being supplied by the alternative tool vendors.

    4. Re:I disagree by sqlrob · · Score: 2

      And they went running to another Open Source compiler. Your point?

  2. Re: Feel Free to Open Source your Own Code by kthreadd · · Score: 2

    No one is demanding anything, but some of us believe that distributing your software as free and open source software is better for everyone including the original developer. There's nothing wrong in suggesting it.

  3. What for? by joh · · Score: 3, Interesting

    There's no shortage of programming languages. Swift isn't anything special. It mostly has value for its integration with Apple's environment and this isn't Open Source either, so what would Swift being Open Source actually be good for? I really can't see why anyone would want to use Swift anywhere than on OS X or iOS when the real value isn't in the language anyway but in the frameworks and the integration with them.

    (And I'm not even saying that Apple's approach is better. It's a different approach and has its own advantages and disadvantages. But if you have a closed system using its advantages makes more sense than trying to square the circle.)

    1. Re:What for? by TheRaven64 · · Score: 5, Interesting

      I maintain the GNUstep / Clang Objective-C stack. Most people who use it now do so in Android applications. A lot of popular apps have a core in Objective-C with the Foundation framework (sometimes they use GNUstep's on Android, more often they'll use one of the proprietary versions that includes code from libFoundation, GNUstep and Cocotron, but they almost all use clang and the GNUstep Objective-C runtime). Amusingly, there are actually more devices deployed with my Objective-C stack than Apple's. The advantage for developers is that their core logic is portable everywhere, but the GUIs can be in Objective-C with UIKit on iOS or Java on Android (or, commonly for games, GLES with a little tiny bit of platform-specific setup code). I suspect that one of the big reasons why the app situation on Windows Phone sucks is that you can't do this with a Windows port.

      It would be great for these people to have an open source Swift that integrated cleanly with open source Objective-C stacks. Let's not forget that that's exactly what Swift is: a higher-level language designed for dealing with Objective-C libraries (not specifically Apple libraries).

      Objective-C is a good language for mid-1990s development. Swift looks like a nice language for early 2000s development. Hopefully someone will come up with a good language for late 2010s development soon...

      --
      I am TheRaven on Soylent News
    2. Re:What for? by pklinken · · Score: 2

      Interesting post! Could you point me towards a github or two of open source apps that are written like that ?

    3. Re:What for? by K.+S.+Kyosuke · · Score: 3, Interesting

      Hopefully someone will come up with a good language for late 2010s development soon...

      Well, there's always ClozureCL with its Objective-C bridge. :D

      --
      Ezekiel 23:20
  4. Re: Editors ! Explain terms, then add the story by kthreadd · · Score: 3, Informative

    In this context it's a programming language for the Objective-C runtime developed by Apple.

  5. Re: Apple not in my best interests either by kthreadd · · Score: 4, Interesting

    I don't know about that necessarily. Some has contributed a nontrivial amount of work to LLVM and especially the clang project. That has certainly been appreciated outside the Applesphere.

  6. Re:Editors ! Explain terms, then add the story by Thanshin · · Score: 2

    You are connected to Internet. What's the point on duplicating information?

    If you don't understand a term, you can search its explanation yourself.

  7. What is Slashdot's Relationship to InfoWorld? by Anonymous Coward · · Score: 3, Insightful

    Many click-bait, shit posts come from snydeq and they all link to how-is-it-still-in-business-rag InfoWorld.

    I know Slashdot hasn't tried in years, but damn, there are interesting stories out there that can produce good discussion.

  8. Article shows fundamental lack of understanding by SuperKendall · · Score: 4, Interesting

    Whoever wrote that article doesn't understand Swift well, or Apple for that matter:

    Swift is designed to support a world built bottom up in Objective-C. It's meant to play well with the bazillion lines of existing Objective-C, not supplant it.

    This is totally wrong. Apple could not be more clear that Swift is built to supplant Objective-C. It will take a while to re-write the frameworks but they are encouraging everyone now to write new stuff in Swift, and as rapidly as possible making the bridge over to the Objective-C frameworks as Swift friendly as possible.

    I think Apple will not open Swift at the moment because they want to have a small core group directing where the language goes, at least at first... and then it will open up more from there. But that also supports the notion that swift is not an auxiliary language, but the primary path going forward.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Article shows fundamental lack of understanding by disambiguated · · Score: 5, Insightful

      You're both wrong/right. In order to supplant Objective-C, Swift would have to play well with the bazillion lines of Objective-C, and coexist with it for possibly a very long time. On the other hand, even if Apple "could not be more clear" that swift is built to supplant Objective-C, that doesn't mean it will succeed, and doesn't mean Apple won't change their mind. It's a gamble and they certainly know it. They keep that to themselves in order to encourage you to drink the cool-aid.

      See also: Microsoft and .NET

    2. Re:Article shows fundamental lack of understanding by gnasher719 · · Score: 3, Insightful

      Type-casting -oh my lord type casting- is so astoundingly bad in Swift it really beggars belief that in the 21st century anyone could design something that bad!

      Then I'd say you didn't understand it.

    3. Re:Article shows fundamental lack of understanding by iluvcapra · · Score: 2

      Go back to 2002 or so and s/Objective-C/Java. They're committed for the time being, but if they see people switching to Swift uniformly they'll dump Obj-C like a bad habit.

      --
      Don't blame me, I voted for Baltar.
    4. Re:Article shows fundamental lack of understanding by dgatwood · · Score: 2

      They won't see people switching to Swift uniformly. There are trillions of lines of code written in Objective-C, and programmers already know it and are comfortable with it. There are no tools for migrating code from Objective-C to Swift, much less the hodgepodge of mixed C, Objective-C, and sometimes C++ that quite frequently occurs in real-world apps, so for the foreseeable future, you'd end up just adding Swift to your existing apps, which means you now have three or four languages mixed in one app instead of two or three, and now one of them looks completely different than the others. I just don't see very many developers seriously considering adopting Swift without a robust translator tool in place.

      I do, however, expect to see Swift become the language of choice for new programmers who are coming from scripting languages like Python and Ruby, because it is more like what they're used to. In the long term, they'll outnumber the Objective-C developers, but the big, expensive apps will still mostly be written in Objective-C, simply because most of them will be new versions of apps that already exist.

      BTW, Apple never really treated Java like a first-class citizen; it was always a half-hearted bolt-on language. My gut says that they added Java support under the belief that more developers knew Java than Objective-C, so it would attract developers to the platform faster. In practice, however, almost nobody ever really adopted it, so it withered on the vine. Since then, they have shipped and subsequently dropped bridges for both Ruby and Python.

      Any implication that Swift will supplant Objective-C like Objective-C supplanted Java requires revisionist history. Objective-C supplanted C, not Java. Java was never even in the running. And Objective-C still hasn't supplanted C. You'll still find tons of application code for OS X written in C even after nearly a decade and a half of Apple encouraging developers to move away from C and towards Objective-C. (Mind you, most of the UI code is in Objective-C at this point.) And that's when moving to a language that's close enough to C that you don't have to retrain all your programmers.

      Compared with the C to Objective-C transition, any transition from Objective-C to Swift is likely to occur at a speed that can only be described as glacial. IMO, unless Apple miraculously makes the translation process nearly painless, they'll be lucky to be able to get rid of Objective C significantly before the dawn of the next century. I just don't see it happening, for precisely the same reason that nine years after Rails, there are still a couple orders of magnitude more websites built with PHP. If a language doesn't cause insane amounts of pain (e.g. Perl), people are reluctant to leave it and rewrite everything in another language just to obtain a marginal improvement in programmer comfort.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

  9. Re:Deliberate incompatibility by Kalium70 · · Score: 4, Informative

    Applle didn't adopt Objective-C. Objective-C came with the package when Steve Jobs returned to Apple and brought NeXTSTEP/OpenStep with him from NeXT. Objective-C is an attempt to graft SmallTalk style object oriented programming onto standard C without breaking too many other things.

  10. What I like ... errrm, respect about Apples Swift by Qbertino · · Score: 4, Insightful

    What I respect about Apples Swift (not to be mistaken for the other PL Swift) is that it/Apple doesn't claim Swift to be anything other than it actually is. An improvement on PLs already exisiting in Apples Ecosystem tailored *specifically* for developing in that ecosystem, catering to the preferences and addressing the pet peeves of their developer community. AFAICT with no downsides and measurable upsides if you intend to develop native iOS Apps exclusively.

    *This* all IMHO is a new lock-in PL done right - as far as you can do those right.
    contrary to all the lies, damn lies and hideous marketing bullshit that went into the .Net/C# mess.

    Apple did it right again in the way that they actually let the engineers take care of the language, the designers layout a nice free iBook on it and basically kept marketing out of it. ... Not that Apples marketing is really that bad.

    If I ever do native iOS development and embrace the golden cage, I might even look into it - the syntax does look less scary than that of the classic C family.

    My 2 cents.

    --
    We suffer more in our imagination than in reality. - Seneca
  11. Re:Deliberate incompatibility by Anonymous Coward · · Score: 2, Informative

    It was probably 5-10 years from the NeXT acquisition until Objective-C became mainstream in the Mac development community. It was all C++ and Carbon until then.

  12. Re:Your post is a non-sequitur. by putaro · · Score: 3, Interesting

    The point being that Apple didn't adopt Objective-C just to be weird. Next used Objective-C to build NextStep and there's certain things in Objective-C that made NextStep moderately cool.

    I actually worked at Apple, on the operating systems team, around that time. Apple was in no position to be arrogant in 1997 and wasn't actively looking for ways to be incompatible. Today, that's a very different story.

  13. Re: Feel Free to Open Source your Own Code by kthreadd · · Score: 2

    It's an argument for why Apple should do it, not that Apple must do it.

  14. Let me try fixing the summary for you by halivar · · Score: 2

    Faster innovation, better security, new markets — the case for opening Swift (an innovative new programming language for Cocoa and Cocoa Touch [high-level APIs that make it easy to create OS X (a series of Unix-based graphical interface operating systems developed and marketed by Apple Inc.) apps (applications; computer programs that run on PC [personal computer] or mobile device) with just a few lines of code (collection of computer instructions written using some human-readable computer language, usually as text)]) might be more compelling than Apple (American multinational corporation headquartered in Cupertino, California, that designs, develops, and sells consumer electronics, computer software, online services, and personal computers) will admit, writes Peter Wayner (contributing editor of the InfoWorld Test Center and the author of more than 16 books on diverse topics including open source software, autonomous cars, privacy-enhanced computation, digital transactions, and steganography). "In recent years, creators of programming languages (a formal constructed language designed to communicate instructions to a machine, particularly a computer) have gone out of their way to get their code running on as many different computers as possible. This has meant open-sourcing (applying an open-source [a development model promotes a universal access via a free license to a product's design or blueprint, and universal redistribution of that design or blueprint, including subsequent improvements to it by anyone] license [authorization to use intellectual property] to) their tools and doing everything they could to evangelize their work. Apple has never followed the same path as everyone else. The best course may be to open up Swift to everyone, but that doesn't mean Apple will. Nor should we assume that giving us something for free (as in beer) is in Apple's or (gasp) our best interests. The question ( linguistic expression used to make a request for information, or the request made using such an expression) of open-sourcing a language like Swift is trickier than it looks."

  15. Re: Apple not in my best interests either by Bogtha · · Score: 5, Informative

    Some has contributed a nontrivial amount of work to LLVM and especially the clang project.

    To be clear: Apple aren't just a contributor, they created Clang and employ one of the LLVM project's founders to work on LLVM, Clang, and Swift.

    --
    Bogtha Bogtha Bogtha
  16. Article shows fundamental lack of understanding by cornicefire · · Score: 2

    "We have no plans to do anything like that. Swift is a new option for developing on the platform. We have no plans to drop C, C++ or Objective-C. If youÃ(TM)re happy with them, please feel free to keep using them."

    https://lists.apple.com/archiv...

    "Swift is Apple's modern, type-safe language for Cocoa development But Objective-C remains a first-class citizen too"

    http://devstreaming.apple.com/...

    Seems like it's not meant to supplant but to live alongside it.

  17. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  18. One thing Swift will address... by tlambert · · Score: 3, Informative

    One thing Swift will address... There are currently 3 memory management models in use in Objective-C, and for some of those models, you don't get a retain count automatically (for example, this is the case for a number of collection objects when doing an insertion).

    Swift has the opportunity to rationalize this, which is not something you could do with the Objective-C libraries themselves, since doing so would change historical APIs and thus break old code.

    It wasn't really until Metrowerks basically became incompatible with the Intel switchover and the 64 bit support had to drop certain types of support from Finder due to 64 bit inode numbers, and while I happily would have made them new header files so that they would have continued to work with the UNIX Conformance work, where Ed Moy and I basically broke their local private copies of their header files, since Motorola sold off the Intel version of the Metrowerks C the week because Apple announced Intel, it was pretty much DOA at that point.

    So it basically took an Act Of God to get some people to get the hell off some of the old APIs we had been dooming and glooming about for half a decade.

    Swift is another opportunity for that type of intentional non-exposure obsolescence to clean up the crappy parts of the APIs and language bindings that haven't been cleaned up previously due to people hanging onto them with their cold, dead hands. Hopefully, they will advantage themselves of this opportunity.

  19. The FSF overreached with GPL v3 ... by perpenso · · Score: 5, Interesting

    Yeah, but as I recall wasn't the whole reason for clang that they wanted to stop using GCC, as it's truly free software? Perhaps my recollection is incorrect.

    Or perhaps you are viewing things through political filters.

    Apple, and others, stopped using the "truly free" gcc because GPL v3 became quite restrictive.

    The FSF overreached with GPL v3, they tried to be too forceful, they overestimated their importance and irreplaceability. The market responded by moving towards LLVM, a less restrictive option.

    1. Re:The FSF overreached with GPL v3 ... by phantomfive · · Score: 2

      They were primarily worried about the patent clause in the GPL3.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:The FSF overreached with GPL v3 ... by phantomfive · · Score: 2

      Under GPL2, It was perfectly happy to pick and choose from among the Free software it wanted, occasionally throwing back some incidental patches and libraries here and there.

      That's not legal. Under the GPL2 they must release all changes they make to any binary they release (and Apple did release their changes). You're going to have to re-think your hypothesis.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:The FSF overreached with GPL v3 ... by EmeraldBot · · Score: 2

      > Apple, and others, stopped using the "truly free" gcc because GPL v3 became quite restrictive.

      There's nothing in there that should scare off anyone. If someone is bothered by the GPL3 in a project like C++ compiler, then you should be very suspicious of their motives. They clearly aren't interested in playing nice or being a good citizen.

      They clearly want to be free to f*ck you over later.

      Go tell that to the BSD guys. No, they don't want to screw you over, their definition of freedom differs. To them, freedom is defined as having as absolutely few restrictions as possible. GCC vs Clang is a perfect example. GCC is intentionally made as opaque as possible to prevent you from working around it, and it's far worse in this respect then many of the proprietary compilers. Clang is more interested in being as useful to the user as it can. If you really want it summed up in one sentence, here it is: GNU projects put the license first, functionality second. THAT's what drove Apple (and pretty much everything other then Linux) away from GCC, not "They clearly want to be free to f*ck you over later".

      --
      "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
  20. Re: Apple not in my best interests either by Bill,+Shooter+of+Bul · · Score: 2

    I've heard Apple uses it....

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
  21. Re:I hope it crashes and burns by Vitriol+Angst · · Score: 2

    Well doesn't Objective C lock a developer into a single platform? Where else are these iOS apps going to run without a recompile and platform dependencies?

    Is the Java based Android running apps on other platforms like iOS or Microsoft's?

    The Open Phone platform is either low performance apps with middleware, or a Unicorn parade. I do see that you should be careful of lockin -- but isn't everyone already locked in anyway?

    --
    >>"ad space available -- low rates!!!"
  22. Re:Please no by iluvcapra · · Score: 2

    enum Vertigo {
      case Uni
      case Dos
      case Tres
      case Catorce // FIXME
    }

    --
    Don't blame me, I voted for Baltar.