14 ms·
“Swift will be open source later this year”
- therealmarv 11y agoSwift.net ? What? No Windows version? Why? ;)
- ckok 11y agoSwift already works on .NET (and Java for that matter) http://elementscompiler.com/elements/silver/ http://elementscompiler.com/elements/silver/
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- Animats 11y agoNo, Apple announces they intend to open source Swift at a future date. That's not the same as doing it.
- coldtea 11y agoAs far as HN comments go, this one sets a pretty low bar. Is there even one doubt that this will happen? If not, the pedantic distinction between "announce they intend to" and "doing it" is extremely worthless...
- apayan 11y agoApple also said they would make FaceTime an open and interoperable protocol "later this year". So being sceptical of Apple's promises of openness are justified.
- BrainInAJar 11y agoit's only June.
- hav 11y agoBy "later this year" he means the year that FaceTime was first introduced (2010).
- coldtea 11y agoFor the nth time, this wold put on hold after a patent dispute.
- bryanlarsen 11y agoHis comment is older than any of the comments mentioning the lawsuit.
- Karunamon 11y agoIt's still uninformed crap that implies Apple reneged on a promise, when in reality they were forcibly stopped.
- piyush_soni 11y agoThe fact still remains that Apple made a big promise without analyzing all the legal aspects of it. Most average to big size companies do the reverse of it - Make sure the legalities are in their favor before making big announcements.
- Karunamon 11y agoAre mistakes not possible in your world? Somehow I doubt even an exhaustive legal analysis would have turned up a patent troll. (Kind of characteristic of patent trolls, really)
- 11y ago
- bryanlarsen 11y agoWe've been waiting ~5 years for the facetime open standard, so yes, there is some doubt.
- Alphasite_ 11y agoLawsuits tend to put a dampener on things, so there is that.
- coldtea 11y agoFacetime faced a patent lawsuit, and Apple had to change how it operated (to have it relay through its serves), making not that great as a direct communication standard.
- cmyr 11y agoI think this is one of those situations where the fact that they've failed to deliver in the past makes them far more likely to deliver this time.
- mikeash 11y agoThat was a last-minute uninformed decision about a completely new product. Swift's open sourcing is clearly planned ahead of time and has actual the full backing of the company.
- Animats 11y agoApple's Dylan language is now open source.[1] It's abandonware, but it's open source. (Jobs: "It's dead. We killed it.") The obsolete Macintosh Programmer's Workbench is also open source now. When Apple open sources something, it's usually because they're abandoning it. [1] https://en.wikipedia.org/wiki/Dylan_%28programming_language%29#History https://en.wikipedia.org/wiki/Dylan_%28programming_language%... [2] https://en.wikipedia.org/wiki/Macintosh_Programmer%27s_Workshop https://en.wikipedia.org/wiki/Macintosh_Programmer%27s_Works...
- steveklabnik 11y agoDylan may be abandonware from Apple, but OpenDylan is still actively worked on. BruceM gives weekly status updates over at Lobsters.
- coldtea 11y agoThat's not even wrong... Open source Dylan was open sourced by a company called Functional Objects. The Macintosh Programmer's Workbench was never open source to my knowledge. Since both of these are semi-obscure and incorrect it's obvious that you've just cursory searched for stuff you don't have direct knowledge of just to bass Apple (which has open sourced several things as well as provided changes back to the community, and not just when the license forced its hand).
- Animats 11y agoAh, fanboys. MPW used to be available from "ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./", but Apple took their FTP server down. There's still a mirror.[1] It's mostly ".hqx" files, so you need to find something that can decompress old Stuffit files. [1] http://staticky.com/dl/ftp.apple.com/developer/ http://staticky.com/dl/ftp.apple.com/developer/
- mikeash 11y agoThat site hosted free downloads of the thing, but as far as I know the source code was never released.
- Redoubts 11y agoBut the future date is pretty soon, and they call out Linux as an explicit target.
- bsimpson 11y agoYou mean like when they said they were going to release the spec for FaceTime to the standards bodies the week after it was announced?
- serve_yay 11y agoYou guys gotta be kidding me with this shit. It's exactly as it says on the tin, Apple announced that they will open source it.
- deleted 11y ago[deleted]
- sondr3 11y agoWell whaddaya know, I like the direction this is going with both Apple and Microsoft.
- shmerl 11y agoI'll second that when Apple and MS will support Vulkan on their OSes and open codecs in their browsers. Or to put it another way, when they'll stop using sickening lock-in to make life harder for everyone.
- pjmlp 11y agoThey support Unreal and Unity. Much better than supporting an API that requires 600 LOC for drawing a triangle and isn't available anywhere besides the reference platforms.
- shmerl 11y agoSupporting particular engines does not equal supporting open standards. It's not any better than zero rated services with ISPs. I.e. why should Apple or MS be gatekeepers for what engine should work and which shouldn't? Apple at least is interested in Vulkan to some degree (they participate in Khronos). Whether it will show up on iOS is another question. But MS didn't show any interest. So claims that they changed their ways are premature.
- pjmlp 11y agoSo they just replaced OpenGL accelerated graphics stack by Metal and are still stuck on OpenGL 4.1 with lousy drivers. Does this sound like a company that will embrace Vulkan, or a company joining the likes of Microsoft, Sony and Nintendo?
- shmerl 11y agoThey started working on Metal before they knew AMD will give Mantle to Khronos to make Vulkan. So the open question is, whether Apple will support Vulkan or will sabotage it in order to preserve lock-in. Unlike MS, Apple participates in Khronos Vulkan group if I'm not mistaken. Even Sony does. No idea about Nintendo.
- LesZedCB 11y agoI remember a thread on HN [1] from a few months ago talking about how apple was never going to do this. I'm so glad they were able to pull it off! Good for you, Apple! [1] https://news.ycombinator.com/item?id=8488808 https://news.ycombinator.com/item?id=8488808
- chc 11y agoThey haven't pulled it off yet. They've just finally stated that they intend to do so, not actually done it yet. Prior to this, they hadn't even said it was on the table. So, progress, but they still haven't pulled it off.
- abuzzooz 11y agoThey said it will happen by the end of 2015.
- chc 11y agoWhich is still not "pulling it off", which is my point.
- artursapek 11y agoI think the "pulling it off" here is coercing their megacorp organization into tolerating the idea of open-sourcing something they poured so much time and money into developing. This is also why people have been celebrating Microsoft open sourcing things recently.
- brudgers 11y ago"By the end of the year" perhaps suggests that Microsoft got out in front and Apple's hand has been forced into changing their roadmap. I suspect that Apple will struggle with to support cross platform development beyond tossing Swift over the transom. Supporting diverse execution environments is not their core competence historically.
- 0xCMP 11y agoIt also now supports Markdown in code comments
- gtrubetskoy 11y agoThis places Swift right along Golang and Rust as the new interesting language.
- notsony 11y agoNot really. Depends on whether or not Swift's standard libraries and core APIs are all open-sourced.
- pat2man 11y agoTim Cook said they would be open sourcing the standard libraries.
- prewett 11y agoI'm assuming he's not talking about the GUI libraries, which would make it considerably less interesting. As far as I know C/C++ is still the only (free) way to write cross-platform mobile apps. If I can compile my apps on iOS and have them run on Android, then I am definitely interested.
- wlesieutre 11y agoDon't most swift apps also still drop to Obj-C? That will make them less portable.
- TillE 11y agoI think Rust fills a slightly different niche with its safety-first principle, but Swift should eventually be a really attractive choice for anyone building cross-platform stuff that also needs to run on iOS.
- melling 11y agoSwift has a huge advantage in that it's got a bigger community. It doesn't matter which language is the best. On StackOverFlow, for example, Swift has many more questions asked and answered. I've catalogued over 1000 blogs in the first year alone. http://www.h4labs.com/dev/ios/swift.html http://www.h4labs.com/dev/ios/swift.html All this makes it much easier to learn Swift in a short period of time.
- pibefision 11y agoMicrosoft open sourced .NET and I don't see queues of people willing to use .NET just because it's open source.
- zyxley 11y agoI dunno, C# on Mono already seems to be pretty popular.
- AustinScript 11y agoYou'll see people that all ready write .NET keep writing .NET though :) The ability to rent a cheap VM to run a C# MVC application is great! Previously, I only wrote C# @ work, now I have the ability to do it outside and in. No one wants to pay XX$ more per month to license windows on a VM(at least not for the hobby stuff I do outside of work for fun) I imagine it will be the same for iOS developers, it may not draw in new developers but there is a good chance that is may be used on projects that would've typically used a different platform simply because swift only runs on iOS. The language probably won't see an explosive growth in new developers but you will see swift being picked over another language in places it wouldn't previously run.
- fixermark 11y agoIt had significant impact on the game industry. With Unity adopting .NET as its scripting / game logic layer, quite a few games are actually based on .NET code (including the ever-popular rocket-science-in-a-box https://kerbalspaceprogram.com/ https://kerbalspaceprogram.com/).
- deet 11y agoThe open sourcing is not fully complete yet. See https://github.com/dotnet/corefx-progress https://github.com/dotnet/corefx-progress. Some of us have been waiting for a production-ready way to run .NET on Linux and although it is coming it has not arrived yet.
- ajross 11y agoTo be clear: Apple promises they will open source Swift "later this year". There's no source yet.
- threeseed 11y agoApple has a precedent for open source technologies like this. And let's be honest Swift is great and all but it's hardly the crown jewels of the company they are giving away.
- chimeracoder 11y ago> Apple has a precedent for open source technologies like this. They also have a precedent for being less than friendly towards FOSS[0][1][2][3], despite the way they try to present themselves otherwise by listing their open source contributions prominently. Note that the author of these comments, saurik, is Jay Freeman, the creator of Cydia. Key quotes include: > Apple has simply never been in compliance with the LGPL [for WebCore]. > As for Oracle, I think Apple is much more harmful [to open source] > I have gotten so used to Apple giving open source the finger, and thereby have backup plans involving disassembles for most of the things I care about at this point, I had forgotten to even follow up on them failing to release anything [0] https://news.ycombinator.com/item?id=2083953 https://news.ycombinator.com/item?id=2083953 [1] https://news.ycombinator.com/item?id=2523784 https://news.ycombinator.com/item?id=2523784 [2] https://news.ycombinator.com/item?id=9377345 https://news.ycombinator.com/item?id=9377345 [3] http://www.saurik.com/id/4 http://www.saurik.com/id/4
- threeseed 11y agoThose are from 4 years ago. Something more recent would be useful. Especially since their contributions to LLVM, GCD, WebKit2 have been quite notable.
- chimeracoder 11y ago> Those are from 4 years ago. Something more recent would be useful. The most recent one is from 55 days ago...
- cpr 11y agoNice to see that Chris (Lattner) got his way. I chatted with him last WWDC right after the main Swift technical session, and he expressed the desire to open source it, but had no idea if he could get it through the powers that be. Supporting the standard libraries on Linux is certainly a surprise, though.
- guidopallemans 11y agoTim Cook didn't seem as enthousiast with announcing the open-sourcing compared to other announcements
- cpr 11y agoI disagree--Craig F announced it, and he was clearly moved.
- sjackso 11y agoSupporting Linux is a surprise, but I think it's a great move on their part. Think: How many iOS apps are frontends to a server API? And how many of those APIs are running on Linux servers? Swift on Linux means ~all the code for a client-server iOS app can be written in the same language.
- pjungwir 11y agoI've been wondering for a while now why no one builds an Obj C backend for their apps: https://news.ycombinator.com/item?id=9500855 https://news.ycombinator.com/item?id=9500855 Being able to deploy on Linux might be what it takes!
- themartorana 11y agoIt's exactly because of server support. I'd LOVE to write obj-c on the backend - libgcd and the dispatch syntax alone makes it worthy, not to mention ARC, the ability to write pure C inline (not in an unsafe block or the like).
- 11y ago
- deleted 11y ago[deleted]
- adriancooney 11y agoThis is absolutely crazy. Apple is taking a stab at Microsoft's new founded ideas. This is great. Let's the war rage.
- seivan 11y agoSwift on Rails, who's first :) ? I suspect Heroku are working on preparing for an out of the box build pack, but I guess they don't have access yet since it's out late 2015. At least I hope so, looking for a better Ruby replacement but I still like Rails.
- thibaut_barrere 11y agoYou should look at Elixir and Phoenix (http://www.phoenixframework.org/ http://www.phoenixframework.org/).
- roneesh 11y agoI never considered this! But it's fun to think about! I'm a bit naive about the environments languages have to run in... but if we have a web app framework in Swift, Servers in swift (as mentioned in comments above), and iOS in swift, doesn't that make Swift a JS replacement too?
- opaque_salmon 11y agoJavaScript's domain is mostly client side web browser scripting, and no language is close to throwing it off its throne. So no, JavaScript will always have its place.
- Lio 11y agoASM.js though makes languages with manual memory management relevant to web front-end work. Hopefully, Swift might be a good candidate for fast browser code.
- geocar 11y agoThey should call it Swift On Sails.
- supster 11y agoHaha, yeah though Sails is also a Rails like framework for JavaScript http://sailsjs.org/#!/ http://sailsjs.org/#!/
- dmritard96 11y agoI will surely be downvoted for speaking so off the cuff, but I haven't really enjoyed swift so far. How has the general developer reception been to the language, not just with respect to obj-c, but also to java or any other turing complete language?
- chc 11y agoYou'd probably get more upvotes if you didn't start out by complaining about hypothetical downvotes.
- indians_pro 11y agohe is stating what he believes will be true. i didn't read a complaint anywhere. in fact, i think he was implying how sure he was about his folliwing statments, as he was ready to post them inspite of the (expected) downvotes. expected things are, by their very nature, hypothetical until they come true or are proven false.
- narsil 11y agoI've seen the opposite be true most of the time (and I have showdead on)
- epmatsw 11y agoI enjoyed it well enough. Didn't feel quite mature (refactoring tools, error handling, etc) and optionals are still a little frustrating, but it definitely feels like it has potential.
- fleitz 11y agoSwift as a language is pretty great, however, the tooling and obj-c interop make it a pain in the ass. It's hard to realize most of the performance benefits when everything you're interacting with requires objc_msgsend or uses NSArray / NSDictionary. As well, it's far less 'scripty' than Obj-c. The type system in swift really leaves something to be desired in terms of typing types. The point of Obj-C was kind of to avoid writing the kinds of apps where a great type system would really shine, swift lets you build those kind of apps, but in my opinion most of the time we shouldn't be building them. Your project probably doesn't need 1,000 developers on it who need solid interfaces and type checking to make sure that everything is going according to the UML diagram. It probably needs 2 or 3 developers who talk to each other, add asserts to their code, and a type system thats a little forgiving. ObjC is a language that has everything you really really need, and left out the 1 thing you kinda wanted in exchange for leaving out the thousand 1 little things that everyone else wanted too. Like for example exceptions, sure they're there, but it's not idiomatic and when you program without them you realize what a crappy idea they were in practice. In day to day coding NSError is 1000x better than exceptions.
- 0xCMP 11y agoI love how the biggest cheers in the past few conferences have been from open sourcing some major technology from a company.
- jkelsey 11y agoAnd it runs on Linux.
- baldfat 11y agoOpen Source wins! Seriously can't tell you the fights just 8 years ago in conventions with hundreds of librarians where most of them thought Free Software was the devil and hackers all had the key to destroying anything Open Sourced. So can we finally say that Hell has Frozen Over? Microsoft Open Sources Parts of Visual Studio and releases Linux Software. Apple open sourced their language and it will work on Linux.
- honest_joe 11y agoOpen Source did not win. In fact it destroyed a lot of potential markets. With this move Apple is dragging more and more developers that would be interested in Go/ Java (aka Android world) to its net. This is a win for Apple only.
- X-Istence 11y agoWouldn't it be cool if Google picked up Swift as a possible language runtime for Android?
- fixermark 11y agoPart of me says that any ecosystem that can be 'destroyed' by something as simple as near-zero-cost copying of product should never really have been a 'market' to begin with. We don't hear a lot about the sunshine or oxygen markets.
- gress 11y agoWe do actually. It's called the real estate market, and Sunshine and Oxygen are built into the pricing.
- baldfat 11y agoI am strongly Anti-Apple biased and I fail to see how Apple Open Sourcing is a win only for Apple? This is a ligament proof of the power that Open Source has. Now the deal with Metal and its possible hurting of the Linux game market, since they will move away from OpenGL that is another story. Apple is now going to use USB-C connectors and now Swift is available in Linux?
- jimmy0x52 11y agoApple also announced their intention to make FaceTime an open standard. Don't hold your breath.
- Alphasite_ 11y agoThat was on hold for legal reasons.
- itg 11y agoWell they also announced they would open up ResearchKit and that happened.
- coldtea 11y agoThat's because the direct FaceTime communication was prevented by a patent lawsuit by a company called VirnetX. Apple adapted how Facetime works to meet their demands, but that meant that Facetime wasn't the same anymore.
- emehrkay 11y agoSwift interfaces with C and Objective-C natively right? I can't wait to see web servers written with it.
- cmyr 11y agoI'm very excited to write web servers in it. I think this is probably how open sourcing it was sold, internally; that it would allow people to develop their entire infrastructure using apple's technologies.
- McElroy 11y agoI think they have two primary reasons for open sourcing it: 1. Being able to upstream more into LLVM means less maintenance of their internal forks. 2. The recent open sourcing of Microsoft .NET core parts.
- meburns 11y agoWhat a time to be alive :D
- matthoiland 11y agoSo, who's gunna write the first HTTP library for Swift?
- candl 11y agoSeeing as Objective-C has never took off on non Apple platforms (and is not any useful without Cocoa APIs) why would Swift be an exception?
- adamors 11y agoKeynote said it will run on Linux in late 2015.
- doublextremevil 11y agoHe's not disputing that. Objective C has been able to run on Linux for years. Essentially, nobody actually uses Objective C on Linux even though they technically could. The same will probably be true for Swift.
- udev 11y agoThank you Microsoft for this.
- yjgyhj 11y agoPeople who talk about swift compare it to Rust and Go. I can see how the syntax is to ObjC what Go is to C++. Else but that, in what way is Swift anything like Go or Rust? To me (someone who does Lisp & JS, so none of these all) go seems cool for concurrency and being 'boring' (in a great way). Rust seems cool for being very robust and 'safe' (or hard to screw up with), while still doing concurrency nicely and letting you code in high and low level. Is there any ways that Swift is more than ObjC without [[[[all] the] square] brackets]? (nothing wrong with that, if you're not into square brackets)
- gdubs 11y agoIt's very familiar to Objective C but also very different. Strong type system and generics as well as functions being first class citizens add up to make it a great language. My only complaint is the IDE support, which is bound to improve.
- chadzawistowski 11y agoObjC is really just plain C, plus some Smalltalk-like semantics within the square brackets. This means you end up with all the "footguns" of C, plus dynamic OO behavior. Swift is like Rust in that it's intended to be fast, "safer", and compiles to LLVM bytecode. Also, Swift and Rust both use Option types for error reporting rather than exceptions or error codes. In the same sense that Rust is a way to leave behind old C++ baggage, Swift is a way to leave behind old ObjC baggage such as header files, null pointer errors, and lack of real namespaces.
- cmyr 11y agoI wouldn't say optionals are necessarily for error reporting. According to this slide[0], actually, we're going to be getting a proper error-handling model in Swift 2— we'll hear more either today or tomorrow. [0] http://www.apple.com/live/2015-june-event/eda6e3f7-0fda-4b46-b428-94b7ac62cdec/ http://www.apple.com/live/2015-june-event/eda6e3f7-0fda-4b46...
- ptomato 11y ago
- ffk 11y agoAny word on whether any of their standard APIs will also be released open source?
- mmrasheed 11y agoThis is by far the most impressive news in this WWDC to me. Wouldn't it be great if swift can break into the complexity of android development and bring simplicity and elegance in it!?
- 20kleagues 11y agoI spent 10 minutes looking around for their github page haha but apparently it will only be open-sourced later this year. But the opening up of APIs for Linux is certainly very refreshing news.
- Someone 11y agoDid they tell under what license? If they really want to mess things up, they would choose GPL2 without the 'or later' part, but my guess would be BSD, but Apache and Apple's Public Opensource License also are possible (http://www.opensource.apple.com/apsl/ http://www.opensource.apple.com/apsl/).
- eosrei 11y agoI'll be surprised if it is anything other than ASPL. ASPL isn't GPL compatible. Any GPL compatible license would be great.
- tjl 11y agoI'm fairly certain it will have the same license as LLVM given Swift's creator.
- ptomato 11y agohttps://developer.apple.com/swift/blog/?id=29 https://developer.apple.com/swift/blog/?id=29 says OSI approved permissive license.
- whoosy 11y agoSwift will probably be integrated into LLVM which uses a mix of MIT and BSD called NCSA. http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Ope...
- rsynnott 11y agoThey said "permissive". APSL is far from permissive.
- bachmeier 11y ago> Swift will be open source later this year, available for iOS, OS X, and Linux. They're doing Linux but not Windows? Is Windows not sufficiently important or maybe they just forgot to include Windows in the announcement?
- oddevan 11y agoMy guess is they're using Linux in their datacenters and want to be able to write programs for them in Swift. That, or they figured that's where all the "Open Source" action is going to be/an "Open Source" language without Linux support is useless.
- kristofferR 11y agoThey don't just forget stuff like that. It was probably way easier to do on Linux/Unix than Windows.
- astrodust 11y agoPOSIX to POSIX is way easier to get production ready than porting to the Windows API.
- be5invis 11y agoMaybe it is just because WINAPI is different from *nix.
- fixermark 11y agoAh, interesting. I've suddenly gone from "Not caring at all about the existence of this language" to "Mildly intrigued." It's amazing what some opening of control will do.
- BinaryIdiot 11y agoI'm hopeful but until I see a license and what is and isn't opened sourced I'm going to be reserved.
- cpr 11y agoOne imagines it'll be liberally licensed like LLVM, which Chris Lattner also BDFLs. And they said it would be the compiler and the runtime for OS X, iOS, and (surprisingly) Linux.
- whoosy 11y agoI think it's most likely going to be integrated into LLVM so you are probably right.
- ptomato 11y agoOSI-approved permissive license, per https://developer.apple.com/swift/blog/?id=29 https://developer.apple.com/swift/blog/?id=29
- zak_mc_kracken 11y agoThere is no opening of control, just opening of source. You can be sure Apple will remain the exclusive ruler of what goes into Swift.
- fixermark 11y agoI don't doubt it. But as Iceweasel reminds us, with opening of source, dissent is just a fork away.
- BinaryIdiot 11y agoHmm they said they wanted Swift used everywhere for the next 20 years, they're going to make it open sourced and provide builds for iOS, Mac and Linux...but not Windows which is one of the largest operating systems in the world? I'm guessing they really don't want it used everywhere. Though knowing Microsoft they'll take Swift and implement support for it in Visual Studio.
- candl 11y agoMicrosoft is actually building an Objective-C runtime for Windows 10 aka Project Islandwood as a bridge for iOS apps to run on Windows. https://dev.windows.com/en-us/uwp-bridges/project-islandwood https://dev.windows.com/en-us/uwp-bridges/project-islandwood https://news.ycombinator.com/item?id=9471204 https://news.ycombinator.com/item?id=9471204 So ironically this announcement might benefit Microsoft a lot.
- JustSomeNobody 11y agoAnd if I were Apple, I would not have a problem letting MS foot the bill for the development costs. :)
- JustSomeNobody 11y agoBecause they are probably thinking more in terms of iOS and Android.
- s73v3r 11y agoThey don't really use Windows themselves. They ported it to the platforms they use. Let someone else, probably Microsoft, do it.
- callmeed 11y agoSo ... what will they call the Swift MVC framework? Swift on Stilts?
- mitchty 11y agoSwift on swiffers
- rohunati 11y agoSwift on Sails
- jpmcglone 11y agoHmmm.. Swift on Slabs
- BuckRogers 11y agoSwift on Stiffies
- vyshane 11y agoForget about RoR clones. I want Swift/OTP or Akka.Swift!
- tosseraccount 11y agoAside from graphics/GUI programming; there is little advantage to Objective C or Swift. The "language" may be "open sourced"; but will the important Cocoa implementations be open sourced? It shouldn't be to too tough to re-implement Swift; unless Apples starting suing people for doing it. The exact meaning of Apples announcement needs some clarification.
- zethraeus 11y agoThe language itself is lovely. What parts of cocoa feel essential to you?
- seivan 11y agoActually, if you want to do backends, nothing is essential from Cocoa itself. I think Foundation might be necessary though, even if you just use Swift structs (Array, Dictionary, etc)
- oddevan 11y agoThis. I'm SUPER excited to have a Swift backend for a web app, and/or I've been toying around with the core logic of another app. Either idea doesn't need anything in the way of GUI, just the standard library and maybe a few things from Foundation that should be in the standard library anyway (like pseudorandom number generation).
- tosseraccount 11y ago"Essential" ? Any of the objects that can give a "dashboard" interface and maybe draw a picture. I'd love a portable GUI API that satisfies some harsh conditions: 1) Portable between mac,linux,windows,android,ios. [ must re-compile to target ] 2) Compilable into a single static binary. 3) New developments don't break backwards compatibility.
- yarrel 11y agoI'm unfamiliar with Swift but Objective-C is an excellent language. I much prefer it to C++. Cocoa won't be made Free, no, but perhaps Swift could be used with GnuStep's implementation of the libraries. It's better to not re-invent the wheel.
- honest_joe 11y agoAny predictions how this can hurt RoR,nodejs and the others ?
- Frenchiie 11y agoWell Node.js(+Framework) is an entirely different beast from Swift(+Framework), RoR, Python+Django, etc. As for Swift(+Framework) vs Python+Django, RoR, etc, Swift would have to be faster and introduce some amazing new feature for it to replace anything. I dont personally like how Swift is statically typed but does type inference. If i dont specify a type for my variable i should be able to change my variable's value to whatever type i want.
- alkonaut 11y ago> If i dont specify a type for my variable i should be able to change my variable's value to whatever type i want. You mean you want to assign a string to a variable and then re-assign it to something else entirely such as a number? Just reassigning at all is dubious in my opinion, and seeing a reassignment with a completely different type would make me flip the table in review. If you ever want a "catch all" variable you can then explicitly type it as a base type like "object", and assign what you want. But that should be very rare, so it's perfectly natural that type inference assigns a static type to the field. The only time you get bad inference is if you have subtypes and the first assignment is too narrow, e.g Apple GetApple() { ... } var myFruit = GetApple(); // type is Apple if (cond) myFruit = GetOrange(); // can't assign orange In this scenario you have to declare explicitly as Fruit. But again: this is rare, and all reassignment should be rare! Always have good reason before mutating anything.
- aikah 11y agoStupidest argument i've ever heard in favor of javascript. > If i dont specify a type for my variable i should be able to change my variable's value to whatever type i want.
- Frenchiie 11y agoNot really.
- heropotato 11y agoCan't wait to see more IDEs support Swift across operating systems.
- wiremine 11y agoApple explicitly said they see Swift as a systems language... curious what people thing about that. Does it compete with C/Rust, or is it just a pipe dream/marketing message?
- fleitz 11y agoIt's designed to give it hype, it's not a systems language. The first question you should ask for any systems language is how to I integrate assembler, when the answer is to use C / C++ then you know it's not a systems language. Also, how you can tell a language is a systems language, it has an operating system written in it used by a large user base. How do you layout a struct in Swift so that it's the exact size and layout you want? You can't, again, not a systems language. It's like going to Home Depot and buying "industrial grade" appliances which are usually just your standard shitty appliances with a stainless finish.
- wzdd 11y agoTo be fair, you don't have complete control over struct memory layout in standard C, either, and C is certainly a systems language. The compiler can choose to add padding where it likes. Pragma pack, attribute(packed) etc are compiler extensions. Edit: You can also link against .o files with Swift, which is the only sane way to integrate assembly language anyway (i.e. in a separate compilation unit).
- asveikau 11y agoI don't know if you are talking about swift only, but with GCC or clang working in C, inline asm is a lot more pleasant than another object file. More efficient too. (Unless you like that your code makes a pointless jump to run a single instruction and jump back.) You can contrast this with the Microsoft compiler which won't do inline asm on ARM.
- Tloewald 11y agoTo write an OS you simply need to be able to compile code that can be launched by a bootloader. That's it. You don't need explicit control over the layout of your data structures in memory. I'd hazard that the engineers at Apple are perfectly qualified to identify what is and isn't a "systems language" working for one of the few companies that has actually developed several from scratch (I am referring to A/UX, Mac OS Classic, Newton OS, and NeXTStep / OpenStep / OSX / iOS in case you're wondering).
- noobie 11y agoThis means developers don't have to be on OSX to make iOS apps?
- deleted 11y ago[deleted]
- mcphage 11y agoDon't get me wrong, that book sounds interesting, but... what?
- markque 11y agoThis could be a prelude to Apple offering their own Cloud services like AWZ or Azure, they need a standard backend Language that runs on traditional server OS's. Regardless being able to implement backend and apps in one language is huge.
- sarciszewski 11y agoMy sentiment can be summed up as: "Meh. It's still Apple." I've never had a good experience with an Apple product.
- stock_toaster 11y agoHoping that at some point it gets ported to FreeBSD too!
- tachion 11y agoMost likely it will - some talking about that was already happening on IRC ;) However, its a bit shame, that company that gets so much from BSD's (OSX userland is FreeBSD derived) have not decided to give such a thing back.
- frik 11y agoGreat, that Apple will open source Swift 2. I hope I can use an Win32/64 community port on Windows 7 next year. Go, Rust, Swift, JavaScript and Julia - a really great time. Thinking back a few years, there were no new mainstream languages for about one decade (ca. 2000-2010).
- rectangletangle 11y agoNice, Swift just became 10x more interesting to me; especially since it'll run on Linux. A Pythonesque statically typed language server-side could be handy.
- vhost- 11y agoYeah, I agree with this. I'm a Go programmer, but I instantly became interested in learning Swift as a secondary mobile language and might even write an iPhone app.
- aerovistae 11y agoCan someone explain what it means for a language like this to be open source? I sort of get it for Python, means you can download the C files and mess with them. But isn't Swift written in like Assembly?
- robgibbons 11y agoIt's potentially great news. It means I potentially don't need to own a Macbook Pro and use XCode just to build apps for iOS. Fuck that shit.
- rhodysurf 11y agoNot necessarily. Objective C is open and available on other platforms but you still need Apple Hardware to compile for iOS. I think the biggest issue here is the Cocoa libraries and the signature process.
- s73v3r 11y agoUmmm, you still need a Mac to do so. Just like you need Windows to make Windows apps.
- marvel_boy 11y agoOpen Source, this is indeed a very good start.
- TheBiv 11y agoI wonder where the official open source repo will be hosted?
- steveklabnik 11y agoThis is a pretty interesting question: Microsoft has CodePlex, but has also been using GitHub quite a bit lately. Will Apple put Swift as part of http://www.opensource.apple.com/ http://www.opensource.apple.com/, or start using GitHub? https://github.com/apple https://github.com/apple seems to be squatted...
- delinka 11y agoHow can you tell that's a squatter and not Apple?
- steveklabnik 11y agoSorry, I didn't mean to make that distinction, I just mean that _someone_ has control over this username.
- ryanworl 11y agoOn Github, surely, where they are already hosting ResearchKit.
- lyinsteve 11y agoLLVM has a GitHub mirror, too. https://github.com/llvm-mirror/llvm https://github.com/llvm-mirror/llvm
- markque 11y agoDoes swift have a good package manager/library ecosystem? I think any new language should have this from the start.
- codesushi42 11y agoNo. The closest thing is Cocoapods, which is great. But as the name implies, it's meant for Cocoa compatible libraries.
- chourobin 11y agoCarthage is also the new kid on the block by the guys at Github.
- pixelmonkey 11y agoSurprising, but good news. When Swift was originally announced, I suggested on HN that if they didn't open source it, long term, it would go "the way of Flash" -- eventually, developers would abandon it in favor of more open platform technologies. https://news.ycombinator.com/item?id=7851583 https://news.ycombinator.com/item?id=7851583
- freshyill 11y agoThat's a completely apples-to-oranges comparison. Open-source or not, Swift will eventually supplant Objective C for most purposes on Apple's platforms.
- shmerl 11y agoHow does it compare to Rust?
- norman784 11y agoI will love to see how Android apps will be written in Swift, not because its an Apple language, just because I didn't like Java at all (don't know the Oracle Java but the Java supported by Android lack of some features of an actual language). Also the first challenge will be to build a library that implement all the Swift UI elements to Android (or vice versa) or better Google reinvent their UI or at least add more features and turns Android in a real MVC (bind the view with the controller).
- achalkley 11y agoMaybe Apple Music is!
- codesushi42 11y agoFor game devs, hopefully we can look forward to Swift support in Unity then. C# and Booscript are fine, but I'd welcome a language that puts the tool closer to iOS development.
- joeld42 11y agoThis is great news.
- menghang 11y agoI agree.
- joeld42 11y agoThis is great news.
- alkonaut 11y agoFunny, for years people said Microsoft was Copying Apple. We'll never know but I can't help thinking that Microsofts recent push to open source dev tools and languages at least made this happen sooner than it would have. It's a great time to be a developer.
- pluma 11y agoAlso, MS was copying Apple was copying Linux. Except Apple usually added more polish and MS usually botched it up.
- jophde 11y agoPlease for the love of all things holy please stop saying Swift would be great for Android or that Google is porting Go to Android. As an Android developer for the past four years I can assure you that there is zero evidence that Google is moving the Android FRAMEWORK to Go. There aren't even any plans to support lambdas and Java 8. Also, pretty much everyone on the bleeding edge of Android is planning on moving to Kotlin. It has even more higher level and functional abstractions than Swift or Go, full interoperability with Java (even in the same file), and almost no performance hit.
- myko 11y ago> There aren't even any plans to support lambdas and Java 8. https://android-review.googlesource.com/#/c/150214/ https://android-review.googlesource.com/#/c/150214/ Looks like there is someone at Google working on lambda support.
- jophde 11y agoMaybe but this won't ship until at least M so if you min SDK is even as new as KitKat it won't help you much. Kotlin gives you lambdas, named parameters, extension functions (like C#), data classes, first class null, and more today on all versions of Android.
- jordanthoms 11y agoI think that most of the Java 8 features will be implemented in Jack, the new compiler they are working on (which is likely why the current toolchain has not seen much improvements). Most of them shouldn't need bytecode level changes. That said Kotlin looks awesome and I'll definitely be considering it for my next Android project.
- avinassh 11y agoAny apps which are written using Kotlin, are on Google Playstore? If yes, link?
- joshuak 11y agoI am very much against the way Cocoa & Cocoa Touch work (a "ViewController" is NOT!!! a controller in the MVC sense), and Interface Builder makes me want to take a high powered rifle to Cupertino, but Swift is definitely a winner now that it's going open source. I rebuilt a dysfunctional OS X application that was ported from iOS (obj-c) from the ground up almost entirely in Swift last year, and really enjoyed working in swift. It's worlds better than Objective C, and compares favorably with other modern languages like Go (which I also like and use quite a lot). It takes a minute and a bit of annoyance to get used to optionals, but that ends up being really nice for issues most languages let you shoot yourself in the foot on. Along with switch patterns, easy immutability, memory management, string handling, and Playgrounds/REPL make it a really pleasure. Even with that endorsement I couldn't recommend it seriously for anyone without being cross platform / open source. Now I can say I really think it's worth learning.
- joshuak 11y agoHaha, apparently down voters don't read entire messages. But yay last post! I win. :)
- wooster 11y agoThreatening to kill people isn't funny.
- joshuak 11y agoYou are absolutly right. Threatening to kill people would not be funny at all. Of course, humorous hyperbole on the other hand... I'm guessing you don't see a lot of sitcoms like Silicon Valley, Big Bang Theory, or comedians like Luis C.K., Sara Silverman et. al. Which is tragic, because they are awesome. Not, of course, to suggest I'm as funny as that (clearly), just someone who's providing observations on Sift from using it in real world production applications (unlike almost all of the posts above this one).
- foxhop 11y agohttp://youtu.be/Pm8P4oCIY3g http://youtu.be/Pm8P4oCIY3g this is a talk by Joyant's Bryan Cantrill where he make the case that announcing something is going to be open sourced in the future is bad and is an anti pattern.
- CrystalGamma 11y agoInterestingly this was the first thing that came to my mind when reading the headline ... Great minds think alike, as they say :D
- TYPE_FASTER 11y agoThis is great! I bet: * Swift will get ported to Android. * Swift will compete with Mono. * Xamarin will add Swift support to Mono.
- mtwebink 11y agoSo in theory does this mean we could be writing native Android apps in Swift?
- bane 11y agoI'll believe it when a) I see it b) Facetime becomes an open-standard like promised
- MichaelCrawford 11y agoWill Swift be an ISO or ANSI standard? Consider that while Objective-C is open source, Objective-C 2.0 was produced without any effort at all at standardization. I attended the 2008 WWDC. One of Apple's engineers was demonstrating Objective-C++ and actually said "You can freely mix objective-c and c++." I wanted to start screaming, maybe beat him senseless. I've done quite a lot of Objective-C, and quite a lot of C++ but I'm still not sure I can figure out how to mix the two.
- eridius 11y ago> I've done quite a lot of Objective-C, and quite a lot of C++ but I'm still not sure I can figure out how to mix the two. By using Objective-C++. Just name your source file with the .mm extension and Xcode automatically starts compiling it as Obj-C++. If you take Objective-C, remove all the C from it, and take what's left and slap that on C++, that's Objective-C++. And it really does work, and prior to Swift's announcement I thought it was the best approach to doing Cocoa development (because with ARC you can even put Obj-C objects into C++ data structures and do fun things like `std::vector<std::tuple(id,CGRect,NSInteger)>`).
- MichaelCrawford 11y agoAre you drunk?
- deleted 11y ago[deleted]
- wuyongzhi 11y agoSwift will be a server side programming language!
- wkcamp 11y agoQuestion: Does open source expose vulnerabilities in the security of the language?
- Synaesthesia 11y agoIt certainly helps people to find and patch vulnerabilities yes.
- tn13 11y agoI will not read too much into this. It is a programming language used only to make iOS apps. I dont think this gives benefit to anyone.
- niutech 11y agoFYI, there is already a free cross-platform implementation of Swift called RemObjects Silver. It works with .NET, Java and Android.
- menghang 11y agoHow to learn Swift?
- AlexeyBrin 11y agoStart by reading Apple's book on Swift https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html https://developer.apple.com/library/prerelease/ios/documenta...
- alblue 11y agoI wrote "Swift Essentials" which has 40% off he eBook with SWEE40 for the next couple of weeks. http://swiftessentials.org http://swiftessentials.org
- menghang 11y agoHow to learn Swift?
- philip1209 11y agoMuch of the sentiment here is about how Swift will drive iOS developers to write APIs in the language. I think the inverse is much more fascinating and creates greater business benefit for Apple: If developers start using Swift for interesting or prominent projects outside of iOS, then that drives people to learn Swift outside of the Apple ecosystem. This means that the barrier to learning and building iOS apps drops, and Apple gains more, potentially experienced developers writing code.
- alkonaut 11y agoWhat's the state of the/a standard library for Swift? When used on linux I hope I won't have to use types prefixed "NS..."?
- deleted 11y ago[deleted]
- BuckRogers 11y agoSwift for me is what Python3 should've been. For me as a Python user, this development is huge. I've been watching for the language to move to instead of Python3. Of Rust, Go, Swift and other new languages, Swift always seemed to me the most appealing language. Being the 1st class citizen on iOS makes learning this for serverside development very appealing. An ideal server language that enables single language client-server applications possible with iOS. Once the popular libraries start to drop Python2 support (which may take decades, who knows), this is a no brainer as the language to migrate to instead of moving to the much less robust Python3 ecosystem.
- scotty79 11y ago... or you could just move to coffeescript and have something even more clay-like than python running everywhere.
- pjmlp 11y agoMeanwhile on Mountain View, "here take Java 7 and be happy".
- giuscri 11y agoThus that means I can use my Thinkpad to develop an application using Swift? Or will I miss some features? I don't understand exactly ...
- chrisjohn93 11y agonice this will help all the developers.
- ermintrude 11y agoHa ha, great video :-)
- jheriko 11y agolet me see if i can find a shit to give about that...
- jokoon 11y agoIn other news I have a macbook pro I really need to sell to buy a thinkpad. Microsoft opened .NET, while apple is just releasing a language for its platform because mozilla and Google did too. While the latter opened sourced the languages. Microsoft is just getting out of their walled garden, while Apple still has a much stronger one, which is worse because they tie their software with their hardware, which is a really dubious practice in my opinion. I'm really starting to question the trial decision that made it illegal for developers to just run OSX on PCs. Either way we really need laws to prevent manufacturers to restrict other softwares from running on their hardware. I slightly hated microsoft but always loved their OS and at the time I did not care abut apple. But now do I hate them.
- TazeTSchnitzel 11y agoUh, Apple just weakened the walled garden. They allowed self-signed apps.
- jokoon 11y agoCocoa is still a walled garden api. At least microsoft used C and C++ like everyone did.