静的型付けプログラミング言語Shiika
by
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
੩తܕ͚ϓϩάϥϛ ϯάݴޠShiika 2020-10-09 ࣗ࡞ϓϩάϥϛϯάݴޠͷू͍ @yhara (Yutaka HARA)
Slide 2
Slide 2 text
@yhara • ౡࠜݝࡏॅ • ωοτϫʔΫԠ༻௨৴ݚڀॴ • झຯɿݴޠॲཧܥͷ։ൃ • BiwaScheme (R7RS Scheme in JS) • ॻ੶ʰRubyͰͭ͘Δحົͳϓϩάϥϛϯάݴޠʱ ࠷ۙͷڵຯɿΫϥϑτ Ϗʔϧࣗ࡞ΩʔϘʔ υ0DVMVT2VFTU $MBTI3PZBMF4PVM PG&EFO$PPLJF $MJDLFS
Slide 3
Slide 3 text
• Brainf*ckͳͲͷ͍ΘΏΔesolangΛͭ͘Δຊ • খ͞ͳϓϩάϥϛϯάݴޠͰॲཧܥ࣮Λֶ Ϳ • RubyΒͳͯ͘OK
Slide 4
Slide 4 text
Shiika • github: yhara/shiika • Ruby෩ͷจ๏ʴ੩తܕ͚ݴޠ • 2017ʙ • ࣮ɿRust + LLVM
Slide 5
Slide 5 text
ඪ • ࣮༻ݴޠΛࢦ͢ • ΧόʔൣғRubyͱ͍͍ͩͨಉ͡ 4IJJLB 3VCZ 8FCΞϓϦ ˕ ˕ εΫϦϓςΟϯά ˓ ˕ ήʔϜ ˕ ˓ ܭࢉ ˓ ˚ ϫϯϥΠφɺίʔυΰϧϑ ˓
Slide 6
Slide 6 text
σϞ • examples/ray.sk
Slide 7
Slide 7 text
ಈػ • Ruby͕͖͚ͩͲ੩తܕཉ͍͠ • έΞϨεϛεΛ࣮ߦલʹڭ͑ͯ΄͍͠ • ܕ͕ॻ͍ͯ͋Δͱಡղʹཱͭ • ܕ͔Βઃܭ͢Δָ͠Έ • Rubyͷʮॻ͖ຯʯΛ࣋ͬͨ੩తܕݴޠΛ࡞Εͳ͍͔
Slide 8
Slide 8 text
ʮॻ͖ຯʯͱʁʁ • ͍ͪ͜͝ • ;Θͬͱ͍ͯ͠Δ…
Slide 9
Slide 9 text
Rubyͷॻ͖ຯΛߏ͢Δͷ • ʮεΫϦϓτݴޠʯͰ͋Δ͜ͱ • ͘ॻ͚Δ • ֤छsyntax sugarɾ๛ͳΈࠐΈϝιου • ָ͞ʼੑೳ • Fixnum͔ΒBignumͷࣗಈঢ֨ • େΫϥεओٛ(Hashͷॱং͕อ࣋͞ΕΔ)
Slide 10
Slide 10 text
Rubyͷॻ͖ຯΛߏ͢Δͷ • ౷Ұײ • શ͕ͯΦϒδΣΫτͰ͋Δ (1.timesͱ͔) • ifcase-whenΛͭ
Slide 11
Slide 11 text
ݴޠઃܭͷτϨʔυΦϑ • ੑೳ vs ָ͞ • eg. Bignum • ಡΈ͢͞ vs ॻ͖͢͞ • eg. syntax sugar
Slide 12
Slide 12 text
ݴޠઃܭ
Slide 13
Slide 13 text
จ๏ • جຊRubyͱಉ͡ • ྫɿϝιουݺͼग़͠ͷׅހলུՄ • EnumͳͲɺRubyʹͳ͍ͷ༷Λݕ౼
Slide 14
Slide 14 text
ܕγεςϜ • ͋·Γ͍͠ͷೖΕͨ͘ͳ͍(͕ಡΊͳ ͘ͳΔͷͰ) • ͱ͍͑δΣωϦΫε(parametricଟ૬)͘Β͍ ཁΔ • ͳ͍ͱArrayHash࡞Εͳ͍…
Slide 15
Slide 15 text
ΫϥεͱϝλΫϥε "abc" "abc".class #=> String String #=> String String.name #=> "String" String.class #=> Meta:String Array #=> Array Array.name #=> "Array" Array.new #=> [] Array.class #=> Meta:Array
Slide 16
Slide 16 text
ͳͥClassͰͳ͍ͷ͔ • Rubyͩͱ StringArrayClassΫϥε • ͔͠͠String.newͱArray.new(વͳ͕Β)γ άωνϟ͕ҧ͏ • => Class.newͷγάωνϟ͕ҰҙͰͳ͍ • => ͦΕͧΕҧ͏Λͭ͜ͱʹͨ͠
Slide 17
Slide 17 text
༨ஊɿΫϥεͱܕͷؔ • Ϋϥε != ܕ • ྫɿfoo(x: Float) • xFloatͷଞʹIntͰΑ͍ • ܕʹͷू߹(ͲͷΑ͏ͳΫϥεͷΠϯελϯ εΛڐ͔͢) ͜͜ΫϥεͰͳ͘ɺ ܕΛॻ͘ཝ
Slide 18
Slide 18 text
ޓੑʹ͍ͭͯ • Rubyͱͷޓੑॏࢹ͠ͳ͍ɻྫɿ • Ruby: "foo".start_with?("f") • Rust: "foo".starts_with("f") • startsʹ߹Θ͍ͤͨ
Slide 19
Slide 19 text
ࠓޙͷల
Slide 20
Slide 20 text
ೖΕ͍ͨͷ • Enum (Option͕΄͍͠) • ύλʔϯϚον
Slide 21
Slide 21 text
ݕ౼தͷͷ • RubyͷModuleతͳͷ • ྫ֎ʁ • async/await
Slide 22
Slide 22 text
ೖΕͳ͍ͷ • Ϣʔβఆٛԋࢉࢠ • ߏจϚΫϩ • ಡղ͕େมͳͷͰ • Rubyͷdefine_methodͷΑ͏ʹɺओͳ༻్ΛΧόʔ͢Δͷ(Ṗ)ΛΘ ΓʹೖΕ͍ͨ • ηϧϑϗετ͠ͳ͍ • σόοά͕େม • ظతʹੑೳ͕ॏཁʹͳΔ
Slide 23
Slide 23 text
Δ͜ͱແݶʹ͋Δ • ... • ׂίϯύΠϧ • ඪ४ϥΠϒϥϦ • ύοέʔδγεςϜ • ...
Slide 24
Slide 24 text
ҰॹʹΓ·͠ΐ͏ʂʂ • ݴޠॲཧܥSlack • https://prog-lang-sys-ja-slack.github.io/ wiki/ • νϟϯωϧ #shiika • https://github.com/yhara/shiika