Yes, although that would not make sense.
Clojure -> JavaScript makes sense because:
- JavaScript is the only suitable target language for a wide class of web applications.
- This allows you to effectively use the Google Closure compiler to optimize the entire program.
- Clojure is a great source language because of its macro features and great support for defining expressive DSLs.
Clojure would be a strange choice for the target language - if you want to run on the JVM platform, it would be more natural to focus directly on Java bytecode.
JavaScript would also be a weird choice for compiling Clojure source code - if you want to use Clojure code, why would you just write Clojure directly? In particular, using (a possible subset of) JavaScript will not give you easy access to all the features that make Clojure really attractive (lazy functional programming, concurrency support, macro macro programming, persistent data structures, etc.)
mikera
source share