Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
静的型付けプログラミング言語Shiika
Search
yhara
October 09, 2020
Programming
0
18k
静的型付けプログラミング言語Shiika
https://opt.connpass.com/event/188521/
yhara
October 09, 2020
Tweet
Share
More Decks by yhara
See All by yhara
それは残像だ
yhara
4
4.2k
スモートーク
yhara
0
2.8k
Ovto: Frontend web framework for Rubyists
yhara
0
7.1k
Ruby, Opal and WebAssembly
yhara
2
2.4k
Competitive Programming in Ruby (101)
yhara
0
680
Rubyで競技プログラミング(入門編)
yhara
0
1.8k
良いデバッグログはプロジェクトの資産である
yhara
54
18k
Let's make a functional language!
yhara
0
6.3k
Recent Updates (近況報告)
yhara
0
590
Other Decks in Programming
See All in Programming
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
最新TCAキャッチアップ
0si43
0
140
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
距離関数を極める! / SESSIONS 2024
gam0022
0
280
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
930
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
120
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Jakarta EE meets AI
ivargrimstad
0
630
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
Click-free releases & the making of a CLI app
oheyadam
2
120
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
220
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
88
5.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Making Projects Easy
brettharned
115
5.9k
Become a Pro
speakerdeck
PRO
25
5k
Teambox: Starting and Learning
jrom
133
8.8k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Site-Speed That Sticks
csswizardry
0
25
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Transcript
੩తܕ͚ϓϩάϥϛ ϯάݴޠShiika 2020-10-09 ࣗ࡞ϓϩάϥϛϯάݴޠͷू͍ @yhara (Yutaka HARA)
@yhara • ౡࠜݝࡏॅ • ωοτϫʔΫԠ༻௨৴ݚڀॴ • झຯɿݴޠॲཧܥͷ։ൃ • BiwaScheme (R7RS
Scheme in JS) • ॻ੶ʰRubyͰͭ͘Δحົͳϓϩάϥϛϯάݴޠʱ ࠷ۙͷڵຯɿΫϥϑτ Ϗʔϧࣗ࡞ΩʔϘʔ υ0DVMVT2VFTU $MBTI3PZBMF4PVM PG&EFO$PPLJF $MJDLFS
• Brainf*ckͳͲͷ͍ΘΏΔesolangΛͭ͘Δຊ • খ͞ͳϓϩάϥϛϯάݴޠͰॲཧܥ࣮Λֶ Ϳ • RubyΒͳͯ͘OK
Shiika • github: yhara/shiika • Ruby෩ͷจ๏ʴ੩తܕ͚ݴޠ • 2017ʙ • ࣮ɿRust
+ LLVM
ඪ • ࣮༻ݴޠΛࢦ͢ • ΧόʔൣғRubyͱ͍͍ͩͨಉ͡ 4IJJLB 3VCZ 8FCΞϓϦ ˕ ˕
εΫϦϓςΟϯά ˓ ˕ ήʔϜ ˕ ˓ ܭࢉ ˓ ˚ ϫϯϥΠφɺίʔυΰϧϑ ˓
σϞ • examples/ray.sk
ಈػ • Ruby͕͖͚ͩͲ੩తܕཉ͍͠ • έΞϨεϛεΛ࣮ߦલʹڭ͑ͯ΄͍͠ • ܕ͕ॻ͍ͯ͋Δͱಡղʹཱͭ • ܕ͔Βઃܭ͢Δָ͠Έ •
Rubyͷʮॻ͖ຯʯΛ࣋ͬͨ੩తܕݴޠΛ࡞Εͳ͍͔
ʮॻ͖ຯʯͱʁʁ • ͍ͪ͜͝ • ;Θͬͱ͍ͯ͠Δ…
Rubyͷॻ͖ຯΛߏ͢Δͷ • ʮεΫϦϓτݴޠʯͰ͋Δ͜ͱ • ͘ॻ͚Δ • ֤छsyntax sugarɾ๛ͳΈࠐΈϝιου • ָ͞ʼੑೳ
• Fixnum͔ΒBignumͷࣗಈঢ֨ • େΫϥεओٛ(Hashͷॱং͕อ࣋͞ΕΔ)
Rubyͷॻ͖ຯΛߏ͢Δͷ • ౷Ұײ • શ͕ͯΦϒδΣΫτͰ͋Δ (1.timesͱ͔) • ifcase-whenΛͭ
ݴޠઃܭͷτϨʔυΦϑ • ੑೳ vs ָ͞ • eg. Bignum • ಡΈ͢͞
vs ॻ͖͢͞ • eg. syntax sugar
ݴޠઃܭ
จ๏ • جຊRubyͱಉ͡ • ྫɿϝιουݺͼग़͠ͷׅހলུՄ • EnumͳͲɺRubyʹͳ͍ͷ༷Λݕ౼
ܕγεςϜ • ͋·Γ͍͠ͷೖΕͨ͘ͳ͍(͕ಡΊͳ ͘ͳΔͷͰ) • ͱ͍͑δΣωϦΫε(parametricଟ૬)͘Β͍ ཁΔ • ͳ͍ͱArray<T>Hash<S,T>࡞Εͳ͍…
ΫϥεͱϝλΫϥε "abc" "abc".class #=> String String #=> String String.name #=>
"String" String.class #=> Meta:String Array<Int> #=> Array<Int> Array<Int>.name #=> "Array<Int>" Array<Int>.new #=> [] Array<Int>.class #=> Meta:Array<Int>
ͳͥClassͰͳ͍ͷ͔ • Rubyͩͱ StringArrayClassΫϥε • ͔͠͠String.newͱArray.new(વͳ͕Β)γ άωνϟ͕ҧ͏ • => Class.newͷγάωνϟ͕ҰҙͰͳ͍
• => ͦΕͧΕҧ͏Λͭ͜ͱʹͨ͠
༨ஊɿΫϥεͱܕͷؔ • Ϋϥε != ܕ • ྫɿfoo(x: Float) • xFloatͷଞʹIntͰΑ͍
• ܕʹͷू߹(ͲͷΑ͏ͳΫϥεͷΠϯελϯ εΛڐ͔͢) ͜͜ΫϥεͰͳ͘ɺ ܕΛॻ͘ཝ
ޓੑʹ͍ͭͯ • Rubyͱͷޓੑॏࢹ͠ͳ͍ɻྫɿ • Ruby: "foo".start_with?("f") • Rust: "foo".starts_with("f") •
startsʹ߹Θ͍ͤͨ
ࠓޙͷల
ೖΕ͍ͨͷ • Enum (Option͕΄͍͠) • ύλʔϯϚον
ݕ౼தͷͷ • RubyͷModuleతͳͷ • ྫ֎ʁ • async/await
ೖΕͳ͍ͷ • Ϣʔβఆٛԋࢉࢠ • ߏจϚΫϩ • ಡղ͕େมͳͷͰ • Rubyͷdefine_methodͷΑ͏ʹɺओͳ༻్ΛΧόʔ͢Δͷ(Ṗ)ΛΘ ΓʹೖΕ͍ͨ
• ηϧϑϗετ͠ͳ͍ • σόοά͕େม • ظతʹੑೳ͕ॏཁʹͳΔ
Δ͜ͱແݶʹ͋Δ • ... • ׂίϯύΠϧ • ඪ४ϥΠϒϥϦ • ύοέʔδγεςϜ •
...
ҰॹʹΓ·͠ΐ͏ʂʂ • ݴޠॲཧܥSlack • https://prog-lang-sys-ja-slack.github.io/ wiki/ • νϟϯωϧ #shiika •
https://github.com/yhara/shiika