← SPL reference

Modules & use

One statement loads a library into the current interpreter; dotted paths resolve under the SPL library roots (see interpreter).

SPL (.spl)

Parsed and executed in the same global scope as the host program (unless you structure code into functions). Chains with other statements. For a given use a.b.spl;, the interpreter looks for a.b.spl in the same directory as the SPL file that contains the use first, then under someProgrammingLanguage/lib/.

Inside classDefine, inherit path.spl; uses the same path rules to load a parent class from another .spl file — see Classes & OOP.

Python (.py)

Loaded via importlib. The module should expose spl_register(interpreter) to add callables into interpreter.library namespaces.

C / C++ (native)

Compiled to a shared object; must export spl_register per the bundled native header. Used for performance or OS glue.

Java

.java libraries integrate via the host bridge (see lib/SPLHost.java).

Extensionless imports

Libraries can opt in (e.g. Python reqFileExtension = False) so use foo resolves a single file. If ambiguous, the interpreter asks for an explicit extension.