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
41
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
関数型言語テイスティング: Haskell, Scala, Clojure, Elixirを比べて味わう関数型プログラミングの旨さ
lagenorhynque
1
81
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
71
From Scala/Clojure to Kotlin
lagenorhynque
0
33
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
57
My Favourite Book in 2024: Get Rid of Your Japanese Accent
lagenorhynque
1
94
do Notation Equivalents in JVM languages: Scala, Kotlin, Clojure
lagenorhynque
0
68
map関数の内部実装から探るJVM言語のコレクション: Scala, Kotlin, Clojureコレクションの基本的な設計を理解しよう
lagenorhynque
0
61
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
58
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
88
Other Decks in Programming
See All in Programming
ご注文の差分はこちらですか? 〜 AWS CDK のいろいろな差分検出と安全なデプロイ
konokenj
3
580
RailsGirls IZUMO スポンサーLT
16bitidol
0
200
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
7.3k
AI駆動のマルチエージェントによる業務フロー自動化の設計と実践
h_okkah
0
230
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
870
PicoRuby on Rails
makicamel
2
140
SQLアンチパターン第2版 データベースプログラミングで陥りがちな失敗とその対策 / Intro to SQL Antipatterns 2nd
twada
PRO
11
1.6k
リバースエンジニアリング新時代へ! GhidraとClaude DesktopをMCPで繋ぐ/findy202507
tkmru
3
960
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
1
470
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
220
ニーリーにおけるプロダクトエンジニア
nealle
0
950
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
1k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1031
460k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
How to Think Like a Performance Engineer
csswizardry
25
1.7k
What's in a price? How to price your products and services
michaelherold
246
12k
Adopting Sorbet at Scale
ufuk
77
9.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
108
19k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
A better future with KSS
kneath
238
17k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
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