Clojure (experimental)
Experimental. rontolisp reads a small subset of Clojure -- just large enough to run a
Clojure-shaped program on every backend. Conformance is partial by design and nothing here
is a subset or compatibility promise. Use it to try a Clojure program on the JVM or
WebAssembly; write Common Lisp for anything you need to keep working. Interop runs on the
interpreter and the JVM only: the wasm backends reject the java: surface it lowers to.
A .clj or .cljc file is read as Clojure (a .cljc file with its reader conditionals);
--source-language clojure says so for any other file. The language is picked per file, so one program may mix the two.
rontolisp hello.clj # interpreter
rontolisp hello.clj -o Hello.class && java Hello # JVM
rontolisp hello.clj -o hello.wasm && wasmtime run hello.wasm
rontolisp hello.clj -o hello-c.wasm --component && wasmtime run hello-c.wasm
rontolisp prog.txt --source-language clojure # any extension
A deps.edn project runs as clj runs it: rontolisp -M:dev -m my.app args,
rontolisp -X:build, and rontolisp test for its tests (Semantics).
examples/clojure/ holds runnable programs with their expected output: the
collections, text and regular expressions, macros, the reference types, the bundled
namespaces, reader conditionals, a deps.edn project, Java interop and a Java library, the
HTTP client against a Ring handler, and the WASM and WIT boundary.
--no-gc is refused: that backend has no pairs, symbols or closures.
The supported surface, one page per name, is the Reference: the core
binding and control forms with sequential and map destructuring, the threading macros,
the seq verbs over strict list views of every collection, the persistent map and set
operations over equal hash tables, the numeric and predicate core, atoms and volatiles,
multimethods with hierarchies, try/catch/finally with ex-info, namespaces across
files (ns/require of project files) and clojure.string, clojure.set, clojure.walk, clojure.edn, clojure.pprint, clojure.test with its summary runner, a Ring adapter serving a handler on every
backend (ring.adapter.rontolisp), an HTTP client sending through rontolisp:fetch on every backend that has it (rontolisp.http-client), the WASM host boundary and WIT contracts (rontolisp.wasm,
rontolisp.wit), and Java interop. What each form lowers to, and what stays
refused, is Semantics; the reader rules are Syntax; the
departures from the oracle are Deviations.
This section
| Page | Contents |
|---|---|
| REPL | The clojure> REPL |
| nREPL | The REPL served to editors over nREPL |
| Syntax | The reader: literals, characters, radix integers, keywords |
| Semantics | What lowers to what; the refused forms |
| Deviations | Where behavior departs from Clojure |
| Reference | One page per supported name |