The Clojure host contract as DATA: resources/vis-contract/clojure-host.edn.
com.blockether.vis.contract.python-host declares what a PYTHON extension may
ask the host for. This is its symmetric half for CLOJURE extensions, which have no
sandbox at all: an extension is a deps project with the whole engine on its
classpath, so the facade com.blockether.vis.core is a promise nothing enforced.
The document names the facade, where extension code lives, and the FROZEN set of
internal namespaces extensions already require past it. This namespace reads and
validates the document and re-derives the real coupling from the tree, so
contract.clojure-host-test can fail on drift in either direction.
It ships in com.blockether/vis-contract beside its Python twin and requires no
Vis namespace: a linter in somebody else's repository can read the same document
the engine's own suite enforces.
The Clojure host contract as DATA: `resources/vis-contract/clojure-host.edn`. [[com.blockether.vis.contract.python-host]] declares what a PYTHON extension may ask the host for. This is its symmetric half for CLOJURE extensions, which have no sandbox at all: an extension is a deps project with the whole engine on its classpath, so the facade `com.blockether.vis.core` is a promise nothing enforced. The document names the facade, where extension code lives, and the FROZEN set of internal namespaces extensions already require past it. This namespace reads and validates the document and re-derives the real coupling from the tree, so `contract.clojure-host-test` can fail on drift in either direction. It ships in `com.blockether/vis-contract` beside its Python twin and requires no Vis namespace: a linter in somebody else's repository can read the same document the engine's own suite enforces.
The Python host contract as DATA: resources/vis-contract/python-host.edn.
Everything the vis Python module can ask its host to do is one entry in that
document — the polyglot global the engine binds, how many positional arguments
the callable takes, and what the op does when there is no Vis host at all. The
engine derives the names it binds from here, the injected host is built from
here, and the package's outside-the-sandbox host derives its behavior from
here, so a new host call is added to the document and nowhere else.
This project is com.blockether/vis-contract and requires NO Vis namespace, so
an extension can compile against the declaration without the engine. Its PyPI
half ships package-document as vis_contract/contract.json.
The human-input vocabulary is the one part this project does not own:
internal.human-input.spec declares it and PASSES it to package-document,
because a closed vocabulary with two definitions is exactly the bug a contract
exists to prevent.
The document is validated the moment it is read: a malformed contract is a
broken build, not a runtime surprise inside somebody's extension.
contract.python-host-test is what fails when a reader drifts.
The Python host contract as DATA: `resources/vis-contract/python-host.edn`. Everything the `vis` Python module can ask its host to do is one entry in that document — the polyglot global the engine binds, how many positional arguments the callable takes, and what the op does when there is no Vis host at all. The engine derives the names it binds from here, the injected host is built from here, and the package's outside-the-sandbox host derives its behavior from here, so a new host call is added to the document and nowhere else. This project is `com.blockether/vis-contract` and requires NO Vis namespace, so an extension can compile against the declaration without the engine. Its PyPI half ships [[package-document]] as `vis_contract/contract.json`. The human-input vocabulary is the one part this project does not own: `internal.human-input.spec` declares it and PASSES it to [[package-document]], because a closed vocabulary with two definitions is exactly the bug a contract exists to prevent. The document is validated the moment it is read: a malformed contract is a broken build, not a runtime surprise inside somebody's extension. `contract.python-host-test` is what fails when a reader drifts.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |