Slashdot Mirror


Author of Swift Language Chris Lattner is Leaving Apple; We're Interviewing Him (Ask a Question!) (swift.org)

Software developer Chris Lattner, who is the main author of LLVM as well as Apple's Swift programming language, is leaving Apple, he said today. From a post: When we made Swift open source and launched Swift.org we put a lot of effort into defining a strong community structure. This structure has enabled Apple and the amazingly vibrant Swift community to work together to evolve Swift into a powerful, mature language powering software used by hundreds of millions of people. I'm happy to announce that Ted Kremenek will be taking over for me as "Project Lead" for the Swift project, managing the administrative and leadership responsibility for Swift.org. This recognizes the incredible effort he has already been putting into the project, and reflects a decision I've made to leave Apple later this month to pursue an opportunity in another space. We're delighted to share that we are interviewing Lattner, who says he's a "long-time reader/fan of Slashdot." Please leave your question in the comments section. Lattner says he'll talk about "open source (llvm/clang/swift/etc) or personal topics," but has requested that we do not ask him about Apple, which is understandable.

Update: Lattner is joining Tesla.

39 of 339 comments (clear)

  1. Is it because ... by Hognoxious · · Score: 5, Funny

    Is it because you like headphone jacks?

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  2. Cross-platform by psergiu · · Score: 4

    How cross-platform is Swift ?
    Are the GUI libraries platform-dependent or independent ?
    I.E: can i write a single Swift program with a GUI that will compile, work the same and look similar on multiple platforms: Linux, Mac OS, Real Unix-es & BSDs, AIX, Windows ?

    --
    1% APY, No fees, Online Bank https://captl1.co/2uIErYq Don't let your $$$ sit in a no-interest acct.
    1. Re:Cross-platform by shmlco · · Score: 4, Informative

      Swift is an open-source cross-platform language (there's even a Linux server version), but the Cocoa and Cocoa Touch APIs on OS X and iOS are platform specific.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    2. Re:Cross-platform by TheRaven64 · · Score: 2

      GNUstep has an implementation of the core GUI frameworks (AppKit and a few others), but the open source version of Swift doesn't have Objective-C interop, which is really the only compelling feature for Swift: it's a good incremental language if you have a lot of legacy Objective-C code.

      --
      I am TheRaven on Soylent News
    3. Re: Cross-platform by TheRaven64 · · Score: 2

      I'd have thought it'd be trivial to interface the open source version of Swift with GNUstep

      Unlike Clang, the Swift compiler doesn't have very clean interfaces for abstracting the different Objective-C implementations (clang does because I wrote them, before Apple added support for their runtime). Instead, when you build Swift, you have a bunch of #ifdef __APPLE__ things that turn off the Objective-C interop for non-Apple platforms. This also means some quite big ABI changes, for example the Swift CoreFoundation implementation has different object layouts to the ones that Apple uses and the way that casts are handled in Swift is different if Swift objects are allowed to secretly be Objective-C objects.

      Well, at least they stopped desecrating Objective-C with Java syntax.

      Since Steve Naroff left, I don't think anyone on Apple's toolchain team has really understood what made Objective-C good: a simple and clear object model, orthogonal syntax, and good C/C++ interop.

      IMHO, although it's sad they completely removed the dynamic aspect of ObjC, swift is the best of all the toy languages. I was comfortable using it to write a full program right away and I do mostly embedded C. The only downside is that it is a bit of an NP-hard problem to decide whether a correct program will compile after adding a line break.

      The hard problems in designing a modern programming language are concurrency, security, and error handling. Swift didn't even really try to address any of these (they've now added a few approaches to error handling, but it needed to be baked into the language and consistently applied throughout the standard library from day one). As such, I don't really see it as a language for the 21st century. It gives me similar abstractions to C++ (which, since C++11, has gone from being a horrible language to being a tolerable one), yet with less widespread support and worse performance.

      --
      I am TheRaven on Soylent News
    4. Re: Cross-platform by kpainter · · Score: 2

      Compared to Objective C, it is a thing of beauty.

  3. C# by Anonymous Coward · · Score: 5, Interesting

    What do you think about Microsoft and C# versus the merits of Swift?

  4. Why are strings passed by value? by Anonymous Coward · · Score: 4, Interesting

    Strings are immutable pass-by-reference objects in most modern languages. Why did you make this decision?

    1. Re:Why are strings passed by value? by shmlco · · Score: 5, Informative

      In Swift arrays, dictionaries and strings are structures with value-semantics. As to why, well, to quote the Swift language reference manual: "One of the primary reasons to choose value types over reference types is the ability to more easily reason about your code. If you always get a unique, copied instance, you can trust that no other part of your app is changing the data under the covers. "

      Behind the scenes, however, structures (including strings) are passed by pointer. Swift then uses copy on write so that the objects are completely copied only if and when the program attempts to change a value in them.

      As such, a string parameter to a function has value semantics, but it behaves as if it's an immutable pass-by-reference object from a performance standpoint. Kind of the best of both worlds.

      An exception would be a parameter specified as inout. (e.g. func f(s:inout String) )

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    2. Re:Why are strings passed by value? by michelcolman · · Score: 2

      What if you pass a string to a function, and a different thread then changes the original string? Does that also copy on write? Or does the function suddenly see the string change?

      (Thread A and thread B both have access to the same string S, B passes S to function F, function F reads S, thread A changes S, function F reads S again)

  5. How much of Swift is Based on Groovy? by Anonymous Coward · · Score: 3, Interesting

    Its been commented on that Swift tutorials look IDENTICAL to Groovy tutorials to the point that you even use the same variable names in examples (http://glaforge.appspot.com/article/apple-s-swift-programming-language-inspired-by-groovy). When created a Python to Swift converter, I responded 'wouldn't it have been easier to do a 'Swift to Groovy' converter??? To which developers replied, well naturally.

    So how much of Swift was inspired by Groovy? Both come from more high-end language and look and act almost identical.

  6. What hardware is used for workstations at apple? by Joe_Dragon · · Score: 2, Interesting

    What hardware is used for workstations at apple?

    Mac pro's?

    Mac pro's with non apple cpu upgrades?

    Imac's?

    Laptops?

  7. Exception Handling by andywest · · Score: 3, Interesting

    Why did Swift NOT have exception handling in the first couple of versions?

    --
    --- Andy West http://andywest.org
  8. as a language designer by superwiz · · Score: 5, Interesting

    Since you have been involved with 2 lauded languages, you are in a good position to answer the following question: "are modern languages forced to rely on language run-time to compensate for the facilities lacking in modern operating systems?" In other words, have the languages tried to compensate for the fact that there are no new OS-level light-weight paradigms to take advantage of multi-core processors?

    --
    Any guest worker system is indistinguishable from indentured servitude.
  9. Future of LLVM? by mveloso · · Score: 5, Interesting

    Where do you see LLVM going?

  10. Re:If this is open source... by carlhaagen · · Score: 5, Insightful

    You may have misunderstood what "open source" means.

  11. Why would he want to work at Slashdot by cide1 · · Score: 4, Funny

    He left his job at Apple, so you are interviewing him? I don't think Chris wants to work at Slashdot all that much. Good luck anyway.

    --
    -- the computer doesn't want any beer, no matter how much you think it does. NEVER, EVER feed your computer beer.
  12. Does this mean Xamarin won? by xxxJonBoyxxx · · Score: 2, Interesting

    Does this mean the Visual Studio based "write once run anywhere" encapsulated in microsoft xamarin won?

  13. What are Rust's prospects like? by Anonymous Coward · · Score: 3, Interesting

    C# is well-established, and Microsoft has shown that it's very willing to adapt C# as necessary to support new techniques. I wouldn't be surprised at all if C# inherited good ideas from Swift.

    I'm more interested in what Chris has to say about Rust, another much-newer language that's much closer in age to Swift, but also different from established languages like C#, C++ and Java.

    Chris, what are your general thoughts about Rust as a programming language?

    Seeing as it fits somewhere between languages like C++ and Swift/Go/C#/Java, some programmers find it to be impractical and ill-positioned. While it did get a huge amount of hype at various programming discussion forums in the recent past, a lot of this has died off, perhaps because of people becoming disillusioned with it.

    What do you think its prospects for the future are like?

    While a language like Swift has the backing of Apple, and Go has the backing of Google, and C# has the backing of Microsoft, do you think that Rust being backed by a much smaller and perhaps less-resilient organization (Mozilla) is a liability that should discourage the use of Rust for serious, long-term software projects?

    Also, while Swift has a very reasonable code of conduct, what are your thoughts about Rust's community, including its rather extreme focus on its code of conduct? Some people, even those who support strict codes of conduct, see Rust's as being tyrannical. Within the Rust community, it's almost like social causes are considered more important than programming or software development. What are your thoughts about the unusual control that the Rust project tries to exert over its community?

    Thank you for your time, Chris, and thank you so much for the awesome contributions you've made to LLVM, Clang and Swift!

    1. Re:What are Rust's prospects like? by Nubbywubwub · · Score: 3, Informative

      While it did get a huge amount of hype at various programming discussion forums in the recent past, a lot of this has died off, perhaps because of people becoming disillusioned with it.

      I don't know what forums you're on but the Rust hype is fucking nuts on HN and reddit. I like Rust quite a lot as a language but I hear about it so much that I'm almost getting sick of it, like Node.js was dominating the hype cycle years ago and Ruby before that.

      Also, while Swift has a very reasonable code of conduct, what are your thoughts about Rust's community, including its rather extreme focus on its code of conduct?

      Lolwut? Swift's code of conduct is lifted almost directly from Rust's, they were both based off the same original document and written by the same person. I've also never seen any "extreme"ness or SJWness in all my time on the Rust forums.

  14. Parallelism by bill_mcgonigle · · Score: 5, Interesting

    Say, about fifteen years ago, there was huge buzz about how languages and compilers were going to take care of the "Moore's Law Problem" by automating the parallelism of every task that could be broken up. With single-static assignment trees and the like the programmer was going to be freed from manually doing the parallelism.

    With manufacturers starting to turn out 32- and 64-core chips, I'm wondering how well did we did on that front. I don't see a ton of software automatically not pegging a core on my CPU's. The ones that aren't quite as bad are mostly just doing a fork() in 2017. Did we get anywhere? Are we almost there? Is software just not compiled right now? Did it turn out to be harder than expected? Were languages not up to the task? Is hardware (e.g. memory access architectures) insufficient? Was the possibility oversold in the first place?

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    1. Re:Parallelism by EMB+Numbers · · Score: 2

      Certain languages like Scala, some Lisp variants, and Erlang do a pretty good job of supporting concurrent and parallel programming. To my knowledge, no programming language fully relieves programmers of the burden of devising design not including race conditions, priority inversions, deadlocks, resource contention producing serialized execution, and countless other "gotchas".

      It is hard enough to find a programmer who can translate a recursive algorithm into a loop or visa versa. It is hard enough to find programmers who can correctly code non-trivial algorithms of any sort. It is nearly impossible to find programmers who are able to correctly design let alone implement concurrent and parallel programs. It seems that very few human beings are able to conceptualize concurrent programming... but that may just be the case in my little corner of the universe.

    2. Re:Parallelism by johannesg · · Score: 3, Interesting

      I did some work on parallelizing FORTRAN in the nineties. It never went very far; our parallelizing compiler ran out of swap space when you fed it anything larger than a twenty-line program. Not that swap space was all that big in those days, but it was clearly not useful in a real-world context. There were some good ideas, but also a great many realities that tended to break those good ideas.

      Today I'd say, but this is after not looking at it very almost two decades, that the granularity at which the compiler is able to work is too fine; parallelism works better when you have larger chunks of work to deal with, which is still very much a programmer job. And at those fine granularities, dependencies (not to mention Amdahl's law) kill your efforts at parallelization.

      So, in my opinion, it was oversold in the first place, and it turned out to be much harder than expected. But it sure sold those research grants...

  15. Any insight into language design choices? by EMB+Numbers · · Score: 5, Interesting

    I am a 25+ year Objective-C programmer and among other topics, I teach "Mobile App Development" and "Comparative Languages" at a university.

    I confess to being perplexed by some Swift language design decisions. For example,

    - Why does Swift have both a "var" keyword and a "let" keyword? One should be sufficient with the other being a default behavior. If a symbol is not declared "var" then just assume it is constant or visa versa. Furthermore, it may not be necessary to have either of the key words because (I think) in every case, the need for variability and mutation should be determinable by the compiler. Type is already being inferred by the compiler, and mutability could reasonably be considered an aspect of type.

    - Why are Swift collection types like Data always mutable? What happened to the concept of immutable containers from Cocoa. [Yes, I know the "bridged" CF types are always mutable, but that was another bad decision IMHO.]

    - Swift is intended to be a "Systems Programming Language", is it not? Yet, there is no support for "volatile" variables needed to support fundamental "system" features like direct memory access from peripheral hardware.

    - Having experienced frustration trying to port high performance graphics code from C/C++/Objective C to Swift, what's up with that? IMHO, Apple's sample code for using OpenGL/GLKit/Metal from Swift leaves the impression that Swift is unsuited to the style of "low level" programming needed/used by OpenGL/GLKit/Metal.

    - Why not support "dynamic runtime features" like the ones provided by the Objective-C language and runtime? It's partly a trick question because Swift is remarkably "dynamic" through use of closures and other features, but why not go "all the way?"

    - Finally, a trivial aesthetic critique: Why "var foo : typename" like Ada and Pascal (IIRC) instead of "var typename foo" like every language that inherited C style syntax? Is there an advantage to the Swift approach that I haven't seen, or was it just an aesthetic choice? Did the choice not produce some IMHO "silly" syntax for method declarations with named parameters?

    1. Re:Any insight into language design choices? by Anonymous Coward · · Score: 2, Informative

      For your last bullet point (and also your first), the answer is type inference.

      In a language with strong type inference, ": Typename" is both a compiler hint and an enforcement tool, not a piece of a variable declaration. You don't have to use it during variable declarations, and you can use it in places other than variable declarations.

  16. Questions, and my best wishes. by Volanin · · Score: 5, Interesting

    Since you're the creator of LLVM, I'd like to know, in your opinion what's the greatest advantage of LLVM/Clang over the tradicional and established GNU GCC compiler. Also, what's the greatest advantage of GNU GCC (or if you'd prefer, any other compiler) over LLVM/Clang, something that you'd like to "port" someday?

    Also, since I work mostly with Linux development, what do you see as the greatest advantages of the Apple developer stack (libraries, xcode, etc) that are sorely lacking in the Linux developing scene, that we should strive to copy/implement?

    By the way, and unrelated, congratulations on the Walnut Dining Table you made. It's amazing!
    https://twitter.com/clattner_l...

    --
    If I clone myself, can I call it a thread?
    If a girl winks to us, can I call it a race condition?
  17. Re:Swift libraries by EMB+Numbers · · Score: 2

    Possibly copying libraries into each App bundle on iOS sidesteps one of Android's key security issues: Any exploitable flaw in any shared library potentially enables privilege escalation and destroys any utility or protection from Android's "every app has its own user id" paradigm of security. Android's sandboxes aren't... for that reason among others.

    In contrast, iOS uses hardware virtualization capabilities of ARM processors to more truly sandbox apps. An app can gain root permissions and still not be able to mess around outside of its sandbox.

  18. How much of Swift is based on Groovy? by Foofoobar · · Score: 4, Interesting

    Its been commented on that Swift tutorials look IDENTICAL to Groovy tutorials to the point that you even use the same variable names in examples (http://glaforge.appspot.com/article/apple-s-swift-programming-language-inspired-by-groovy). When created a Python to Swift converter, I responded 'wouldn't it have been easier to do a 'Swift to Groovy' converter??? To which developers replied, well naturally. So how much of Swift was inspired by Groovy? Both come from more high-end language and look and act almost identical.

    --
    This is my sig. There are many like it but this one is mine.
  19. The Mythical Compiler -VLIW by Anonymous Coward · · Score: 3, Interesting

    Is there any hope for VLIW architectures? The general consensus seems to be that Itanium tanked because the compiler technology wasn't able to make the leap needed. Linus complained about the Itanium ISA exposing the pipelines to assembly developers. What are the challenges from a compiler writers perspective with VLIW?

  20. What happened to the OSRC? by haruchai · · Score: 2

    Why is the Operating System Resource Center gone from your site on nondot.org/sabre?
    There are a couple mirrors that date back to 2006 but what happened to the main site?

    --
    Pain is merely failure leaving the body
  21. Re:What do you think of /. by shmlco · · Score: 2

    Our shop has done several major projects in Swift, and (despite the pain thus far in migrating from, say, 2.2 to 3,0) will continue to recommend to our clients that all new development be done in Swift.

    One of the major talking points that seems to be holding up is that Swift code seems to have about half to a third the bugs found in a typical Obj-C program.

    The one thing I miss from Obj-C is a good built-in implementation of KVO for Swift object and structs.

    --
    Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
  22. Apple commitment to LLVM by ezdiy · · Score: 2

    Let's skip the boring technical details, and ask some juicier insider info.

    Apple has done great things for LLVM/Clang. I believe you were the key conductor in this. Does it mean you leaving we can expect less in this regard in the future, or are you just passing the torch in there, keeping it capable hands (aka there's not much left for you to do)?

    Or some other change of circumstances?

  23. Re:What hardware is used for workstations at apple by Anonymous Coward · · Score: 5, Informative

    Posting as AC, as I have in the past worked for Apple. Most developers at Apple have both a desktop and a laptop, usually an iMac and then whatever portable that they picked when the joined (for some developers this is primarily a meeting tool). Depending on what that developer does they then have a collection of other hardware (often pooled with people on their team) for development and testing (e.g.: hardware with diverse GPUs or screen resolutions). And then in other cases one or more prototype machine (sometimes in special secure labs).

    There is a real culture of making sure that the developers run on the shipping hardware, so ordering anything custom (even more RAM) is often a difficult thing. At one point there was a lottery to determine who got to use the latest shipping iPhones and who was forced to use the oldest supported model, to make sure that people were feeling the pain of older hardware. A number of managers were except from that lottery... they got the oldest model by fiat.

    The build clusters used to be Xserves but that was moving to clusters of Mac minis and MacPros. There were some Windows machines around (think iTunes and Quicktime), and I know some groups that did chip-level-design used linux, but standard Apple hardware rules the day.

  24. Question mark or... by jasonshortt · · Score: 2

    Do you see these questions as Optionals?

  25. Re:Swift libraries by dgatwood · · Score: 3, Interesting

    Flaws in shared libraries can't enable privilege escalation in any operating system that I'm aware of except possibly some of those really old, pre-MMU mainframe operating systems. In modern OSes, shared library code runs in the same environment privilege-wise as the rest of the code in the app.

    In fact, quite the opposite. Copying libraries introduces one of Windows's key security flaws: Any exploitable bug in a shared library is only truly fixed after every single app that provides a copy of that library gets updated to include a new version of that library. From a security perspective, providing multiple copies of a framework or library is generally seen as very, very bad.

    Of course, the reason for it in this case was that the library was evolving quickly, and apps would get built against different versions. By including it in the app, you can run apps compiled against newer versions of the Swift library on older versions of the OS that lacked that version (or any version) of the library. IMO, what's really needed is a systemwide mechanism for downloading updated versions of these shared libraries in such a way that they get automatically kept up-to-date, but that's a much more complex solution than just including a copy of the framework in each app. Alternatively, I'd settle for block-level deduplication in iOS, but again....

    Perhaps now that things have settled down a bit, they can move it into /S/L/Frameworks.

    --

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

  26. Any hope for more productive programming? by Kohath · · Score: 2

    I work in the semiconductor industry and our ASIC designs have seen a few large jumps in productivity:
    - Transistors and custom layouts transitioned to standard cell flows and automated P&R.
    - Design using logic blocks transitioned to synthesized design using RTL with HDLs.
    - Most recently, we are synthesizing circuits directly from C language.

    In the same timeframe, programming has remained more or less the same as it always was. New languages offer only incremental productivity improvements, and most of the big problems from 10 or 20 years ago remain big problems. Programmers still have to deal with syntax issues in various languages, and if I want parallel execution in my code, I have to design for it from the beginning.

    Software is helping us design our ASIC circuits from higher and higher level abstractions. But software doesn't seem to be helping us write our software. The abstractions aren't much higher level.

    Do you know of any initiatives that could produce a step-function increase (say 5-10x) in coding productivity for average engineers?

    When I first heard rumors about what became Swift, that's what I was hoping for. But it turned out to be just another programming language.

  27. Swift governance by Tough+Love · · Score: 3, Insightful

    Governance of the Swift project is firmly under the control of Apple, as stated here. How can Swift ever be a true community project if Apple controls it? Look no further than Java to see what can go wrong when a corporation controls a language.

    --
    When all you have is a hammer, every problem starts to look like a thumb.
  28. Do we need them? by SuperKendall · · Score: 2

    1) is the fact that it seems we NEED them.

    Do we? Why would anyone that is a jerk not simply ignore a code of conduct and do what they liked anyway?

    Is there a concrete example anywhere of a code of conduct stopping anything, ever?

    You could come back and say "it gives us reasons to reject someone". Yes but you could have done that ANYWAY without a COC and treating everyone with the presumption of assholishnes to begin with.

    That's the real problem I have with the whole COC frenzy, is that most of us are adults, and do not need a COC - it is insulting to present something like this as if we need it.

    Kinda like laws.

    It's nothing like a law, because it doesn't mean anything. A real law has a whole structure behind it built around judgement and enforcement of the law. The closest thing any COC has is essentially a kangaroo court that can only handle contention badly, and possibly in ways that are ACTUALLY illegal.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  29. Linux? by Parker+Lewis · · Score: 2

    Do you run Linux in any station? If yes, which distro? Which pros and cons about Linux desktop distros?