Repository navigation
Expand file tree
/
Copy pathextension.pl
More file actions
32 lines (29 loc) · 1.76 KB
/
Copy pathextension.pl
File metadata and controls
32 lines (29 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Purpose: declare the Python seat's entry points and required Prolog library.
%
% This seat's control file: facts the engine READS and never consults, the
% PostgreSQL control-file model the runtime import scan already follows. The
% engine's loader (engine/metta.pl) checks every needs/1 and loads every
% entry(engine, _) only when all of them hold; an unmet need is recorded and
% queryable rather than a silent branch.
%
% library(janus) is SWI's own Python bridge, and its absence (the WASM build, a
% stripped install) means this host cannot exist rather than that anything is
% wrong: a tree without it loads nothing and says nothing, and a tree with it
% loads a bridge that raises if it is broken. Not present is not an error;
% half present is.
title('MeTTa in Python: the janus bridge and the metta library''s transport').
needs(prolog_library(janus)).
% The patches to janus this seat's code relies on, generated from the ledger's
% patches to packages/swipy by `sh tools/pymetta-host/declare-host.sh require
% packages/swipy`. Every host that loads this seat's engine entry loads janus
% through it, the Python host, the C host and the SWI host alike, so the engine
% holds each of them to these before the entry loads.
requires(host_patches('metta/_binding/host_patches.pl')).
% The two directions under their own roles, which is what dissolves this seat's
% bridge/shim naming: entry(engine, ...) is the ENGINE reaching Python (py-atom
% resolves, py-call applies; consulted here at boot), and entry(host, ...) is
% Python reaching the ENGINE (the metta library's transport, consulted by
% metta/_binding/runtime.py when the library boots -- the engine's loader records it and never
% loads it).
entry(engine, 'metta/_binding/surface.pl').
entry(host, 'metta/_binding/shim.pl').