Skip to content

Bootstrapped ClojureScript FAQ

Mike Fikes edited this page Jul 18, 2015 · 41 revisions

Does bootstrapped ClojureScript mean that I'll be able to develop ClojureScript without the JVM?

It is not a goal of bootstrapped ClojureScript to eliminate the JVM.

  • The JVM is used by Google Closure Compiler. Thus a JVM needs to be present for anything other than compiler :optimizations set to :none. (While :none is common for REPL development, :advanced is often used for production builds.)
  • The JVM implementation is efficient. As things stand now it usually leads to faster reading, analysis, and compilation than most JavaScript engines.
  • Much of the existing ClojureScript compiler infrastructure relies on Java-based file I/O and use of the classpath.

While there may be some advantages to a completely JVM-free implementation, developing and maintaining such a thing is not free, and is thus not a goal of the project.

Having said that, there is nothing preventing the creation of development tools (REPLs, IDEs, etc.) that make use of bootstrapped ClojureScript without a JVM present.

Why was bootstrapped ClojureScript created?

Reach.

Without bootstrapped ClojureScript, if you want to build an application that can evaluate ClojureScript forms at runtime, you need to delegate that task to some backend compiler service (this is how Himera works). By enabling the compiler to be used from within the target JavaScript environment, novel use cases can be implemented. This enables innovation in new creative ways:

  • Shipping dev tools that don't require a JVM dependency.
  • Low-latency scripting, making use of JavaScript engines' inherent fast startup in interpreted mode.
  • Live updates to deployed codebases. (Ship code that can be compiled in target environment and dynamically incorporated in app. Mobile app updates, etc.)
  • Web pages that provide dynamic online tutorials or showcase ClojureScript libraries.
  • REPLs on mobile devices, without requiring network access to a compiler backend.
  • Diagnostic REPLs embedded in apps, making it easier to examine state of running app.

The community is just beginning to scratch the surface on what is possible with this new capability!

Clone this wiki locally