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
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
760
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
230
Our Practices of Delegating Ownership in Microservices World
dtan4
4
9k
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.3k
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
インシデントレスポンス演習 I / Incident Response Exercise I
ks91
PRO
0
100
気軽に使える"情報のハブ"としてのNotion活用 〜フロー情報の集積点 と、 Claude Code × Notion AI〜
syucream
1
160
手塩にかけりゃいいってもんじゃない
ming_ayami
0
620
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
440
GitHub Copilot app最速の発信の裏側
tomokusaba
1
220
自宅LLMの話
jacopen
1
690
20260619 私の日常業務での生成 AI 活用
masaruogura
1
230
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
2
730
【Snowflake Summit 2026 Recap!!】Snowflake Summit Deep Dive: Security & Governance
civitaspo
1
280
新しいUbuntu/GNOMEが使いたいからXからWaylandへ移行頑張ってるの巻 2026-06-20
nobutomurata
0
160
サイバーエージェントにおけるAI推進戦略と変革への取り組み
shotatsuge
0
310
Oracle Cloud Infrastructure:2026年6月度サービス・アップデート
oracle4engineer
PRO
0
170
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
860
Scaling GitHub
holman
464
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
30 Presentation Tips
portentint
PRO
1
330
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
BBQ
matthewcrist
89
10k
Side Projects
sachag
455
43k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
480
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
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 ք۾ͷࢿ࢈ΛҠ২ͦ͢͠͏ • ΤίγεςϜڵོͯ͠΄͍͠