Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Programming Language Crystal
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Daisuke Fujita
July 29, 2015
Technology
780
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Programming Language Crystal
#w8lt 第四回 (2015-07-29) の発表資料です
http://w8lt.connpass.com/event/16856/
Daisuke Fujita
July 29, 2015
More Decks by Daisuke Fujita
See All by Daisuke Fujita
SREcon19 Asia/Pacific Recap
dtan4
0
240
Our Practices of Delegating Ownership in Microservices World
dtan4
4
9.1k
Kubernetes Cluster Upgrade / Mercari Meetup for Microservices Platform
dtan4
3
4.8k
KubeCon EU 2018 Recap: Multi-Tenancy in Kubernetes: Best Practices Today, and Future Directions / Kubernetes Meetup Tokyo 11 #k8sjp
dtan4
1
2k
Wantedly から Chef を一掃した話 / #chibadan
dtan4
24
11k
さようなら Chef こんにちは Dockerfile / Web Tech Tokyo #1
dtan4
6
7.4k
Docker をフル活用したインフラの紹介と成長し続けるためのインフラ戦略 / #abejameetup
dtan4
19
4.1k
Docker Compose PaaS の作り方、そして社内に導入した話 / #yapc8oji
dtan4
1
8.7k
Writing Kubenetes tools in Go
dtan4
1
3.8k
Other Decks in Technology
See All in Technology
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
33
30k
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
130
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
3
570
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
5k
技術的負債から考える、AI時代のエンジニアリング投資 — ビズリーチの技術的負債と向き合った経験から、変更し続けられるソフトウェアを考える/ technical-debt-con2026
visional_engineering_and_design
4
3.5k
リアーキテクチャ後の障害ゼロを目指したShadow Testingの取り組み
nihonbuson
PRO
1
170
積み重なった技術負債への挑戦 〜初手としての全社ゴト化〜
techtekt
PRO
0
1.5k
顧客に向き合う開発組織へ。リアーキテクチャとフィーチャーチーム化で挑む組織改革
safie
0
2.3k
2026-09-08 そのJavaモダナイゼーション、AIに丸投げで大丈夫?IBM Bobで変わる品質と効率
yutanonaka
1
120
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
460
品質と信頼性を地続きにする
grimoh
2
900
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Crafting Experiences
bethany
1
350
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
200
Facilitating Awesome Meetings
lara
57
7.1k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
470
Game over? The fight for quality and originality in the time of robots
wayneb77
1
290
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How to make the Groovebox
asonas
2
2.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Writing Fast Ruby
sferik
630
63k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
280
Transcript
Programming Language Crystal 2015-07-29 W8LT#4 @dtan4 IUUQTqJDLSQLZ[T
TF[FNJ ͪͦ͝͏͞·Ͱ͢
ಙాݚ.
IUUQTDSZTUBMTI
IUUQTDSZTUBMTI
IUUQDSZTUBMMBOHPSH
Crystal • Ruby ͬΆ͍γϯλοΫε • ੩తܕνΣοΫ • Crystal ͷίʔυͰ C
ॻ͚Δ • ωΠςΟϒίʔυੜ • Crystal -> LLVM IR -> ωΠςΟϒ http://crystal-lang.org/ https://github.com/manastech/crystal
• ίϯύΠϥ͕ Crystal Ͱ࣮͞ΕͯΔ (!) Crystal http://crystal-lang.org/ https://github.com/manastech/crystal
Crystal • Initial commit 2012-09-04 • v0.1.0 2014-06-19
• ݱࡏ v0.7.4 (2015-06-24) http://crystal-lang.org/ https://github.com/manastech/crystal
Crystal • Πϯετʔϧ (Mac OS X): • Try it online:
http://play.crystal-lang.org/ $ brew tap manastech/crystal $ brew update $ brew install crystal-lang
Crystal • Πϯετʔϧ (Mac OS X): • Try it online:
http://play.crystal-lang.org/ $ brew tap manastech/crystal $ brew update $ brew install crystal-lang CSFXOQNͰDSZTUBMೖΕͯΔͱ 1"5)ʹΑͬͯͿ͔ͭΔ Ϳ͔ͭͬͨ DSZTUBM ·͕͍ͪ
Crystal • εΫϦϓτ࣮ߦ • όΠφϦϏϧυ & ࣮ߦ: • ࠷దԽϏϧυ &
࣮ߦ $ crystal [run] hoge.cr $ crystal build hoge.cr $ ./hoge $ crystal build hoge.cr --release $ ./hoge
Ruby ͱͷҧ͍ • ҾʹܕࢦఆͰ͖Δ def hoge(n : Int) • γϯάϧΫΥʔτͩΊ
• Bool Bool ϦςϥϧɺΫϥε͡Όͳ͍ • RubyGems తͳύοέʔδγεςϜແ͍ • (crystal#220) • ࣗલͷґଘཧγεςϜ͕͋Δ $ crystal deps • ඪ४ϥΠϒϥϦʹ͍Ζ͍ΖἧͬͯΔ • ͳͲͳͲ $VSTFT )551 .BSLEPXO 0"VUI 4QFDʜ
ϕϯνϚʔΫ
ؔ #!/usr/bin/env crystal def tarai(x, y, z) return y if
x <= y tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y)) end puts tarai(13, 10, 0) #!/usr/bin/env ruby def tarai(x, y, z) return y if x <= y tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y)) end puts tarai(13, 10, 0)
ؔ #!/usr/bin/env crystal def tarai(x, y, z) return y if
x <= y tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y)) end puts tarai(13, 10, 0) #!/usr/bin/env ruby def tarai(x, y, z) return y if x <= y tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y)) end puts tarai(13, 10, 0) ιʔείʔυ શ͘ಉ͡ ճ UBSBJݺͼग़͠
ؔ 3VCZ $SZTUBM ͦͷ·· $SZTUBM Ϗϧυࡁ $SZTUBM ࠷దԽࡁ UBSBJ
T T T T
ؔ 3VCZ $SZTUBM ͦͷ·· $SZTUBM Ϗϧυࡁ $SZTUBM ࠷దԽࡁ UBSBJ
T T T T ͦͷ··Y όΠφϦϏϧυY
؆୯ͳ HTTP αʔό #!/usr/bin/env crystal require "http/server" server = HTTP::Server.new(8080)
do |request| HTTP::Response.ok "text/plain", "Hello world!" end server.listen #!/usr/bin/env ruby require "rack" app = Proc.new do |env| ["200", { "Content-Type" => "text/plain" }, ["Hello world!"]] end Rack::Handler::WEBrick.run(app, Port: 8080)
؆୯ͳ HTTP αʔό 3VCZ $SZTUBM ͦͷ·· $SZTUBM Ϗϧυࡁ $SZTUBM ࠷దԽࡁ
ฒྻ SFRT SFRT SFRT SFRT SFRT $ ab -k -c 10 -n 10000 http://localhost:8080/
؆୯ͳ HTTP αʔό 3VCZ $SZTUBM ͦͷ·· $SZTUBM Ϗϧυࡁ $SZTUBM ࠷దԽࡁ
ฒྻ SFRT SFRT SFRT SFRT SFRT $ ab -k -c 10 -n 10000 http://localhost:8080/ ͦͷ··Y ࠷దԽϏϧυY
WAF • Codcore/amethyst (ࢵਫথ) • Rails ͬΆ͍ͭ • druvrajvanshi/Moonshine •
Sinatra ͬΆ͍ͭ
ॴײ • ໊͍ • άάϥϏϦςΟ͍ • Go όΠφϦు͚Δ͚Ͳจ๏͕…ͱ͍͏ Rubyist ʹέ͕ྑͦ͞͏
• Ruby ք۾ͷࢿ࢈ΛҠ২ͦ͢͠͏ • ΤίγεςϜڵོͯ͠΄͍͠