index

Compiling clojure to wasm

2024-01-17


Reasons for implementing wasm backend for clojure compiler:

To make a WASM backend to the clojurescript compiler we need to replace emit functions in the compiler for example using wasm.cljc.

To make the compiler development interactive in the clojure repl we could run the resulting wasm modules with wasmer-java or wasmtime-java. Wasmer and Wasmtime are still lacking GC though. V8 has wasm GC, but it's not clear wether it's Java bindings Javet or J2V8support running wasm. Calling J8 directly using the Java's new Foreign Function & Memory API could work also.

We need to implement low level functionalities such as the big integers and string manipulation which are inherited from java and javascript in clojure and clurescript. We could use c or rust libraries for those.

Developing a lower level language with the Clojure syntax interactively in Clojure repl could be a nice experience also.


systems programming language embedded in a higher level language
c language alternatives
JavaScript runtime is the ultimate runtime?
JavaScript runtime is the ultimate runtime?
systems programming language embedded in a higher level language

This site is generated with zetgen