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

Introducing Rust

0286822f506fc4621bd3ea0bcbfef238?s=47 Bucharest FP
December 17, 2014

Introducing Rust

0286822f506fc4621bd3ea0bcbfef238?s=128

Bucharest FP

December 17, 2014
Tweet

More Decks by Bucharest FP

Other Decks in Programming

Transcript

  1. 1(7)/,;

  2. 3UR[\R

  3. /DQJ"

  4. ,I,¶PEHLQJKHOGWRDQRWKHUSUHGLFWLRQLW¶VWKDWWKHLQVXUJHQWODQJXDJHVILYH \HDUVIURPQRZZLOOEH±OLNH*R5XVWDQG-XOLD±XQWHWKHUHGE\DKRVW90 7KHORZSRZHUKLJKFRQQHFWLYLW\,QWHUQHWRI7KLQJVZRUOGZH¶UHPRYLQJ WRZDUGVOHDYHVIDUOHVVURRPIRUIDW90V7KHODQJXDJHVWKDWKDYHQ¶WDEDQGRQHG WKHLUKRVWVE\WKHQZLOOEHWKRXJKWRIDVEDJJDJHIURPWKHUHVRXUFHLQHIILFLHQW HDUO\GD\VRIFORXGFRPSXWLQJ KWWSVDO[QHWWKRXJKWVRQILYH\HDUVRIHPHUJLQJODQJXDJHVKWPO

  5. *R

  6. '

  7. 5XVW

  8. IQKHOORBZRUOG ^ SULQWOQ +HOORZRUOG `

  9. IQPDLQ ^ DGGBWZRBWKLQJV  ` IQDGGBWZRBWKLQJV DXLQWEXLQW !XLQW^ DE `

  10. IQPDLQ ^ DGGBWZRBWKLQJV   ` IQDGGBWZRBWKLQJV DXLQWEXLQW !XLQW^ DE

    `
  11. VWUXFW)LOH^ ILOHQDPH6WULQJ ILOHBVL]HX KLGHERRO `

  12. OHWRWKHUBILOH )LOH^ ILOHQDPH-HVXVLVP\VKHSKHUGWRBVWULQJ  ILOHBVL]H KLGHIDOVH `

  13. LPSO)LOH^ IQQHZ QDPH VWUVL]HXKLGHERRO !)LOH^ )LOH^ ILOHQDPHQDPHWRBVWULQJ  ILOHBVL]HVL]H KLGHKLGH

    ` ` `
  14. OHWILOH )LOHQHZ 7KLVLVDFKDVHUIDOVH  SULQWOQ )LOHQDPHLV^`ILOHILOHQDPH

  15. >GHULYLQJ 6KRZ @ VWUXFW)LOH^ ILOHQDPH6WULQJ ILOHBVL]HX KLGHERRO ` )LOHLV)LOH^ILOHQDPH7KLVLVDFKDVHUILOHBVL]HKLGHIDOVH`

  16. HQXP85,^ +773 6WULQJ  +7736 6WULQJ  )73 6WULQJ 

    1RQH `
  17. IQJHWBXUO XUL6WULQJ !85,^ OHWVXEVWU XUL>@>@ PDWFKVXEVWU^ KWWSV !85,+7736 XULFORQH 

    KWWS !85,+773 XULFORQH  IWS !85,)73 XULFORQH  B !85,1RQH ` ` IQPDLQ ^ SULQWOQ 8UOLV^`JHWBXUO KWWSVIRREDUWRBVWULQJ  SULQWOQ 8UOLV^`JHWBXUO KWWSIRREDUWRBVWULQJ  SULQWOQ 8UOLV^`JHWBXUO IWSIRREDUWRBVWULQJ  SULQWOQ 8UOLV^`JHWBXUO ZKDWHYHUIRREDUWRBVWULQJ  `
  18. >GHULYLQJ 6KRZ&ORQH @ HQXP'LVN6WUXFW^ )LOH 6WULQJ  'LU 6WULQJ `

  19. LPSO'LVN6WUXFW^ IQQHZ SDWK VWU !'LVN6WUXFW^ PDWFKSDWKVOLFHBIURP SDWKOHQ  ^ 

    !'LVN6WUXFW'LU SDWKWRBVWULQJ  B !'LVN6WUXFW)LOH SDWKWRBVWULQJ ` ` IQSDWK VHOI !6WULQJ^ PDWFKVHOIFORQH ^ 'LVN6WUXFW)LOH V  !V 'LVN6WUXFW'LU V  !V ` ` IQLQVSHFW VHOI ^ SULQWOQ 6HOILV^`VHOISDWK  ` `
  20. IQPDLQ ^ 'LVN6WUXFWQHZ IRREDUED] LQVSHFW  `

  21. IQSRLQWHUBW\SHV ^ OHWD ,ORYHPDU\SRSSLQVWRBVWULQJ  SULQWPH D  SULQWOQ 6XS^`D

     ` IQSULQWPH V6WULQJ ^ SULQWOQ +H\^`V `
  22. &/21(,7)25$//,7·6:257+

  23. IQSRLQWHUBW\SHV ^ OHWD ,ORYHPDU\SRSSLQVWRBVWULQJ  SULQWPH DFORQH  SULQWOQ 6XS^`D

     ` IQSULQWPH V6WULQJ ^ SULQWOQ +H\^`V  `
  24. IQSRLQWHUBW\SHV ^ OHWD ,ORYHPDU\SRSSLQVWRBVWULQJ  OHWD SULQWPH D  SULQWOQ

    6XS^`D  ` IQSULQWPH V6WULQJ !6WULQJ^ SULQWOQ +H\^`V  V `
  25. IQSRLQWHUBW\SHV ^ OHWD ,ORYHPDU\SRSSLQVWRBVWULQJ  SULQWPH D  SULQWOQ 6XS^`D

     ` IQSULQWPH V 6WULQJ ^ SULQWOQ +H\^`V  `
  26. OHWD ,ORYHPDU\SRSSLQVWRBVWULQJ  SULQWOQ 6XS^S` D  䋻6XS[IIIFGII

  27. IQPDLQ ^ OHWD  SULQWOQ ,QFUHPHQWLQJ^`DGG D D ` IQDGG

    D XLQWE XLQW !XLQW^  D E `
  28. IQDGG D E! D DXLQWE EXLQW ! DXLQW^ DE `

  29. IQDGGBWR D PXWXLQWEXLQW !XLQW^  D  DE  D

    ` IQPDLQ ^ OHWPXWD  SULQWOQ ,QFUHPHQWLQJ^`^`DGGBWR PXWD D  ` 䋻,QFUHPHQWLQJ
  30. OHWPXWDXLQW  OHWE  D OHWF  D

  31. OHWPXWDXLQW  OHWE  PXWD OHWF  PXWD

  32. Ɣ %R[$ORFDWLQKHDSFXXQVLQJXURZQHU Ɣ 5F5HVRXUFHFRXQWHGLQKHDS Ɣ $UF$WRPLFDOO\5HVRXUFHFRXQWHGLQKHDSWKUHDGVDIH XVDJH

  33. IQPDLQ ^ SULQWBLQQDUGV _[XLQW_^ [  ` ` IQSULQWBLQQDUGV IXQ_XLQW_!XLQW

    ^ SULQWOQ 5HVXOWLV^`IXQ   `
  34. >GHULYLQJ 6KRZ&ORQH @ VWUXFW)LOH^ ILOHQDPH6WULQJ ILOHBVL]HX KLGHERRO `

  35. LPSO)LOH^ IQQHZ QDPH VWUVL]HXKLGH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U^QDPH6XSWRBVWULQJ ` EDUN IRR  EDUN EDU  `
  44. IQEDUN7%DUNDEOH! ] 7 ^ SULQWOQ ^`!]  ]EDUN  `

  45. IQEDUN7%DUNDEOH6KRZ! ] 7 ^ SULQWOQ ^`!]  ]EDUN  `

  46. >GHULYLQJ 6KRZ @ SXEVWUXFW)RR^ SXEQDPH6WULQJ DJHX `

  47. LPSO6KRZIRU%DU^ IQIPW VHOIIPW PXW)RUPDWWHU !5HVXOW (UURU!^ OHWGHVFULSWLRQ IRUPDW %DU^^QDPH^```VHOIQDPH 

    IPWZULWH GHVFULSWLRQDVBE\WHV ` `
  48. UHVXOWHUU PRGXO2SHUDWLH IRREDU LIHUU QLO^ RPJGLH `

  49. OHWSDWK 3DWKQHZ 8VHUV]PDFNWKLQJW[W  OHWILOH PDWFK)LOHRSHQ SDWK ^ 2N I

     !I (UU H  !^ SULQWOQ )LOHRSHQIDLOHG^`H  UHWXUQ ` `
  50. OHWILOH )LOHRSHQ SDWK XQZUDS  䋻WDVN SDQLFNHGDW FDOOHG5HVXOWXQZUDS RQDQ(UU YDOXHFRXOGQ

    WRSHQSDWKDVILOH QRVXFKILOHRU GLUHFWRU\ 1RVXFKILOHRUGLUHFWRU\  SDWK 8VHUV]PDFNWKLQJW[WPRGH RSHQDFFHVV UHDG  8VHUV]PDFNSURMHFWVUXVWVUFOLEFRUHUHVXOWUV
  51. IQPDLQ ^ OHWSDWK 3DWKQHZ 8VHUV]PDFNWKLQJW[W  PDWFKRSHQBILOH SDWK ^ 2N

    B  !SULQWOQ 2N  (UU H  !SULQWOQ (UURU^`H  ` ` IQRSHQBILOH SDWK 3DWK !,R5HVXOW6WG)LOH!^ OHWILOH WU\ 6WG)LOHRSHQ SDWK  2N ILOH `
  52. >GHULYLQJ 6KRZ @ HQXP2SHQ(UURU^ ,R ,R(UURU  *HQHULF 6WULQJ `

  53. LPSO)URP(UURU,R(UURU!IRU2SHQ(UURU^ IQIURPBHUURU HUU,R(UURU !2SHQ(UURU^ 2SHQ(UURU,R HUU ` ` LPSO)URP(UURU6WULQJ!IRU2SHQ(UURU^ IQIURPBHUURU

    HUU6WULQJ !2SHQ(UURU^ 2SHQ(UURU*HQHULF HUU ` `
  54. IQRSHQBILOH SDWK 3DWK !5HVXOW6WG)LOH2SHQ(UURU!^ OHWVWDW WU\ SDWKVWDW  OHWILOH WU\

    6WG)LOHRSHQ SDWK  UHWXUQ(UU )URP(UURUIURPBHUURU 6RPHWKLQJHOVHJRWEXVWHGWRBVWULQJ  ` IQPDLQ ^ OHWSDWK 3DWKQHZ 8VHUV]PDFNWKLQJW[W  PDWFKRSHQBILOH SDWK ^ 2N B  !SULQWOQ 2N  (UU H  !SULQWOQ 1RW2N^`H  ` `
  55. IQPDLQ ^ VSDZQ PRYH__^ SULQWOQ ,FRQFXU  `  SULQWOQ

    ,GRQ W  `
  56. OHWPXWDXLQW  VSDZQ PRYH__^ SULQWOQ PRYHG$LV^`D  `  D

    D  SULQWOQ $LV^`D 
  57. OHWPXWDXLQW  OHWE  D VSDZQ PRYH__^ SULQWOQ PRYHG$LV^`E 

    `  SULQWOQ $LV^`E 
  58. IQPDLQ ^ OHWD9HFXLQW! YHF>@ VSDZQ PRYH__^ DSXVK   DSXVK

      IRU[LQDLWHU ^ SULQWOQ !^`[  ` `  IRU[LQDLWHU ^ SULQWOQ  !^`[  ` `
  59. 䋻8VHUV]PDFNSURMHFWVUXVWVKRZVUFPDLQUV HUURUXVHRIPRYHGYDOXHD8VHUV]PDFNSURMHFWVUXVW VKRZVUFPDLQUVIRU[LQDLWHU ^

  60. IQPDLQ ^ OHWD9HFXLQW! YHF>@ OHWP 0XWH[QHZ D  VSDZQ PRYH__^

    PORFN SXVK   PORFN SXVK   IRU[LQPORFN LWHU ^ SULQWOQ !^`[  ` `  IRU[LQPORFN LWHU ^ SULQWOQ  !^`[  ` `
  61. IQPDLQ ^ OHWD9HFXLQW! YHF>@ OHWP 0XWH[QHZ D  OHWFORQHGBP PFORQH

     VSDZQ PRYH__^ PORFN SXVK   PORFN SXVK   IRU[LQPORFN LWHU ^ SULQWOQ !^`[  ` `  IRU[LQFORQHGBPORFN LWHU ^ SULQWOQ  !^`[  ` `
  62. 䋻8VHUV]PDFNSURMHFWVUXVWVKRZVUFPDLQUV HUURUW\SHVWGV\QFPXWH[0XWH[FROOHFWLRQVYHF 9HFXLQW!!GRHVQRWLPSOHPHQWDQ\PHWKRGLQVFRSHQDPHG FORQH8VHUV]PDFNSURMHFWVUXVWVKRZVUFPDLQUVOHW FORQHGBP PFORQH 

  63. IQPDLQ ^ OHWD9HFXLQW! YHF>@ OHWP 0XWH[QHZ D  OHWUF $UFQHZ

    P  OHWFORQHGBUF UFFORQH  VSDZQ PRYH__^ UFORFN SXVK   UFORFN SXVK   IRU[LQUFORFN LWHU ^ SULQWOQ !^`[  ` `  IRU[LQFORQHGBUFORFN LWHU ^ SULQWOQ  !^`[  ` `
  64. 䋻 ! ! !

  65. HQXP0HVVDJH^ 1XPEHUV 9HFXLQW!  'LH `

  66. IQPDLQ ^ OHW W[U[  FKDQQHO  VSDZQ PRYH__^ OHW[

    YHF>XXX@ W[VHQG 0HVVDJH1XPEHUV [  `  PDWFKU[UHFY ^ 0HVVDJH1XPEHUV ]  !^ SULQWOQ 1XPEHUV IRU[LQ]LWHU ^ SULQWOQ !^`[  ` ` B !SULQWOQ 6RPHWKLQJHOVH ` `
  67. &DUJR

  68. ȹ JHWPDVWHU KWWSVJLWKXEFRPUXVW ODQJUXVW ȹ FRQILJXUHPDNHWKHZRUNV ȹ QHYHUORRNEDFN