Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Contributing to Swift

Contributing to Swift

Before Swift was open sourced, our only way to communicate with Apple was through Radar. Filing Radars is an arcane, opaque, and frequently frustrating process. But now we have a whole host of ways to chat directly to Apple engineers, all the way from mailing lists to Twitter messages. Even better than that we can actually dig through large bits of the code we use every day, and see how it works. And then when we find something we think could be better we can fix it! Thats exactly what I did, and last summer a small piece of my code shipped with Xcode 8, and most of you have probably used it. In this talk I’ll tell the story of exactly how that came to be, and explore ways that you can get involved too.

20cd0627a5c82f8b3e4f30a04745f0cf?s=128

Neil Kimmett

August 16, 2017
Tweet

Transcript

  1. Contributing to Swift by @neilkimmett

  2. Contributing to Swift - a little revision - story of

    my contribution - ways you can contribute - gnarly details
  3. struct CGPoint { var x: CGFloat var y: CGFloat }

    struct CGSize { var width: CGFloat var height: CGFloat } struct CGRect { var origin: CGPoint var size: CGSize }
  4. struct CGPoint { static var zero: CGPoint } struct CGSize

    { static var zero: CGSize } struct CGRect { static var zero: CGRect } x: 0 y: 0 width: 0 height: 0 origin: {0, 0} size: {0, 0}
  5. view.frame.origin = let view = UIView() … .zero

  6. struct UIEdgeInsets { var top: CGFloat var left: CGFloat var

    bottom: CGFloat var right: CGFloat }
  7. view.layoutMargins = let view = UIView() … UIEdgeInsetsZero .zero

  8. None
  9. None
  10. None
  11. None
  12. None
  13. None
  14. None
  15. http://bugreport.apple.com/

  16. None
  17. None
  18. None
  19. http://bugreport.apple.com/

  20. None
  21. https://swift.org

  22. https://github.com/apple/swift

  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. https://github.com/apple/swift/pull/1323

  36. None
  37. None
  38. None
  39. None
  40. What can I do?

  41. “To be a truly great community, Swift.org needs to welcome

    developers from all walks of life, with different backgrounds, and with a wide range of experience. A diverse and friendly community will have more great ideas, more unique perspectives, and produce more great code. We will work diligently to make the Swift community welcoming to everyone.”
  42. https://lists.swift.org

  43. https://stylemac.com/hirundo/

  44. https://apple.github.io/swift-evolution/

  45. https://swiftweekly.github.io

  46. https://spec.fm/podcasts/swift-unwrapped

  47. @jckarter Joe Groff @UINT_MIN Jordan Rose @dgregor79 Doug Gregor @tkremenek

    Ted Kremenek @ericasadun Erica Sadun @modocache Brian Gesiak
  48. None
  49. https://bugs.swift.org

  50. https://github.com/apple/swift

  51. Ninja

  52. brew install cmake ninja

  53. git clone https://github.com/apple/swift.git mkdir swift-source cd swift-source ./swift/utils/update-checkout --clone

  54. None
  55. ./swift/utils/build-script -h ./swift/utils/build-script -R -t

  56. LLVM

  57. LLVM IR x86 executable clang swift Haskell ARM PowerPC frontend

    backend
  58. .swift AST SIL LLVM IR assembly executable parse SILGen IRGen

    LLVM
  59. swiftc -dump-ast -emit-silgen -emit-sil -emit-ir -emit-assembly add.swift

  60. let x = 1 + 1 print(x) add.swift

  61. swiftc -dump-ast add.swift

  62. swiftc -dump-ast add.swift

  63. swiftc -emit-silgen add.swift | xcrun swift-demangle

  64. swiftc -emit-silgen add.swift | xcrun swift-demangle

  65. swiftc -emit-silgen add.swift | xcrun swift-demangle

  66. swiftc -emit-silgen add.swift | xcrun swift-demangle

  67. swiftc -emit-silgen add.swift | xcrun swift-demangle

  68. swiftc -emit-sil add.swift | xcrun swift-demangle

  69. swiftc -emit-ir add.swift | xcrun swift-demangle

  70. swiftc -emit-assembly add.swift | xcrun swift-demangle

  71. https://nicoleorchard.com/blog/compilers

  72. https://github.com/apple/swift-evolution Swift 5

  73. - ABI stability required - Generics and String features for

    stdlib - Memory ownership model - Source breaking changes have even higher bar than Swift 4 - Every evolution proposal requires working implementation with test cases Swift 5
  74. No-one has any idea what they’re doing

  75. https://www.youtube.com/watch?v=GnT2ZeHVJe4

  76. https://news.realm.io/news/tryswift-jesse-squires-contributing-open- source-swift/ Jesse Squires - Contributing to Open Source Swift

  77. https://news.realm.io/news/slug-russ-bishop-contributing-open- source-swift-proposal/ Russ Bishop - Contributing to Swift: From Proposal

    to Shipped
  78. None
  79. None
  80. Thanks! from @neilkimmett