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
Ruby 風シンタックスな静的言語 Crystal の紹介
Search
Pine Mizune
June 23, 2015
Programming
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby 風シンタックスな静的言語 Crystal の紹介
社内新卒技術勉強会の資料
Pine Mizune
June 23, 2015
More Decks by Pine Mizune
See All by Pine Mizune
多言語対応と絵文字ジェネレーター / i18n of Emoji Generator
pine
0
900
C++ 製グラフィックライブラリ Skia の紹介 / Introduction to the graphics library Skia written by C++
pine
0
2k
asyncio + aiohttp で作るウェブサービス / How to develop a web service with asyncio and aiohttp
pine
0
710
Lerna による明示的疎結合アーキテクチャ
pine
1
690
CircleCI 2.0 x JavaScript
pine
3
580
Perl 卒業式
pine
0
380
Android Studio の気になる warnings を抑制する方法まとめ
pine
0
540
Emoji Generator meets Browser Extensions
pine
1
3k
近年の OSS 開発における CI 選択のベストプラクティス
pine
3
4.5k
Other Decks in Programming
See All in Programming
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
290
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
2
570
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
130
App Intentsのビルドプロセスを支える技術
kntkymt
0
500
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
220
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
420
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
iOSDC2026登壇資料.pdf
riofujimon
0
200
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
setup-vp GitLab対応の裏側
naokihaba
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
470
Featured
See All Featured
Marketing to machines
jonoalderson
1
5.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Optimizing for Happiness
mojombo
378
71k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
730
Paper Plane
katiecoart
PRO
4
53k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
910
Ruling the World: When Life Gets Gamed
codingconduct
0
380
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Transcript
Crystal Ruby 風シンタックスな静的言語の紹介 水音ぴね
目次 • Crystal とは ? • Crystal と Ruby の相違点
• Crystal の使い所とは ? • Crystal の開発進捗
Crystal とは ? ヒトコトで言うと …? 3 u Ruby の表現力
u C の速度 を兼ね備えた言語 と
Crystal 詳細 • Ruby に酷似した syntax • 静的型付け / コンパイラ言語
– LLVM ベース • 非常に高速 • C 言語資源の再利用性を重視 4
Ruby の復習 5 • 動的型付け • インタプリタ /
JIT コンパイラで動作 • Ruby on Rails がとても有名 – ORM のチューニングが大変なことで有名 • Pascal / Delphi 系 シンタックス
Ruby syntax require ‘sinatra’ get ‘/’ do name =
if params[:name] params[:name] else ‘anonymous’ end ” Hello world, #{name} ” end 6 # 制御構文に括弧はない # メソッド呼び出しのカッコを省略できる # end 地獄
Crystal syntax app = App.new
app.route “/”, do |req| name = if req.get.has_key? “name” req.get[“name”] else “anonymous” end ok("Hello world, #{name}") end app.run(ENV[“PORT”].to_i) 7 # 入らなかったので require 省略してます # end 地獄は健在 # Hash の key が無いと exception # (Ruby よりちょっと厳しい) # to_i 使える!
Crystal syntax ≒ Ruby syntax 8 • ほとんど同じだって
Matz も言ってる!! 出展: https://twitter.com/yukihiro_matz/status/610842781091672064
Crystal と Ruby の相違点 9 Ruby 比較項目 Crystal 遅い
実行速度 早い 可能 (FFI / Extension) C との連携 容易 (それを前提に設計) 中央管理 (rubygems.org) ライブラリ リポジトリ 分散 (git) Bundler 依存モジュール管理 コンパイラに内蔵 安定フェーズ (v2.2.x) 安定性 開発フェーズ (v0.7.x)
Crystal の使い所 10 • 速度が求められる場所 • C /
C++ からの段階的移植 • Ruby エンジニアが多い環境での新規採用 • クロスプラットフォームで高速な CLI ツール (現状の Golang の領域) もちろん、安定版という条件ですが
11 Crystal の開発進捗について ※ 『 のんのんびより りぴーと 』 は
7月6日 スタート!
• 最新版: v0.7.3 (2015/06/07) • セルフホスティングコンパイラ – ある仕様 FIX &
安定動作するフェーズ • 安定した開発 12 [Crystal 進捗] 全般
• Linux – 公式サポート: Debian / Ubuntu / RHEL / CentOS
• Mac OS X – Homebrew tap を提供 • Windows – 未サポート – GitHub に Issue はある ... 13 [Crystal 進捗] 対応環境
• コンパイラに内蔵 – Golang と同じかんじ • 依存関係は Projectfile に記述 –
Cpanfile, Gemfile と同じかんじ • 分散型 リポジトリ – GitHub を直接参照 / Golang と(ry 14 [Crystal 進捗] パッケージマネージャ Ruby ... gem, Bundler Perl ... cpanm, Carton
Fin.