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.1k
スモートーク
yhara
0
2.8k
Ovto: Frontend web framework for Rubyists
yhara
0
7.1k
Ruby, Opal and WebAssembly
yhara
2
2.3k
Competitive Programming in Ruby (101)
yhara
0
660
Rubyで競技プログラミング(入門編)
yhara
0
1.7k
良いデバッグログはプロジェクトの資産である
yhara
54
18k
Let's make a functional language!
yhara
0
6.2k
Recent Updates (近況報告)
yhara
0
580
Other Decks in Programming
See All in Programming
Ebitengineの1vs1ゲーム WebRTCの活用
ponyo877
0
380
Android開発以外のAndroid開発経験の活かしどころ
konifar
2
1.1k
GraphQL あるいは React における自律的なデータ取得について
quramy
11
3k
なぜアジャイルがうまくいかないのか?
yum3
1
100
意外とフォントが大事だった話 / Font Issues on Internationalization
fumi23
0
110
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
Jakarta EE meets AI
ivargrimstad
0
390
Jakarta EE meets AI
ivargrimstad
1
540
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
1k
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
140
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
GraphQLとGigaViewer for Apps
numeroanddev
2
120
Featured
See All Featured
WebSockets: Embracing the real-time Web
robhawkes
59
7.3k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
36
6.8k
Facilitating Awesome Meetings
lara
49
6k
Embracing the Ebb and Flow
colly
83
4.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
How To Stay Up To Date on Web Technology
chriscoyier
786
250k
Web Components: a chance to create the future
zenorocha
309
42k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
5
490
Raft: Consensus for Rubyists
vanstee
136
6.5k
The Pragmatic Product Professional
lauravandoore
31
6.2k
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