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
92
純LISPから考える関数型言語のプリミティブ: Clojure, Elixir, Haskell, Scala
lagenorhynque
1
93
From Scala/Clojure to Kotlin
lagenorhynque
0
43
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
75
My Favourite Book in 2024: Get Rid of Your Japanese Accent
lagenorhynque
1
110
do Notation Equivalents in JVM languages: Scala, Kotlin, Clojure
lagenorhynque
0
78
map関数の内部実装から探るJVM言語のコレクション: Scala, Kotlin, Clojureコレクションの基本的な設計を理解しよう
lagenorhynque
0
72
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
66
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
97
Other Decks in Programming
See All in Programming
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
290
AI時代のUIはどこへ行く?
yusukebe
16
8.5k
Ruby Parser progress report 2025
yui_knk
1
320
More Approvers for Greater OSS and Japan Community
tkikuc
1
110
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
230
AIエージェント開発、DevOps and LLMOps
ymd65536
1
380
Swift Updates - Learn Languages 2025
koher
2
460
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.4k
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
Go言語での実装を通して学ぶLLMファインチューニングの仕組み / fukuokago22-llm-peft
monochromegane
0
120
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
1.1k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
36
6.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Building Adaptive Systems
keathley
43
2.7k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
111
20k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Designing for Performance
lara
610
69k
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