Kalai transpiler is a source-to-source transpiler to convert Clojure to multiple target languages (Rust, C++, Java, ...).
The goal of Kalai is to allow useful algorithms to be encoded once and then automatically be made available natively to other target programming languages.
The forms that are currently supported are listed in
If you have code written in
your.namespace, then you can emit code as follows, assuming there is a file
your/namespace.clj relative to where the program is run:
lein run -i your -o someoutdir -l rust
In this example, an output file will be written to
Implemented target languages
- Clojure (Kalai is source compatible with Clojure)
Extending or adding languages
Clojure supports namespaced keywords to enable the dynamic dispatch fallback hierarchies for multimethods. The namespaced keywords for the target languages follow the Clojure derivation tree:
::l/curlybrace("curly brace" languages)
To extend or add implementations, add multimethod definitions in
Issues and Pull requests welcome!
Copyright © 2020 The Kalai Authors.
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: Unicode License (https://www.unicode.org/license.html).