Run CPython from Java or Clojure, including native Python packages. The runtime bundles its own interpreter. Vis uses it.
Released platforms: Linux x64 and arm64, and macOS x64 and arm64. Use JDK 22 or newer. Builds and release tests use JDK 25. Linux requires glibc 2.35 or newer. On Windows x64, build from source. CI does not build Windows. Releases have no Windows archive.
Download the JVM jar and platform archive from the same
release. Unpack the
platform archive. Keep the native library next to its python/ tree. The archive
supplies Python.
- Java and Clojure quickstarts — installation, working examples, and expected output.
- Embedding guide — execution APIs, callbacks, session lifecycle, errors, and confinement.
- API reference: download the documentation ZIP from the release, extract it,
and open
index.htmlfor the Javadoc and Codox references. Javadoc includes a search box. The release also includes a standard Javadoc jar for IDEs.
import com.blockether.vispython.Interpreter;
import com.blockether.vispython.Native;
import java.util.List;
public class Example {
public static void main(String[] args) {
Native.use(args[0]); // Unpacked platform archive directory
Interpreter.initialize(List.of(), Interpreter.DEFAULT, Interpreter.DEFAULT, null);
try {
System.out.println(Interpreter.eval("example", "sum([1, 2, 3])")); // 6
} finally {
Interpreter.closeSession("example");
}
}
}Start Java with --enable-native-access=ALL-UNNAMED. See the quickstart for
classpath commands on Linux, macOS, and Windows. The
runnable Java example also shows block output and
a host callback.
Add the release commit as a tools.deps git dependency. Prepare the Java bridge. Then evaluate:
(require '[com.blockether.vis-python-runtime :as python])
(python/use-library! "/path/to/unpacked/runtime")
(python/initialize! {:packages nil})
(try
(python/eval-str "example" "sum([1, 2, 3])") ; => "6"
(finally
(python/close-session! "example")))These examples run trusted code without confinement. Sessions have separate globals but share one interpreter, imported modules, and the GIL. A session is not a security boundary. Read the embedding guide before you run untrusted code.
clojure -T:build javac
clojure -X:docsOpen target/docs/index.html. Java reference comes from Javadoc comments; Clojure
reference comes from namespace and function docstrings through Codox. The build
also compiles the Java example. Generated files stay out of source control and
documentation tools add no runtime dependencies.
Run this command from the repository root:
scripts/check-tlaUse Python 3 on macOS arm64 or Linux x64 or arm64 with glibc 2.35 or later.
The first run downloads and verifies the pinned checker. You do not need a JDK
or a native build. The check compares all results with expected.txt, including
expected failures. See the runtime models for the code map,
limits, and results. Use --only RuntimeHostReplyRetry to check one model.
The host models are the Vis host models with the
identity of this runtime. The check downloads the pinned Vis files for them.
MIT.