The curry Package
The installed public stub
records the public names and their signatures. Using the API describes
the builders, value classes and session operations.
The top-level names, including curry.eval and curry.import_, are
methods of a global interpreter created at import.
Interpreter(flags={...}) from curry.interpreter starts another
session. Its initial flags follow the same order: defaults,
SPRITE_ROTATION, SPRITE_INTERPRETER_FLAGS, then the argument.
Fork the process only while Sprite has no evaluation, compilation, queued or
running JIT work or native handle operation in any thread; an idle child starts fresh
workers and synchronization state without cleaning up the parent’s resources.
A child forked while Sprite is busy raises curry.exceptions.ForkError before
checking thread reentrancy on later Sprite calls and when a callback returns
into the interrupted evaluation;
if that callback runs on the large-stack worker, the child attempts a bounded
report to standard error and exits with status 1.
Python primitive callbacks may evaluate Curry terms, while a signal or logging
handler that enters Sprite while its thread holds a Sprite lock or waits for
the evaluation worker raises curry.ReentrancyError.
Sprite emits diagnostics collected under its locks after releasing those locks.
Interpreter flags
curry.flags is a read-only mapping of the current session’s flags.
The environment variable SPRITE_INTERPRETER_FLAGS sets the initial
flags of a process (interpret:off,rotation:steps:65536). Use
curry.reset(**flags) to start a new session with other flags. Reset retains curry.path and makes earlier
terms stale. curry.reload(module, text=...) replaces a module’s code;
it does not set interpreter flags. The docstring of curry.interpreter.flags
(help(curry.interpreter.flags)) describes every flag at length; the table names them with their defaults.
Flag |
Default |
What it changes |
|---|---|---|
|
|
The runtime selector; only |
|
|
|
|
|
Interpreted functions compile at load ( |
|
|
|
|
|
Search order: |
|
|
How the runtime paces the rotation of its queue of alternatives: time mode ( |
|
|
Bytes of C stack one evaluation may use on the calling thread; |
|
|
The retained worker’s stack reservation in bytes; |
|
|
The largest function body, in nodes built, that the optimizer inlines at a call; a call of a single-case function on a constructor becomes the branch. |
|
|
The checker mode of the Fair Scheme proofs program: the runtime asserts the run-time invariants of the Fair Scheme at every fork, escape, pull-tab, instantiation and yield. |
|
|
More consistency checks; the runtime compiles its modules in the debug flavor. |
|
|
Reserved; runtime traces require a |
|
|
Keep the temporary files; a string names the directory for them. |
|
|
Copy the generated code of a failed compile from a string to the working directory. |
recursion_limit, step_budget, lazycompile and
telemetry_interval are accepted and have no effect.
curry.path includes CURRYPATH, local CPM sources and the installed
library. See Curry packages for discovery and curry.cpm_path.