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
96
From Scala/Clojure to Kotlin
lagenorhynque
0
44
TDD with RDD: Changed Developer Experience through Clojure/Lisp REPLs
lagenorhynque
0
76
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
80
map関数の内部実装から探るJVM言語のコレクション: Scala, Kotlin, Clojureコレクションの基本的な設計を理解しよう
lagenorhynque
0
73
Kotlin Meets Data-Oriented Programming
lagenorhynque
0
67
Introduction to Tree Representations in RDB 2024
lagenorhynque
0
98
Other Decks in Programming
See All in Programming
速いWebフレームワークを作る
yusukebe
5
1.7k
RDoc meets YARD
okuramasafumi
4
170
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
4.3k
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
710
Reading Rails 1.0 Source Code
okuramasafumi
0
250
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
2.8k
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
540
Swift Updates - Learn Languages 2025
koher
2
510
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
540
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
230
Platformに“ちょうどいい”責務ってどこ? 関心の熱さにあわせて考える、責務分担のプラクティス
estie
1
140
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Making Projects Easy
brettharned
117
6.4k
Visualization
eitanlees
148
16k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Code Review Best Practice
trishagee
71
19k
Designing for Performance
lara
610
69k
Producing Creativity
orderedlist
PRO
347
40k
Building an army of robots
kneath
306
46k
Being A Developer After 40
akosma
90
590k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
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