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
790
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.9k
Other Decks in Technology
See All in Technology
React Nativeでの OTA Updateって、 どう説明する?
ichiki1023
0
130
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
110
[2026 Oracle Technical Deep Dive] AI時代のデータベース基盤をどう選ぶ? Exadata Database Serviceの選択肢と使い分け (2026年9月17日開催)
oracle4engineer
PRO
0
170
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
310
Argo CDとAtlantisで実現するインフラ管理のセルフサービス化──小規模SREチームで支えるプラットフォーム
cassius7
0
270
形式手法を使って仕様をコーディングしよう
mikanichinose
0
160
[2026-09-30]ロックンロールは鳴り止まないっ - 信頼性かまってちゃん - 「データ駆動を投げ捨ててまで。」追いかける信頼性改善に向けた取り組みの話
tosite
0
180
1万名の社員が使う認証基盤で どう信頼性を担保するか?
kairim0
0
170
AWS DevOps Agent スキルをつかいこなそう / Master AWS DevOps Agent Skills
kinunori
2
660
Amazon Bedrock Agents ClassicからAmazon Bedrock AgentCoreへ移行した際、ガードレール設定が2箇所に割れた話
matsunobu
0
170
AIは爆速なのに、私が詰まっていた話 ― 音声入力と鳴くマスコットでボトルネックを削る
yama3133
0
270
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
5
2k
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
290
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
510
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
300
The Mindset for Success: Future Career Progression
greggifford
PRO
0
520
Testing 201, or: Great Expectations
jmmastey
46
8.3k
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 ք۾ͷࢿ࢈ΛҠ২ͦ͢͠͏ • ΤίγεςϜڵོͯ͠΄͍͠