twitter.com/@godrm facebook.com/godrm func swift(?)->(!) { return (“version”, 2) } OSXDEV.org
swift-lang.org
WWDC Swift Panel meetup https://realm.io/news/apple-wwdc-2015-swift-panel-discussion/
Namespace Closures .map.reduce Generics inferred type Bridging Protocol Initialization Operators Strings and Char Enumerations Class & Structures Optional ARC Currying
AppPerformance Developer Productivity C C++ Objective-C Java Ruby Python JavaScript Groovy LuaPerl
Improved option sets Markdown in comments Objective-C generics Nullability in Objective-C Faster debug mode C function pointer APIs Parallelized WMO guard defer do { } Synthesized“headers”in Xcode SIMD supportPattern matching in "if" Swift 1.2 to 2.0 Migrator @testable Protocol extensions Availability checking Error Handling Model Multi-payload enums Recursive nested functions Faster runtime Shorter compile time New playgrounds Mutability warnings
Lisp, Prolog FORTRAN, ALGOL Simula SmalltalkC Objective-C, C++ Java Python C# Pascal Erlang Haskell Scheme Clojure Two Paradigms 1950’s 1960’s 1970’s 1980’s 1990’s 2000’s
Pure Objective aPen +new +red +blue ,moveTo: ,draw ,color: position color 객체 구별자 (identifier) Pen:객체
2011년 3월 “Object-oriented programming is eliminated entirely from the introductory curriculum, because it is both anti- modular and anti-parallel by its very nature, and hence unsuitable for a modern CS curriculum. A proposed new course on object- oriented design methodology will be offered at the sophomore level for those students who wish to study this topic.” - Robert Harper, professor at CMU CMU CS 개론 수업에서 OOP 퇴출
Output Input Memory Variables Pure Functional
순수한 함수 ★ 부작용(side-effect)이 없는 함수 ★ 변경 불가한 데이터 (Immutability) ★ 참조 투명성 (referential transparency) ★ 게으른 평가 (lazy Evaluation) ★ 타입 클래스 (type class) ★ 고계 함수 (high-order function)
Lisp, Prolog FORTRAN, ALGOL Simula Smalltalk Objective-C, C++ Java Python C# Kotlin, Swift Rust Scala Scheme F# Ruby DClojure Julia JS 1950’s 1960’s 1970’s 1980’s 1990’s 2000’s 2010’s Two Paradigms C Pascal Erlang Haskell
CPU 발전 추세
운영체제 하드웨어 Runtime Swift App. Swift App. Runtime Obj-C App. Obj-C App. Swift vs Objective-C Runtime
Swift Library v1.0 ✴ libswiftAppKit.dylib* ✴ libswiftCoreGraphics.dylib* ✴ libswiftDarwin.dylib* ✴ libswiftDispatch.dylib* ✴ libswiftFoundation.dylib* ✴ libswiftObjectiveC.dylib* ✴ libswiftSpriteKit.dylib* ✴ libswiftXCTest.dylib* ✴ libswift_runtime.a ✴ libswift_stdlib_core.dylib*
Swift Library v2.0 ✴ libswiftAppKit.a ✴ libswiftCoreGraphics.a ✴ libswiftDarwin.a ✴ libswiftDispatch.a ✴ libswiftFoundation.a ✴ libswiftObjectiveC.a ✴ libswiftSpriteKit.a ✴ libswiftXCTest.a ✴ libswift_runtime.a libswiftAVFoundation.a libswiftCloudKit.a libswiftContacts.a libswiftCore.a libswiftCoreAudio.a libswiftCoreBluetooth.a libswiftCoreData.a libswiftCoreImage.a libswiftCoreLocation.a libswiftCoreMedia.a libswiftEventKit.a libswiftGLKit.a libswiftGameCenter.a libswiftGameplayKit.a libswiftLocalAuthentication.a libswiftMultipeerConnectivity.a libswiftOpenCL.a libswiftSceneKit.a libswiftWebKit.a libswiftsimd.a
Swift Overview The Basics
Protocol-Oriented Programming in Swift Session 408 #WWDC 2015Development Tools Dave Abrahams | Professor of Bowling-Your-Mind
• Encapsulation • Access Control • Abstraction • Namespace • Expressive Syntax • Extensibility Classes Are Awesome
Classes Are Awesome • Encapsulation • Access Control • Abstraction • Namespace • Expressive Syntax • Extensibility ClassesClassesClassesTypes I can do all that with structs and enums.
Value Type vs. Reference Type Call by value, Call by reference
Classes That Do Not Contain References Reference Reference Reference Reference Point Point Point Point Array class Point { var x, y: Float } } for p in array { ... var array: [Point] = ...
var x, y: Float struct Point { Structs That Do Not Contain References Array for p in array { } ... var array: [Point] = ... Point Point Point Point } All reference counting operations eliminated
어떤 언어로 만들까?
TOIBE Index (Dec. 2015)
Swift
아직도 beta 버전?!
OSI-approved license Later this year Code contributions accepted
swift.org
github.com/apple
Platform https://swift.org/download/
Core Libraries ✴ swift-corelibs-foundation ✴ http://www.github.com/apple/swift-corelibs-foundation ✴ swift-corelibs-libdispatch ✴ http://www.github.com/apple/swift-corelibs-libdispatch ✴ swift-corelibs-xctest ✴ http://www.github.com/apple/swift-corelibs-xctest
Package Manager ✴ Swift-package-manager ✴ https://github.com/apple/swift-package-manager ✴ swift-build import PackageDescription let package = Package( name: "Dealer", targets: [], dependencies: [ .Package(url: "https://github.com/apple/example-package-deckofplayingcards.git", majorVersion: 1), ] ) https://github.com/apple/swift-llbuild
REPL & Debugger ✴ Integrated debugging ✴ LLDB
Community ✴ Communication ✴ Mailing Lists, github, bugs.swift.org ✴ Structure ✴ Project lead, core team, code owner, committer, contributor ✴ Contributing & Proposing New Features https://swift.org/community/

Swift2 smalltalk osxdev