Swift Weekly 2017-09-05

3f7d9611fc919c98512b779cde637dfc?s=47 Johnlin
September 05, 2017

Swift Weekly 2017-09-05

3f7d9611fc919c98512b779cde637dfc?s=128

Johnlin

September 05, 2017
Tweet

Transcript

  1. Swift पใ 2017/09/04 John Lin @johnlinvc

  2. From the core • Swift 4 : End game •

    Swift 5 : Start your engine • Swift refactor ޻۩։ݯ
  3. Swift 4 : End game • Swift 4 ਐೖᏅඌ֊ஈɻෆ࠶઀डमվత proposal

    ɻ • ༬ܭ 2017 ೥ఈલ။ਖ਼ࣜᚙ෍ɻ
  4. Swift 5 : Start your engine • ։࢝։ᚙ Swift 5

    • ओཁ໨ඪ: ᜦఆ ABI(application binary interface) • ॴ༗࿨ ABI ༗᮫త౦੢౎धཁ၏׬ɼแؚɿ • ߋڧత Generic: ૾ੋ recursive protocol • ڧ݈త API: ᩋ API ࡏ ABI ෆᏓత৘گԼਐߦमվ • Memory Ownership model: (opt-in) Rust ෩֨తهԱᱪ؅ཧɼᩋ Ꮘೳߋߴɻ
  5. Swift 5 : Start your engine • ࣍ཁ໨ඪ: • ߋූ߹ਓᱪ޻ላత

    String: ໨ඪੋ㐝ഊ Perl • վਐ std lib: ᩋଞߋ޷༻Ұᴍ • վਐ Foundation: ݱࡏؐ༗Ұථᔒಘ༻ • ৽⃧ޠ๏ɿᔒඞཁෆ။վɼ೗Ռ኷޷త࿩ؐੋ။վ • ҝ৽తconcurrent model ฯ࿏ : ୠੋᔒ༗ཁ၏౸׬ɻ
  6. Swift 5 : Start your engine • ࿨ Swift 4

    ҰᒬɼSwift 5 ՄҎબ Swift 4 ໛ࣜɻఔࣜ ᛰ׬શ૬༰ɻෆաෆอᨽೳࢧԉ Swift 3ɻ 2018 ೥ॳ ။֬ೝೳෆೳࢧԉ 3. • Coming Soooon at 2018 ೥຤
  7. Swift refactor ޻۩։ݯ • 䈕Ҋ㚎తॏߏ޻۩ቮៃ։ݯྃɼෆաލ䈕Ҋతؐᔒɻ • ༗ၷछॏߏ໛ࣜɼࢦඪ໛ࣜ࿨ൣᅴ໛ࣜɻ • ࢦඪ໛ࣜแؚ׵໊ࣈɼlocalize ࣈ۲౳౳

    • ൣᅴ໛ࣜแؚ நग़expression, நग़ํ๏౳౳ • ॴҎݱࡏՄҎࣗݾሜ refactor tool ྃɻ
  8. Evolution • [SE-0185] ࣗಈ߹੒ Equatable ᢛ Hashable

  9. [SE-0185] ࣗಈ߹੒ Equatable ᢛ Hashable • ݱࡏཁᩋࣗݾత struct/class ՄҎ༻ ==

    ༗ᴍຑ൥ struct Point : Equatable { let x : Double let y : Double init(x:Double, y:Double ) { self.x = x self.y = y } static func ==(lhs: Point, rhs: Point) -> Bool { return lhs.x == rhs.x && lhs.y == rhs.y } }
  10. [SE-0185] ࣗಈ߹੒ Equatable ᢛ Hashable • ݱࡏཁᩋࣗݾత struct ՄҎ༻ ==

    ༗ᴍຑ൥ struct Point : Equatable { ... static func ==(lhs: Point, rhs: Point) -> Bool { return lhs.x == rhs.x && lhs.y == rhs.y } } એࠂ׬࠽ೳ༻ == ҃ != let a = Point(x: 0, y: 0) let b = Point(x: 1, y: 1) a == a // true a != b // true
  11. [SE-0185] ࣗಈ߹੒ Equatable ᢛ Hashable • 㑌Ұݸ struct ౎ཁ༗ 


    static func ==(lhs: Point, rhs: Point) -> Bool { return lhs.x == rhs.x && lhs.y == rhs.y } • ୠੋ㚎༰౎େಉখҟɼबੋ೺㑌Ұݸ property ౎ compare Ұ࣍ɻ
  12. [SE-0185] ࣗಈ߹੒ Equatable ᢛ Hashable • ೭ޙՄҎ୞ཁ conform Equatable ब။ࣗಈ㗞ੜ


    static func ==(lhs: Point, rhs: Point) -> Bool {} • ཫ໘။೺㑌ݸ property ౎ൺֱҰ࣍ɻ • ෆ။ሣݱ༗త code ༗Өڹɻ ᔒ༗ confrom తबෆ။༗Ꮘ Ռɻ • ࢧԉ struct ࿨ enum , ෆࢧԉ class , tuple • Hashable ໵Ұᒬ။ࣗಈ㗞ੜɼᩋࢧԉ dict Ꮣಘߋ؆ᄸ
  13. Community • Chris Lattner 䋯ڈ Google ྃɻ଴ۀత࣌ީҾᚙྃ concurrency େፌɻ •

    https://gist.github.com/lattner/ 31ed37682ef1576b16bca1432ea9f782