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
REPL-Oriented
Search
ayato
October 09, 2015
Programming
6.5k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
REPL-Oriented
ayato
October 09, 2015
More Decks by ayato
See All by ayato
マイクロサービス内で動くAPIをF#で書いている
ayato0211
1
1.7k
Clojureという言語が私逹にもたらしたもの
ayato0211
6
3.2k
3年間考え続けてきたWebアプリケーションにおけるテストの話
ayato0211
3
320
Re:REPL-Driven Development
ayato0211
3
1.4k
Meta Template Engine
ayato0211
2
1.2k
超変換! Hiccup data structure!!
ayato0211
2
690
About Integrant
ayato0211
0
620
Muscle Assert
ayato0211
0
340
Clojureを用いたWebアプリケーション開発
ayato0211
2
3.3k
Other Decks in Programming
See All in Programming
Modernizing iOS Apps
seyfoyun
0
120
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
170
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
APNsからLive Activityを開始する話
yumnumm
0
180
ActionController meets Protocol Buffers
sorah
1
720
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
590
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
7k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
340
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
150
Jetpack Compose Mechanisms
skydoves
3
870
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
150
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.4k
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
470
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
The SEO identity crisis: Don't let AI make you average
varn
0
610
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
310
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
How to Talk to Developers About Accessibility
jct
2
590
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
850
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Code Reviewing Like a Champion
maltzj
529
40k
Transcript
REPL 指向 第 13 回 #渋谷java @_ayat_p / Cybozu Startups,
Inc.
REPL 指向至高 第 13 回 #渋谷java @_ayat_p / Cybozu Startups,
Inc.
(def _ayato_p {:name "あやぴー" :lang [:clojure] :company "Cybozu Startups, Inc."})
(def _ayato_p {:name "あやぴー" :lang [:clojure] :company "Cybozu Startups, Inc."})
最近 Clojure しか 書けなくなりました
はじめに
"REPL の話をします"
None
とは言ったけど
"Java の"とは一言も 言ってない :P
"Java の"とは一言も 言ってない :P "Clojure の" REPL の話をします
今日話すこと
•改めて REPL とは •Clojure における REPL とは •REPL 駆動開発
改めて REPL とは
•最近の言語はだいたい備えている •Ruby -> irb, Python -> ipython •Kotlin, Scala など
JVM 言語でも! (そろそろ Java でも !?)
•Read-Eval-Print Loop •読んで、評価して、出力する繰り返し
•Read-Eval-Print Loop •読んで、評価して、出力する繰り返し #とは
# e.g.) Ruby REPL irb(main):001:0> def hello irb(main):002:1> "Hello,
world" irb(main):003:1> end => nil irb(main):004:0> hello => "Hello, world"
# e.g.) Ruby REPL irb(main):001:0> def hello irb(main):002:1> "Hello,
world" irb(main):003:1> end => nil irb(main):004:0> hello => "Hello, world" READ & EVAL READ & EVAL
# e.g.) Ruby REPL irb(main):001:0> def hello irb(main):002:1> "Hello,
world" irb(main):003:1> end => nil irb(main):004:0> hello => "Hello, world" PRINT PRINT
# e.g.) Ruby REPL irb(main):001:0> def hello irb(main):002:1> "Hello,
world" irb(main):003:1> end => nil irb(main):004:0> hello => "Hello, world" LOOP
•対話的に開発するためのツール •考えた機能を確認しながら実装できる •(閉じた) REPL 環境に蓄積される •たぶん便利(?)
•対話的に開発するためのツール •考えた機能を確認しながら実装できる •(閉じた) REPL 環境に蓄積される •たぶん便利(?) その REPL 本当に便利ですか?
Clojure における REPL とは
たぶんあなたはこう思っている? 「 "Clojure における REPL" ? 他の言語と同じだろ? 」
たぶんあなたはこう思っている? 「 "Clojure における REPL" ? 他の言語と同じだろ? 」 違うんです
Clojure の REPL • Clojure は実行時に Clojure コンパイラの機 能をフルで使える •
REPL 上での実行はファイルのロードと同じよ うに動く • テキストエディタ等と協調動作しやすいよう になっている
違い • ファイルベースのワークフロー ( e.g. save -> auto-compile -> reload
) が必要ない • 実行中のプログラム環境を直接触れる • ライブラリですら REPL 上で再定義可能 • 環境を触る機能が充実している ( clojure.repl, tools.namespace とか ) • 本番環境ですら REPL を接続出来る
;; file (ns example.core) (defn inner-fn []) (defn outer-fn []
(inner-fn)) ;; repl e.c> (outer-fn) => nil e.c> (defn inner-fn [] "This is inner fn") => #'example.core/inner-fn e.c> (outer-fn) => "This is inner fn"
こういう経験ありませんか? • ファイル全体を更新したく ないけど、一部変更を反映 させたい • 開発時に素早くマイグレー ションしたい • SQL
をインクリメンタルに 書きたい • もっと早くトライアンドエ ラーしたい • ブラウザの環境を使いたい (in AltJS) • あの関数の名前が思い出せ ない • ドキュメントだけだと分か らないから試してみたい • etc, etc...
こういう経験ありませんか? • ファイル全体を更新したく ないけど、一部変更を反映 させたい • 素早くマイグレーションし たい • SQL
をインクリメンタルに 書きたい • もっと早くトライアンドエ ラーしたい • ブラウザの環境を使いたい (in AltJS) • あの関数の名前が思い出せ ない • ドキュメントだけだと分か らないから試してみたい • etc, etc... Clojure なら 簡単に解決可能
•REPL は Clojure での開発でなくては ならない存在 •むしろ REPL と適当なエディタで十分 ( Rich
Hickey は実際に Emacs と事実上 REPL だけで開発しているとかなんとか) •逆に REPL ないとつらい
•REPL は Clojure での開発でなくては ならない存在 •むしろ REPL と適当なエディタで十分 ( Rich
Hickey は実際に Emacs と事実上 REPL だけで開発しているとかなんとか) •逆に REPL ないとつらい REPL が開発を 加速させる
REPL 駆動開発
•REPL Driven Development •REPL で素早いフィードバックを得る
ワークフロー 考える/ コードを書く 思った通りに動く? REPL で試す テストを書いて 仕様を固める * ͷৗͰ͢
• Clojure の特徴も相まって REPL 上であら ゆる関数が簡単に実行可 • REPL を使ってボトムアップ開発 •
REPL で関数の定義やドキュメントが読める (悩んだら REPL に聞ける)
副産物的なもの •REPL からあらゆるコマンドを実行可 (サーバーを起動したり、マイグレーションしたり) •JVM の起動オーバーヘッドがない
デメリット(?) •まれに REPL 上の定義が残ってて誤動 作するときがある •テスト書きたくなくなる (だって動いてるし…)
まとめ
•REPL 駆動開発は楽しい •Clojure の REPL は最高 •Clojure 最高
Enjoy Clojure