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
19k
静的型付けプログラミング言語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.2k
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
600
Other Decks in Programming
See All in Programming
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
230
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
Refactor your code - refactor yourself
xosofox
1
260
たのしいparse.y
ydah
3
120
Haze - Real time background blurring
chrisbanes
1
510
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
선언형 UI에서의 상태관리
l2hyunwoo
0
160
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
talk-with-local-llm-with-web-streams-api
kbaba1001
0
180
useSyncExternalStoreを使いまくる
ssssota
6
1k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1030
460k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
How GitHub (no longer) Works
holman
311
140k
Thoughts on Productivity
jonyablonski
67
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Navigating Team Friction
lara
183
15k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
For a Future-Friendly Web
brad_frost
175
9.4k
Adopting Sorbet at Scale
ufuk
73
9.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
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