14 ms·
Chris Lattner on Swift
- spike021 12y agoAnother interesting thing to note is that because Swift really began in roughly mid-2010, Steve Jobs probably had his hand at least slightly in it (obviously not as a programmer). I guess my point being that there was likely some more specific reason for why it gained momentum later.
- thinkpad20 12y agoI dunno, it's possible but OTOH it's hard to imagine a guy like Steve Jobs, for whom (as far as I know) coding wasn't a primary concern, and who was dealing with cancer and much bigger fish in the i* products, being any more than tangentially involved in what would have been at the time a fledgling research language project. He was probably aware that it was happening, but I doubt that he played much of a role. Apple is after all a massive company filled with many smart people and who knows how many research projects.
- grecy 12y agoI think it very likely Apple have all kinds of 1, 2, 5 and 10 year road maps for all their products (software and hardware). Given that almost all of them rely so heavily on Objective-C, I expect they've had a road map for that (and XCode and the whole tool chain) for a very long time. Given the plan is now to phase out ObjC and replace it entirely with Swift, I think it's extremely unlikely Steve didn't know about it, and endorse it.
- Alphasite_ 12y agoHe did say that it wasn't A major Apple focus until last year, when they actually got together and did all the end work.
- grecy 12y agoIt might not have been a major focus until last year, but I'll bet it was on road maps for many, many years preceding that.
- pg_is_a_butt 12y agouh... that link is his resume, and anything "on" swift is basically a single sentence saying that it is a programming language that ripped things off from a lot of different places, with a link to wikipedia. dumb.
- slaven 12y agoIt's amazing that Apple managed to go from hatching the idea in mid-2010 to releasing a fully working framework 4 years later, with tight IDE integration, huge amount of testing and compatibility without a single leak (that I've heard of).
- jayvanguard 12y agoNo doubt. Also amazing is that they promoted a compiler architect to eventually lead the whole tools group. This is good news.
- smackfu 12y agoIt's not clear how much code is actually written in Swift so far, so I'm not sure how much testing/compatibility was required.
- eddieroger 12y agoIf they're willing to allow developers to release an app written in Swift when the beta ends, I'd say they're pretty comfortable with it in production. If Swift is really four years old already, who knows what components could be already in Swift. And it's not like Apple jumps ship overnight - iTunes spent nearly a decade as a Carbon app after introducing Cocoa.
- m0nastic 12y agoNot that it's particularly complicated, but they mentioned yesterday that the updated version of the WWDC app (which they released right after the keynote) is written in Swift. I don't know if that means "entirely written" or some parts, but they at least called attention to it.
- sjwright 12y agoWhich implicitly means that swift code can be compiled for iOS 7. Which isn't surprising since the compiled code uses the ObjC runtime.
- siavosh 12y agoGreat to see the credit to Bret Victor and Chris Granger's Light Table. Apple's resources can really help move forward these new ideas of what an IDE can be. If Swift is successful, a whole generation of young developers will use and improve on these ideas. Very exciting to see what happens.
- joshdance 12y agoI honestly expected Bret Victor to do the demo on Swift after seeing the realtime playground etc.
- ibdknox 12y agofwiw, he had no direct involvement in it. http://www.quora.com/Did-Bret-Victor-work-with-Apple-on-the-design-of-Swift-Playground http://www.quora.com/Did-Bret-Victor-work-with-Apple-on-the-...
- joshdance 12y agoYou are correct he was not involved. But the language creator specifically calls him and Lightroom out as inspiration.
- snowwrestler 12y agoI love that his account's URL is http://www.quora.com/Bret-Victor-1 http://www.quora.com/Bret-Victor-1, because http://www.quora.com/Bret-Victor http://www.quora.com/Bret-Victor was already dedicated to his name as a topic.
- seanmcdirmid 12y agoWhy do Bret V and Chris G get all the credit for something invented in the 90s? E.g. Steering programs with time travel (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.33.538&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.33....).
- 12y ago
- kyle_t 12y agoSite seems to be buckling under load. Google cache: http://webcache.googleusercontent.com/search?q=cache:http://nondot.org/sabre/ http://webcache.googleusercontent.com/search?q=cache:http://...
- henryw 12y agoHere's a screenshot of the page http://i.imgur.com/C51LXnz.png http://i.imgur.com/C51LXnz.png
- jayvanguard 12y agoIt looks like Rust was a major influence. It has been interesting seeing all these posts claiming Swift borrowed from _their_ language. Obviously there is a lot of feature influence between languages but it was interesting to see the ones he called out explicitly.
- pohl 12y agoIt's a bit of a Rorschach test, sometimes. People see what's familiar to them.
- sekasi 12y agoGreat way of putting it. I see Ruby in it personally, and loads and loads of C#, but I have heard the Rust thing before from other people.
- tomp 12y agoPersonally, I see nothing from Rust in it (except what Rust took from other languages, like ML).
- herinkc 12y agoApple really took a big step. Waiting to see amazing stuffs done with Swift.
- niix 12y agoReally excited for Swift. I've tried and failed many times to learn Objective C and felt that the barrier to entry was a bit to high for myself. As a someone who writes JavaScript for a living, Swift is very inviting.
- Cookingboy 12y agoNot trying to be rude, but if you've tried and actually FAILED to learn Objective-C multiple times, then you will have a much bigger problem with actually learning the Cocoa framework yourself. Objective-C does have a non-standard syntax, but its barrier of entry for actual learning is purely psychological and not technical.
- m_mueller 12y agoMaybe the mistake could lie in starting with Objective C without first learning C? I'm thinking that a reasonably solid C foundation helps a lot in understanding why and how Obj-C works.
- varunrau 12y agoWhile knowing C certainly helps, it is not essential to learning Objective C, at least it wasn't for me. If you try first to understand it at a high level, then it is very doable (and fun!).
- sjwright 12y agoI went straight from a CFML/Java/Javascript web developer to picking up Objective C in a week. I had some coaching from a C/C++ expert, who learned ObjC on the fly and wrote a first draft of an app I designed, but from there I worked out how to solve my own problems and eventually became a moderately high skilled ObjC developer. I have subsequently leveraged that ObjC experience to become somewhat proficient in plain C, a skill I appreciate today and something I might never have learned otherwise.
- jonhendry 12y agoI learned Objective-C before I learned C, back in the early 90s. Before that I'd learned Basic and Pascal. Objective-C clicked with my brain pretty easily.
- Arjuna 12y agoChris demonstrated Swift and Playgrounds at WWDC 2014: "I can build anything with Swift... from a social media application, all the way up to a high-performance, 3D game using Metal." https://www.youtube.com/watch?v=nKMAV6owYh4#t=6436 https://www.youtube.com/watch?v=nKMAV6owYh4#t=6436 He wrote this chapter (entitled LLVM) in the book, "The Architecture of Open Source Applications": http://aosabook.org/en/llvm.html http://aosabook.org/en/llvm.html * * * On the general topic, I wrote this [1] a little earlier in another thread; I'm just impressed with how Apple is becoming a gaming powerhouse. [1] https://news.ycombinator.com/item?id=7841744 https://news.ycombinator.com/item?id=7841744
- diminish 12y agoDid he mention anywhere Swift will be open sourced, the way LLVM has been? If not, why?
- lstamour 12y agoI find when Apple employees leave something important out, like licensing, it's because others haven't yet made the decision -- in other words, it's not final. I personally would have expected that if Apple were not making the code open source, they would mention its exclusivity and emphasize it as a training program for schools, etc. Realistically, it's just time -- like LLVM improvements or past work on Objective-C, expect everything up to the REPL as open source, but playgrounds and docs under proprietary license or completely closed would be my guess. If not now, some time in the future as .NET further open sources or if they want to encourage Swift as a JS competitor.
- mikeash 12y agoOr the decision has been made but it's not ready to be announced yet, for whatever reason. Apple is notoriously secretive. They hate saying anything ahead of time if they don't have to. They could have committed (internally) to open sourcing Swift when they started on it four years ago, but they still probably wouldn't say anything until they day it happens. If they thought they could get away with it, they'd have kept the very existence of Swift secret until the public release, but they need feedback from third-party developers at this point.
- gw 12y agoIt is nice that he mentioned Light Table. I would not be surprised if Swift ends up really benefitting Clojure adoption indirectly. I think one of the big hangups for newcomers is that, if you don't have experience with a Lisp, it's often difficult to understand the benefits of interactive development. If a large amount of new programmers become exposed to it, they'll be more open to other options that provide similar or better interactivity.
- ibdknox 12y agoThe only thing that makes me sad is that because of their focus on secrecy, they're doomed to relearn all that we learned along the way. Having played with the swift playground stuff, just an hour long conversation could've made a big difference. Such is the way of Apple though.
- ovis 12y agoI would be very interested to hear what you think might have benefitted from the experiences of LightTable. Are they things you think could evolve convergently in the future, or are they mutually exclusive design choices?
- pohl 12y agoThat's also a good thing. They'll have learned more from making experimental mistakes than from having been told something.
- cpr 12y agoWell, don't hesitate to give them feedback now. They're staying it's still quite in a fluid state and will change before release. Plus I'm sure they'd always be grateful for feedback, and if it improves the lot of millions of developers (they say now 9M registered Apple devs), you've done the world a great favor. “There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.” Charles Edward Montague
- bsdetector 12y agoOn the other hand by keeping it secret and internal they avoided making bad decisions due to defensiveness and stubbornness. An example of this is Go; they don't actually take input from outsiders (generics) and when they have had to give in to outside ideas they implement it poorly just to be different (exceptions as panic). They would rather people put in a no-op printf to avoid the unused package error rather than letting it be a warning because of their own self-righteousness. Apple's secretive process may not be ideal, but there are far worse processes out there.
- dominiek23 12y agoFunny how he forgot to mention Golang somehow while that seems to be one of the bigger inspirations for the language.
- kryptiskt 12y agoThat's a strange accusation, because Go is avowedly minimalist while Swift has cribbed most every thing from modern statically typed languages like ADTs, pattern matching, and generics.
- necubi 12y agoI don't understand why people keep comparing Swift and Go, as they have diametrically opposed philosophies. As stated succinctly by Bryan O'Sullivan (one of the most prominent people in the Haskell community) on Twitter: "It's interesting to compare Swift and Go. One has caught up to the 1990s in language design, with the other firmly in the 60s." Swift includes many of the language features that have been touted by the academic functional programming community for years but which have not made a large impact in industry, like algebraic data types, pattern matching, and Optionals. The designers of Go apparently looked at the past few decades of language research and decided that none of it interested them. The only really innovative parts of Go are its concurrency support, which Swift seems to be completely lacking.
- pjmlp 12y agoLack of CS knowledge I guess, specially in programming language history. They see things like func, and think Go was the first language to come up with it, when many others already had it.
- craigyk 12y agowell in Swift I think concurrency is expected to rely on system libraries whereas in Go they are built-in and even have special syntax. If Swift ever gets a good macro system, though, I'm guessing one could create nice syntax to use system concurrency libraries.
- melito 12y ago
- enraged_camel 12y agoI like Chris and what he has done, but... >>The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas... Seriously? What is a "documentation guru"? What is a "compiler optimization ninja"? I find language like this so distracting and asinine that I had to stop reading. Am I the only one?
- castis 12y agoIf you're going to let it get to you that much, you may want to step back a tad.
- glibgil 12y agoYes, you are the only one. Replace "guru" with "expert" and "ninja" with "expert" and continue reading. There are already no real ninjas in the world and soon there will be no real gurus. No one thinks twice when someone is called a marketing wiz (there are no real wizards any more). Language changes and metaphors using archaic terms are commonly introduced.
- enraged_camel 12y agoThat's funny, because when such language is used in job postings, they are overwhelmingly frowned upon by HN folks. But I guess it's OK when someone like Chris does it... edit: judging by the downvotes, he seems to have a lot of fans. :)
- bronson 12y agoLikely downvoted because this is the stupidest, most pointless comment thread on an otherwise decent page. Contributing to it is what's overwhelmingly frowned upon by HN. (Yes, I know. I could use some downvotes.)
- Angostura 12y agoIt is quite possible that e was referring to people who he believed had taught him interesting aspects about the spirit of documentation or the philosophical way to view compiler optimisation. In which case the word would be apt.
- fataliss 12y agoI feel like swift is really a good view on the future of programming. And it seems that in the future we have really two different kind of software engineers. As we make programming mainstream and easy, we will see some new people able to use langages like swift and dev good apps without having the slightest idea of what is happening underneath. We used to have at least a common background between software engineers but I think it gonna slowly disappear. Is it good or bad? I can't make up my mind yet, but I'm really considering more and more to go back to lower level langages as I feel like the upper levels are going to be crowded by young generations.
- JoeAltmaier 12y ago"Underneath" just means "the level below where I'm writing". This has pretty much always been true, the way systems are layered. You write install scripts? Apps? Libraries? rendering engines? Drivers? OS? Firmware? Chip layout? You probably don't really know what goes on 'underneath' your layer.
- mikeash 12y agoSometimes the occasion arises where it's useful to look at the assembly language being generated by your compiler. The vast majority of developers I know completely freak out at the idea. I might as well suggest that they deadlift a car. A few take it calmly, but don't really grasp what the stuff does or what it means. I can probably count on one hand (maybe two?) the number of developers I know who can actually do something useful in that situation. And that's just assembly language. Not even machine code, let alone actual hardware. Most developers don't understand what goes on below wherever they work, and that's how it's been for a very long time.
- JoeAltmaier 12y agoAgreed. I spend half my debugging time with the disassembly turned on - removes ALL the ambiguity. It's like pulling teeth to get other developers to try it. Once you do, you kind of get addicted to it.
- 12y ago
- scotu 12y agoHe does not have a beard. I'm very skeptic this language will be successful
- cbrauchli 12y agoI think the beard test is for OS developers.
- phaedryx 12y agoMatz with a beard: http://www.rubyist.net/~matz/images/matz-beard.jpg http://www.rubyist.net/~matz/images/matz-beard.jpg He grew it specifically as a response to the "beard test" for programming languages.
- DerekL 12y agoMacintosh- and facial-hair-related: http://www.folklore.org/StoryView.py?story=Moustache.txt http://www.folklore.org/StoryView.py?story=Moustache.txt
- mjhoy 12y agohttp://khason.net/blog/computer-languages-and-facial-hair-%E2%80%93-take-two/ http://khason.net/blog/computer-languages-and-facial-hair-%E...
- cbrauchli 12y agoWhoops! You're right.
- Uncompetative 12y agoI have a beard. Wish me luck with my new language.
- mzs 12y agoI wish Apple had selected a different name: https://www.ci.uchicago.edu/research-projects/swift https://www.ci.uchicago.edu/research-projects/swift
- afternooner 12y agoName a letter or a word and there is some project out there that had it before. If you come to grips with this now, your adult life will be much easier.
- pohl 12y agoGoogle similarly displaced another programming language called go.
- steele 12y agoI can't afford to ignore it as it matures, but with my dev setup right now, I just can't afford it. Hoping to see this work well in Linux and Windows.
- oliyoung 12y agoXCode6 runs alongside XCode5, you can safely play with Playground and build apps in the simulator, and even install iOS8 on a dev device and deploy there, without affecting your toolchain
- jiaweihli 12y agoI'm not sure if it's XCode / playground acting up, but array equality is broken for me: `[1, 2, 3] == [1, 2, 3]` returns false. This seems to contradict the core declarations though: /// Returns true if these arrays contain the same elements. func ==<T : Equatable>(lhs: T[], rhs: T[]) -> Bool Works alright for dictionaries. Is there a bug tracker for Swift anywhere to report this? Edit: Whoops, copied wrong declaration. ContiguousArrays actually work fine, but require an extra cast. e.g. ContiguousArray([1, 2, 3]) == ContiguousArray([1, 2, 3])
- lcnmrn 12y agovar one = [1, 2, 3] var two = [1, 2, 3] one == two That's because Swift checks for safety first (variable declaration).
- jiaweihli 12y agoCan you explain what you mean by `checks for safety first (variable declaration)`? This issue only seems to affect arrays. Strings, numbers, and dictionaries are fine.
- prezjordan 12y ago> I hope that by making programming more approachable and fun, we'll appeal to the next generation of programmers and to help redefine how Computer Science is taught. I'll be cynical here: can this be done if the language ends up being restricted to apple devices?
- bsaul 12y agoTo me, this is going to be the only thing that matters : dill this language be used for non-apple platform coding. I've been looking for a language just like that for a very long time on the server side for example.
- coldtea 12y ago>I'll be cynical here: can this be done if the language ends up being restricted to apple devices? Sure it can. Students and school-children have been taught (and inspired) with proprietary systems and languages for ages. Sure, it might not get to Windows or Linux users, but it still can reach tens of millions of kids and even universities (e.g Stanford already offers a well known iOS course with Objective-C).
- thibautx 12y agoExtremely excited about this language's versatility. Also great to see the work of my school's Alumni and professors going into production. This is the third time I've come across the LLVM compiler in industry use (albeit nothing to the scale of iOS' language) - anecdotally during my internship search this last semester. Will be very interesting to take Professor Adve's compiler course soon.
- c2u 12y agoSwift is a little complex. Does it compile to Object-C?
- airjd 12y agoI like js, but not swift.
- kinofcain 12y agoHis take on the "x years of swift experience" meme is pretty great: "Looking forward to next month: I'll be the first and only guy with 4 years of swift programming experience :-)" https://mobile.twitter.com/clattner_llvm/status/473835365137416192 https://mobile.twitter.com/clattner_llvm/status/473835365137...
- thehme 12y agoSwift "greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list." I have been wondering if in fact this language will be Open Source, since it is said to have taken from other programming languages, some of which are Open Source, yet the decision to make it Open Source has not been made? Lock down.
- rsynnott 12y agoIn general, a _language_ is not open source; its _implementation_ is.
- thehme 12y agoRight, well, let's see what happens. I kindda agree with Gordon Haff (http://www.cnet.com/news/apples-new-swift-coding-language-hopes-to-lock-down-errors/ http://www.cnet.com/news/apples-new-swift-coding-language-ho...) on being disappointed that Apple did choose a more open platform, but I suppose this can change in time, like with Microsoft recent changes.
- deleted 12y ago[deleted]
- LeicaLatte 12y agoLooking forwards, here's a dream roadmap if this WWDC is any indication. playgrounds for iPad, interface builder for iPad and finally Xcode.