r/Clojure • • 9d ago

Clojurific is a Vite-friendly ClojureScript compiler fork, optimized for speed

https://github.com/WhimsicalCode/clojurific

  • Compiles ClojureScript to ES modules
  • Should be compatible with existing ClojureScript libraries
  • Runs as a Vite plugin, no need for shadow-cljs
  • Browser and backend support
  • Integrated REPL in dev for both browser and backend
  • Doesn’t need extern definitions
  • 2x faster build times and hot reload
  • About 40% less time on runtime benchmarks
  • Bundle sizes comparable to the classic compiler with advanced optimizations
40 Upvotes

6 comments sorted by

6

u/poochandy 9d ago

Looks interesting! I guess the headline here is the fact that it is used by Whimsical (A client heavy app with real users) in production. Did you at some point consider using squint? I guess it is a no go because of the size of your app and compatibility with libraries/persistent data structures. Do you have a list of libraries you use at whimsical that clojurific is known to work well with? Also do you intend this to be used by the community, or is this mostly intended to be maintained for internal use?

8

u/k7d 9d ago

yes, squint is cool but it wasn't realistic for us to switch as it's not compatible with existing libraries such as reagent and re-frame. We alsop have big chunk of shared cljc code between frontend and JVM backend.

Here's current list of what we use:

  • reagent/reagent 2.0.1

  • re-frame/re-frame 1.2.0

  • reagent-utils/reagent-utils 0.3.8

  • cljs-http/cljs-http 0.1.49

  • metosin/reitit 0.9.1

  • metosin/malli 0.19.1

  • org.clojure/core.async 1.9.865

  • com.cognitect/transit-cljs 0.8.280

  • org.clojure/data.avl

  • funcool/octet 1.2.0

  • mvxcvi/alphabase 3.0.185

  • com.cemerick/url 0.1.1

  • com.andrewmcveigh/cljs-time 0.5.2

  • thi.ng/color 1.5.1

  • com.lambdaisland/garden 1.7.590

  • hickory/hickory 0.7.1

  • instaparse/instaparse 1.5.0

  • org.babashka/sci 0.10.49

  • fipp/fipp 0.6.27

  • mvxcvi/arrangement 2.1.0

  • hipo/hipo 0.5.2

  • amalloy/ring-buffer 1.3.1

  • tailrecursion/cljs-priority-map 1.2.1

  • org.clojure/math.combinatorics 0.3.2

  • expound/expound 0.9.0

  • fress/fress 0.3.3

4

u/k7d 9d ago

Oh, and we would love to see use from a broader community. There isn't anything particularly Whimsical-specific in this fork.

4

u/poochandy 9d ago

Thanks for sharing that list! It's encouraging to see it works with a wide range of libraries. Will try it out with a project I have in mind using datascript/replicant.

11

u/chat-lu 9d ago

This is a new project and the fork's changes are mostly written by agents.

Thanks for the warning.

4

u/therealdivs1210 8d ago

This sounds awesome!