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
From JS To CLJS
Search
Kent OHASHI
May 12, 2017
Programming
0
34
From JS To CLJS
JavaScriptからClojureScriptへ
ClojureをJavaScriptの世界でも利用しよう!
Kent OHASHI
May 12, 2017
Tweet
Share
More Decks by Kent OHASHI
See All by Kent OHASHI
From Scala/Clojure to Kotlin
lagenorhynque
0
9
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
25
My Favourite Book in 2024: Get Rid of Your Japanese Accent
lagenorhynque
0
46
do Notation Equivalents in JVM languages: Scala, Kotlin, Clojure
lagenorhynque
0
31
Exploring Collections in JVM Languages through Internals of map Function
lagenorhynque
0
34
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
35
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
59
Boundary between Mutability and Immutability
lagenorhynque
0
67
Learning Modern Web API Styles from IDL: REST, GraphQL, gRPC
lagenorhynque
0
100
Other Decks in Programming
See All in Programming
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
PEPCは何を変えようとしていたのか
ken7253
3
290
コードを読んで理解するko build
bells17
1
110
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
1.2k
Django NinjaによるAPI開発の効率化とリプレースの実践
kashewnuts
1
290
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
160
[JAWS DAYS 2025] 最近の DB の競合解決の仕組みが分かった気になってみた
maroon1st
0
150
Expoによるアプリ開発の現在地とReact Server Componentsが切り開く未来
yukukotani
0
100
SwiftUI Viewの責務分離
elmetal
PRO
2
280
Rubyと自由とAIと
yotii23
6
1.8k
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
230
JAWS Days 2025のインフラ
komakichi
1
130
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
51
7.4k
Bash Introduction
62gerente
611
210k
How to train your dragon (web standard)
notwaldorf
91
5.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
380
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
440
Documentation Writing (for coders)
carmenintech
68
4.6k
Gamification - CAS2011
davidbonilla
80
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
What's in a price? How to price your products and services
michaelherold
244
12k
A Philosophy of Restraint
colly
203
16k
Transcript
From JS To CLJS - Adieu JavaScript -
Self-introduction /laʒenɔʁɛ̃k/ カマイルカ lagénorhynque (defprofile lagénorhynque :name "Kent OHASHI" :account
@lagenorhynque :company "Opt, Inc." :languages [Clojure Haskell Python Scala English français Deutsch русский] :interests [programming language-learning mathematics] :contributing [github.com/japan-clojurians/clojure-site-ja])
Contents 1. What is ClojureScript? 2. Why does ClojureScript matter?
3. Language 4. Libraries 5. Tools
What is ClojureScript?
によると ClojureScript公式サイト ClojureScript is a compiler for Clojure that targets
JavaScript. It emits JavaScript code which is compatible with the advanced compilation mode of the Google Closure optimizing compiler.
ClojureScript (CLJS) JavaScriptをターゲットとしたClojureのコンパイラ cf. : Java/JVMがターゲット の 互換のJSコードを⽣成 Clojure Google
Closure Compiler advanced compilation mode
compilation process from ClojureScript: Up and Running
Why does ClojureScript matter?
JavaScriptの世界でもClojureのメリットを REPL駆動のインタラクティブな開発 関数型プログラミング 並⾏プログラミング 現代的なLisp → Webフロントエンド, , , etc.
Electron React Native
フロントエンド・サーバサイド間のスムーズな連携 コードの共有 .cljc & データの共有 , (cf. JSON, ) →
フロントエンドもサーバサイドもClojure reader conditionals EDN Transit MessagePack
Language
syntax cf. ※ CLJSのWeb REPL(e.g. )で試そう ClojureScript Synonyms ClojureScript -
Differences from Clojure Macros Replumb REPL
Clojure, ClojureScriptなどプラットフォーム間での 差異を吸収するための仕組み 拡張⼦ .cljc のファイル内で利⽤ と reader conditionals #?
#?@ (defn str->int [s] #?(:clj (java.lang.Integer/parseInt s) :cljs (js/parseInt s)))
Libraries
library references The Clojure Toolbox CrossClj razum2um/awesome-clojure
example: のReagent実装 cf. 採⽤例: Reagent A minimalistic ClojureScript interface to
React.js Reactチュートリアル lagenorhynque/react-tutorial Om circleci/frontend
Tools
build /ˈlainɪŋən/ Clojure, ClojureScript共通のビルドツール プラグインやプロジェクトテンプレートが豊富 設定ファイル project.clj (e.g. ) cf.
Leiningen react-tutorial Boot
hot loading Leiningenプラグイン ClojureScriptのオートビルド ブラウザのオートリロード etc. lein-figwheel
optimization CLJSのコンパイラオプション :optimizations level effect :none 最適化なし(デフォルト) :whitespace コメント/空⽩など削除 :simple
ローカル変数/関数引数リネーム :advanced グローバル変数/関数名/プロパ ティリネーム,デッドコード削 除,etc. Google Closure Compiler
Further Reading サイト : 公式サイト cf. : GitHub 書籍 翻訳:
ClojureScript Clojure clojure/clojurescript ClojureScript: Up and Running 『⼊⾨ ClojureScript』 ClojureScript Unraveled
スライド 英語版: ⼊⾨ClojureScript ClojureScriptという選択肢 ここ最近のClojureScript JavaからClojureへ From Java To Clojure