9 ms·
Introducing Swift
- api 12y agoSo they copied this idea for the IDE? http://www.lighttable.com http://www.lighttable.com
- judofyr 12y agoWell, LightTable was inspired by Bret Victor's ideas. He worked at Apple earlier.
- Alphasite_ 12y agoSeems a lot more like a call back to the Smalltalk roots of Objective-C.
- xendo 12y agoI think they were thinking about this even earlier: http://vimeo.com/36579366 http://vimeo.com/36579366
- enen 12y agoI cannot be any happier that they did.
- rawland 12y agoWas my very first thought, too. The next thought was Bret Victor. Yeah.
- be5invis 12y agoLooks like C# with .NET Native, some sort of. Playground is interesting.
- _random_ 12y agoMinus awesome IDE with automated refactoring.
- lsllc 12y agoLooks a lot like golang meets haskell: func makeIncrementer() -> (Int -> Int) EDIT: Why the downvotes? was just an observation not a criticism. Looking forward to using it instead of Objective-C.
- Xorlev 12y agoLooks like they pulled a Golang: http://swift-lang.org http://swift-lang.org
- davidcbc 12y agoYou do realise that link is completely unrelated to what Apple is doing, right? EDIT: Nevermind, my mistake. I thought the comment was about Apple was making their own language like Google did with Go, not Go! already existing as a language
- sp332 12y agoYeah, that's the point. There's already a programming language called Swift but Apple is using the name anyway.
- pimlottc 12y agoThat's precisely his point. There was already a pre-existing (but little-known) language called Go when Google announced theirs.
- davidcbc 12y agoGotcha, my mistake. I thought the point was Apple was making their own language like Google did with Go and he was just linking the wrong language.
- mhw 12y agoThey do include a link to the other swift at the bottom of the page: > Looking for the Swift parallel scripting language? Please visit http://swift-lang.org http://swift-lang.org
- gramasaurous 12y agoAnyone else notice the similarities in their logos as well?
- mathieuh 12y ago> Looking for the Swift parallel scripting language? Please visit http://swift-lang.org http://swift-lang.org Did they not know or do they just not care?
- deleted 12y ago[deleted]
- pling 12y agoI think the lawyers decided that they didn't need to care...
- wildpeaks 12y agoThey have enough money to not care because they can cover the cost of the worst case scenario.
- valarauca1 12y agoI think they just don't care. Swift-lang looks to be completely different when you look at the examples[1]. Its syntax is more java-y then Apple's iteration. Also Swift-lang is Apache 2.0 licensed, which I have a feeling Apple wouldn't use as a base for a new language. [1] https://trac.ci.uchicago.edu/swift/browser/branches/release-0.94/examples/tutorial/ParameterSweep/sweep.swift https://trac.ci.uchicago.edu/swift/browser/branches/release-...
- hrayr 12y agoLooks like they took inspiration for the icon also. Look at the second to last icon on that page.
- tlack 12y agoReally excited and surprised by this announcement. Anyone know the provenance of this language? Who built it, what are its intellectual roots?
- Alphasite_ 12y agoWell, Chris Lattner is involved at the very least, which is a good sign.
- pt 12y agoswift-lang.org mentioned at the bottom of the page seems to be down.
- davidcbc 12y agoIt's an unrelated language that is being hammered by all the people Googling "swift programming language"
- juvoni 12y agoLooks like Recruiters will now be seeking Swift Developers with at least 5+ years of experience.
- CanSpice 12y agoYeah, I saw @Stammy's tweet too. https://twitter.com/Stammy/status/473536229531586562 https://twitter.com/Stammy/status/473536229531586562
- wmf 12y agoThe Swift playground supports time travel, so this may be possible.
- typicalrunt 12y agoeven i tweeted the same joke, not knowing others were doing it. What I find more amazing is that, as humans, we have all chosen "5+ years" as the experience level in our jokes.
- MIT_Hacker 12y agoThis will revolutionize programming education. Interestingly enough, the time manipulation in Swift was inspired by a game called Braid (http://en.wikipedia.org/wiki/Braid_(video_game) http://en.wikipedia.org/wiki/Braid_(video_game)) released back in 2009. This will help young programmers solidify the connection between giving the computer logical commands and what is outputted on the screen immediately. Reminds me of how excited I was when Processing (http://www.processing.org/ http://www.processing.org/) was released which made it dead simple to interact with a screen and graphics. Didn't have live feedback, but it made it incredible easy to understand OOP.
- lachyg 12y agoThis will also be incredible for ease-of-setup. Install Xcode, and you're ready to go. No other dependencies. Setting up a dev environment can be one of the big reasons people fail to learn to program.
- sequoia 12y ago>This will also be incredible for ease-of-setup. Install Xcode, and you're ready to go. No other dependencies. 1. Buy particularly expensive computer 2. Register as an apple developer 3. Install Xcode, and you're ready to go. > Setting up a dev environment can be one of the big reasons people fail to learn to program. Citation needed :)
- rsfinn 12y agoActually: 1. Buy a Mac mini for $600, which doesn't strike me as particularly expensive. 2. There is no step 2. 3. Download Xcode from the Mac App Store for free.
- WorldWideWayne 12y agoYes, there is a step 2 at this very moment because I can't even download this version of XCode without having developer id.
- 12y ago
- yulaow 12y agoLink to the EBOOK on iTunes: https://itunes.apple.com/nl/book/swift-programming-language/id881256329?l=en&mt=11 https://itunes.apple.com/nl/book/swift-programming-language/...
- dom96 12y agoIs there any way to get this without installing iTunes?
- feifan 12y agoYes, posted the direct dl here: https://news.ycombinator.com/item?id=7835420 https://news.ycombinator.com/item?id=7835420
- bithush 12y agoYes it is available at https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097 https://developer.apple.com/library/prerelease/ios/documenta...
- wnissen 12y agoStill on an Objective-C runtime, so it's hard to see how the performance gains they claim are achievable, but otherwise having an interpreted version should be good for productivity.
- twic 12y agoCorrect me if i'm wrong, but Swift has static typing (with type inference, but still with a strict type on every variable), whereas Objective C has dynamic typing with optional type annotations. Having ubiquitous strong type information available should make it much easier to generate fast code.
- wnissen 12y agoHm, maybe that's it. I thought typing was still dynamic because of the multiple return types.
- randomguy7788 12y agoguessing multiple return types are supported by just returning a tuple?
- craigyk 12y agomaybe it is accompanied by improvements in LLVM? Or optimizations in LLVM that are more feasible with Swift (it has immutable values).
- deleted 12y ago[deleted]
- wuliwong 12y agoUgh, none of the links work. :( Can't get the ibook, can't view the "guides and reference", can't download xcode 6 beta.
- Angostura 12y agoBook downloaded fine for me
- lexy0202 12y agoSame here
- OWaz 12y agoSeems like some features of the dev center are down [1] including software downloads. [1]: https://developer.apple.com/system-status/ https://developer.apple.com/system-status/
- tjsix 12y agoxcode 6 beta d/l seems to be working fine now.. super slow, but working
- varenc 12y agoIt seems like the only way to view the programming language documentation is on iBooks on an iOS device? For a programming book, this is ridiculous. Edit: The latest version of OS X does support iBooks. Lets hope you have that.
- k-mcgrady 12y agoiBooks app is also available on the Mac. As the language is Mac and iOS specific it's not all that crazy.
- varenc 12y agohah, it seems iBooks is only available on Mavericks. Rather frustrating when I just want to read the documentation.
- Angostura 12y agoYou can read it on a Mac too.
- davidw 12y agoApple has a mixed history with the openness of their tech. It could be that the only place you'll be able to run the language is on an iOS device. We'll see. Looks like the end of the line for this particular bit of history: http://www.tikirobot.net/wp/2008/11/22/why-gcc-has-a-free-objective-c-frontend/ http://www.tikirobot.net/wp/2008/11/22/why-gcc-has-a-free-ob...
- 12y ago
- arasmussen 12y agoFeels like they looked at a bunch of programming languages, took all their favorite features, and then put them into one which still sits on top of the ObjC runtime. And then added some Apple syntactic craziness. For example: var apples = 3; // mutable let oranges = 5; // immutable let summary = "I have \(apples) apples and \(oranges) oranges";
- lexy0202 12y agoDo you need the semicolons?
- deleted 12y ago[deleted]
- krilnon 12y agoNope. "you don’t even need to type semi-colons." [1] [1]: https://developer.apple.com/swift/ https://developer.apple.com/swift/
- arasmussen 12y agobut you should probably use them anyway :P
- supercoder 12y agono
- deleted 12y ago[deleted]
- twic 12y agoI don't get what you don't get. What's strange here?
- pshc 12y agoUsing the backslash+parens for interpolation is really clever! No more ambiguity like when using % or {}. Is that a Swift original syntax?
- frik 12y agoThe Swift lang syntax looks like a mixture of JS 6, Go and Object-C/Smalltalk - at least from the first sight.
- Bytesouffle 12y agohttps://itunes.apple.com/en/book/swift-programming-language/id881256329?l=en&mt=11 https://itunes.apple.com/en/book/swift-programming-language/... (direct link to iBook store). Edit : Changed the link to en. Does anybody have a direct link to the Xcode 6 beta ? Or mirror download link ? Thanks.
- adricnet 12y agoSwitch nl to your language code for best results. I used en. Thanks for the direct link!
- WorldWideWayne 12y agohttp://thepiratebay.se/torrent/10283835/xCode_6_beta_(6A215l) http://thepiratebay.se/torrent/10283835/xCode_6_beta_(6A215l...
- slig 12y agoDoes this means that they're ditching Objective-C?
- k-mcgrady 12y agoNo. Swift works along side Objective-C. You can use both in the same project.
- chenster 12y agoThat'a also Microsoft said about VB.NET when they introduced C# in early 2000. Now C# is a much more dominant language than VB.NET. It's a matter of adaptation . Something it take a long time. But seriously, how could Apple introduce a new programming language that would be possibly worse than objective-C to master? I don't think so if it's not light years better than OC. Perhaps better is a relative term, but from the syntax, new Swift definitely has a modern objective language feel, and should pose much less learning curve to newcomers. That's certainly a welcome sign.
- k-mcgrady 12y agoStrangely I'm one of the people that loves the objc syntax. It's very verbose but that also makes it very simple to understand. Same goes for nested square brackets, they make it pretty simple to see how things are working. I'll definitely be trying Swift though.
- alexgaribay 12y agoI'm super excited about this. I love Objective-C but I also enjoy all the nice features of a high-level language.
- yconst 12y agoI wonder if this brings us one step closer to developing on iOS...
- AceJohnny2 12y agoThis is completely unrelated to Swift, the Jabber IM app (and lib): https://swift.im/ https://swift.im/ Edit: I pointed this out as I'm curious about trademark/logo clash.
- bigsassy 12y agoIs this related to Bret Victor's stuff? My mind was blown when I saw this video 2 years ago, and I can't help but see similarities here: https://www.youtube.com/watch?v=PUv66718DII&t=10m42s https://www.youtube.com/watch?v=PUv66718DII&t=10m42s
- deleted 12y ago[deleted]
- kmfrk 12y agoBret used to work at Apple. I don't believe in coincidences. :)
- X-Istence 12y agoComplete history of variable state over execution time of a program is AWESOME!
- dferlemann 12y agoFeels like dynamic languages coupled with some smalltalk resemblance, plus the playground which is kind like Mathematica? Looks pretty awesome! I'd itchy to try it out...
- slantedview 12y agoA quick glance through the book - looks like a nice language, certainly better than some of the stuff we use day to day.
- ant_sz 12y agoAfter read some documents I think swift is a little like coffeescript but still contains some Go syntax. It's like a scripting language very much. Quite amazing isn't it?
- avenger123 12y agoThis is exciting. I can see myself getting into this. Dabbled with Objective-C but it just didn't excite me. If Apple's intent is to boost their developer base, this is one tremendous boost. It seems to have the best of both dynamic and static languages.
- chenster 12y agoAbout time! Objective-C is increasingly becoming inadequate for Apple software development. Apple knew that. They finally decided to do something about it. If it goes popular the same as Microsoft C#, that would be a huge win for both Apple and developers.
- kcorbitt 12y agoSo it looks like the language isn't open source and won't target non-Apple runtimes? I'm not trying to troll, I just think that it's a pity that Apple tends to limit the ecosystem and applications of its otherwise-great languages. Building against LLVM ought to make it fairly trivial to make this cross-platform.
- munchor 12y agoNow that Microsoft has been open sourcing so much stuff I was expecting Apple to follow the wave and release Swift as open source too. It's a shame though.
- davidw 12y agoI'm old enough to remember Apple suing Microsoft for "copying their look and feel". Open source is something Apple only does strategically - when they have to or it suits them - it is not part of the company's ethos. http://en.wikipedia.org/wiki/Apple_Computer,_Inc._v._Microsoft_Corp http://en.wikipedia.org/wiki/Apple_Computer,_Inc._v._Microso....
- deleted 12y ago[deleted]
- andrewtbham 12y agoYeh, I agree. I was surprised when they open sourced webkit. But like you said, it's strategic. I don't think they care that much about the browser. Their emphasis is on apps running in their ecosystem.
- tsuraan 12y agoThey didn't have a choice about webkit; it was a fork of KHTML, which was a part of KDE (and available under the terms of the GPL).
- 12y ago
- tdicola 12y agoI'm impressed that it looks like they're turning Bret Victor's demo into a reality with playground. Check out his demo if you haven't: https://www.youtube.com/watch?v=PUv66718DII https://www.youtube.com/watch?v=PUv66718DII Really, really interested and excited about learning Swift.
- deleted 12y ago[deleted]
- tdicola 12y agoYes, it's funny that people didn't pick up on Apple potentially doing more with it when his demo made the rounds a few years back.
- magicalist 12y agoWhy would they "pick up on" it? That was almost two years after Bret left Apple and it's been another two years since. At this point these ideas are as available to anyone as they are to Apple.
- DanielRibeiro 12y agoWhich is also similar to Elm's time travel debugger: http://debug.elm-lang.org/ http://debug.elm-lang.org/ Direct link to Elm's demo similar to Bret's: http://debug.elm-lang.org/edit/Mario.elm http://debug.elm-lang.org/edit/Mario.elm (video: https://www.youtube.com/watch?v=RUeLd7T7Xi4 https://www.youtube.com/watch?v=RUeLd7T7Xi4)
- capnmalarkey 12y agoWouldn't say I'm impressed but definitely really excited. BVictor is pretty amazing. Anyone who hasn't seen should check out either these talks. There're great for getting extra inspired about coding or the coding life, and great for perspective too: The Future of Programming: http://bit.ly/1pNtKMh http://bit.ly/1pNtKMh Inventing on Principle: http://bit.ly/1opRrJp http://bit.ly/1opRrJp
- 12y ago
- hayksaakian 12y agoserious question: why?
- bobthedino 12y agoHere's a good way to answer that question: http://arstechnica.com/apple/2010/06/copland-2010-revisited/ http://arstechnica.com/apple/2010/06/copland-2010-revisited/
- noblethrasher 12y agoHere is a podcast version of the link that 'bobthedino suggested.
- mmastrac 12y agoAnyone feel like converting the epub from iBooks to a PDF/HTML page we can read more easily?
- joezydeco 12y agoGive the torrents an hour. It'll show.
- pyvek 12y agohttps://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/LandingPage/index.html https://developer.apple.com/library/prerelease/ios/reference... (tour, language guide, reference links, etc. at the bottom of the page)
- rabino 12y agoElm has had a "time traveler" debugger for a while http://debug.elm-lang.org/ http://debug.elm-lang.org/
- nardi 12y agoFor those interested, "A while" = since a few months ago, AFAICT.
- sureshv 12y agoDirect Link: https://developer.apple.com/swift/ https://developer.apple.com/swift/ The guides/reference link doesn't work yet...
- sequoia 12y ago"...and you don’t even need to type semi-colons." As an extremely paranoid & defensive Javascript developer, you shut your damn mouth!! :p /jokes
- curveship 12y agoAm I the only one who thinks the name "Swift" sounds a lot like "Dart"?
- deleted 12y ago[deleted]
- sunnynagra 12y agoEDIT: Link is live now. Here is the link to the online documentation if you don't want to download it on iBooks. https://developer.apple.com/library/ios/welcome_to_swift https://developer.apple.com/library/ios/welcome_to_swift
- chenster 12y agoI'm happy today.
- otterpro 12y agoThis is truly a game changer for me. Finally, I can develop for ios/osx without the excruciating pain and torture of working with the antiquated and ugly syntax of obj-c.
- chenster 12y agoWhat's to complain about? It's like Microsoft finally kills VB6 and moved on to C#. Adapt or become obsolete.
- tdicola 12y agoHaven't had a chance to look at the docs for it yet, but will LLVM be the compiler for it and will it support compiling Swift into its native bytecode?
- nardi 12y agoYes. It's on the front page: https://developer.apple.com/swift/ https://developer.apple.com/swift/
- craigching 12y agoYes, it says so on the home page: > Using the high-performance LLVM compiler, Swift code is transformed into optimized native code, tuned to get the most out of modern Mac, iPhone, and iPad hardware.
- sunkencity 12y agoa better version of ipython notebook!
- dschep 12y agoBut without the NumPy/SciPy/etc. ecosystem?
- thedangler 12y agohttps://swift.im/ https://swift.im/ Kind of looks like they took their logo too. LOL
- scrumper 12y ago"The debugging console in Xcode includes an interactive version of the Swift language built right in. Use Swift syntax to evaluate and interact with your running app, or write new code to see how it works in a script-like environment. Available from within the Xcode console, or in Terminal." Does this mean that we can use the Swift REPL in the Xcode debugger to explore running ObjC programs? That would be enormous fun, not to mention very powerful.
- pkrefta 12y agoI zipped .html + .css from the book - here you go guys :) https://www.dropbox.com/s/nuxcbkjp7bpp7uc/swift_book.zip https://www.dropbox.com/s/nuxcbkjp7bpp7uc/swift_book.zip
- deleted 12y ago[deleted]
- jaxytee 12y agoSwift has a built in option type “if let actualNumber = possibleNumber.toInt() { println("\(possibleNumber) value: \ (actualNumber)") } else { println("\(possibleNumber) could not be converted to an integer") }” Nice to see the Apple's language developers embracing functional programming by providing a clean implementation of the Maybe Monad as well as support for closures.
- nardi 12y agoI love this feature, but it's not quite the Maybe Monad, which lets you assemble a sequence of (possibly failing) statements together, and fail the whole sequence if any of the parts fails (without if-statements or switching of any kind).
- anon1385 12y ago'Optional Chaining' sounds like it lets you join thing together to some extent: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/OptionalChaining.html https://developer.apple.com/library/prerelease/ios/documenta...
- nardi 12y agoOh, cool! Straight out of CoffeeScript. Yeah, that's pretty much the monad instance of Maybe.
- a-nikolaev 12y agoI don't think this is very functional. First of all, the let binding inside the condition has type bool by itself (instead of the normal let-in construction). Also, it's scope permeates into the body of the if condition. The whole thing is very much like C-style NULL/Not-NULL check: if (x = proc()) {printf("%i", x);}
- coldcode 12y agoI as an Apple developer salute Swift. Yet more reasons to get jobs! Also anything that makes programming swifter is a plus.
- msoad 12y agoFor those of you who can't access the book because you don't have an Apple device I've uploaded screenshots of first chapter here. http://imgur.com/a/AuzGw http://imgur.com/a/AuzGw I did it because the book was free.
- jaydz 12y agoLooks like the xcode beta is only available to members who paid $99 :(
- Ixiaus 12y ago"Swift eliminates entire classes of unsafe code. Variables are always initialized before use, arrays and integers are checked for overflow, and memory is managed automatically." Lol
- _random_ 12y agoIn what way is it innovative? Seems like a mix of recent features.
- hugabuga 12y agoCouldn't help to think about Greenspuns tenth rule[0] when I saw the release of Swift. Even though it's kind of neat with the REPL and at a first look xcode looks promising. [0] https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule
- emehrkay 12y agoLooks like PHP (or any c-based lang). Exciting!
- kybernetyk 12y agoI just returned to my IM client (did miss the swift live stream announcement) and read: "Oh, cool, new language. And it has a REPL" And all I thought was: "Please let it be a Lisp".
- emehrkay 12y agoI guess you gotta go with what your customers (developers) would be most comfortable with
- kybernetyk 12y agoLooks nice. But I wish one could interop it with C++ like Obj-C. As it is now I won't be able to use Swift because of that :(
- hodgesmr 12y agoWhat's the solution to this? Interact with C++ via Obj-C, and then interact with that Obj-C with Swift?
- dang 12y agoBuried as dupe of https://news.ycombinator.com/item?id=7835099 https://news.ycombinator.com/item?id=7835099. (The idea is to have one discussion per major announcement on the front page.)
- United857 12y agoWhat happened? Shouldn't the software disallow multiple submissions of identical URLs?
- dang 12y agoIt does. We probably changed the url of the other thread; I don't remember (there have been so many), but we usually add a comment indicating what we did. On the other hand, the duplicate detector is also quite porous—in most cases a slightly different URL will get through. That's by design: we want the best stories to have multiple cracks at the bat. It's easy to abuse, of course, so we ask people not to abuse it. A small number of reposts is ok.
- Nib 12y agoGuys, I'm not sure if anybody's noticed yet, but call it a co-incident or what(make the "what" "copy"), but, another programming language with near similar features already exists, though its not C based and some other stuff is quite different but, yeah, see this : http://www.linux.com/news/featured-blogs/200-libby-clark/725638-swift-the-easy-scripting-language-for-parallel-computing/ http://www.linux.com/news/featured-blogs/200-libby-clark/725...
- outside1234 12y agoWhy is this platform not JavaScript based (so we can leverage the largest ecosystem in the world) or Python based or anything-else-that-exists based? In other news, has Android killed iOS yet so we can stop worrying about Apple? Can't happen soon enough.
- krrishd 12y agoIf you take a look at Swift, a lot of the different constructs are implemented similar to how they would be in languages like JS or Python.
- outside1234 12y agoI think that's my point. Why not JavaScript then? The only reason I can see is vendor lock-in.
- niutech 12y agoThe Swift language resource center is in the works at http://swiftlang.eu http://swiftlang.eu - right now it redirects to the Apple website. Meanwhile, there is the Swift eBook at http://book.swiftlang.eu http://book.swiftlang.eu
- eliteraspberrie 12y agoI started reading the Swift Tour and couldn't stop. It's compiled, and has both functional and object-oriented features, and a nice syntax. I'm sold. https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html https://developer.apple.com/library/prerelease/ios/documenta...
- emehrkay 12y agoHow difficult would it be to have that playground preview for other langs? Im willing to bet there is someone building a sublime extension right this minute
- jason_dstillery 12y agoI can't find anything in the book or on the website about concurrency. I'm not familiar with the Apple programming ecosystem, how is concurrency handled? Is the lack of language-level support a concern or is everything shuffled off into libraries and the runtime?
- JimmaDaRustla 12y agoLove the "Done. Sold. Have me." comments when no one here has even used the language yet...
- bshanks 12y agohttps://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ https://developer.apple.com/library/prerelease/ios/documenta...
- galvanist 12y agoWhere are the low level lightweight concurrency/parallelism features?
- timanglade 12y agoLet’s get together next week to talk about it :) http://www.meetup.com/swift-language/ http://www.meetup.com/swift-language/ (San Francisco / Silicon Valley)
- orionblastar 12y agoI have a question. Why doesn't Apple try to make easier to learn and easier to use programming languages instead of focus on the more difficult ones like Objective-C? Why not use BASIC, Python, Ruby on Rails, Java, or even Pascal for their new language so you get more people to become developers and make iOS and OSX apps in greater numbers because it is easier? I mean they could have just used Monodevelop: http://monodevelop.com/ http://monodevelop.com/ Made a tool to convert Winforms to Cocoa Forms to port some Visual Studio C# and Visual BASIC apps to iOS and OSX, and win over the Windows-Only developers to the Apple platforms? This Swift language seems so hard to learn, almost like F# or something. Not as hard as Haskell, but for the average developer it is going to be painful to learn.
- deleted 9mo ago[deleted]