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
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
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
430
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
1.1k
データ_AIの事業の勝敗をわけるもの
nek0128
1
470
AI coding 整合正規方法
philipz
0
450
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
170
2026-09-08 そのJavaモダナイゼーション、AIに丸投げで大丈夫?IBM Bobで変わる品質と効率
yutanonaka
1
120
Deployment の 先にある AI Agent 基盤 - kagent vNext、Agent Substrate、Hermes から読み解く Agent Runtime の現在地 / k8s-matsuri-2-ai-agent-platform-amsy810
masayaaoyama
4
700
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
cscengineer
PRO
0
140
ScotSecure West 2026 - Glasgow
raybugg
0
140
Genieを崇めよ
kameitomohiro
0
170
`t*(42&t>>10)`だけで音楽が鳴る、Swiftで実装するBytebeat / iOSDC Japan 2026
yutailang0119
0
130
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
150
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.9k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
So, you think you're a good person
axbom
PRO
2
2.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
540
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
360
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 ք۾ͷࢿ࢈ΛҠ২ͦ͢͠͏ • ΤίγεςϜڵོͯ͠΄͍͠