partway towards commands
I got very confused and started mucking about with "spawn" when in fact all I needed was the "inline" extension type in orcx that allows the interpreter to expose custom constants.
This commit is contained in:
21
notes/commands.md
Normal file
21
notes/commands.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Foreword
|
||||
|
||||
Commands exist to allow programs to choose a course of action rather than merely respond to external queries with data. In a sense, commands are data that describes the totality of what a program will do.
|
||||
|
||||
Commands are not equivalent to the instructions of an imperative programming language. If that were the case, they would describe a transition from a previous state to a new state in which additional instructions may be attempted, but commands do not have an "outcome". To the extent that they allow the continuation to be selected, they must encode that within themselves.
|
||||
|
||||
## Are commands unique
|
||||
|
||||
Yes. Since they own the entire program, and since all expressions are younger than all their subexpressions, they cannot be exactly identical to any other subexpression.
|
||||
|
||||
## Are commands exclusive
|
||||
|
||||
Not really. What control flow primitives exist between commands is up to the environment / interpreter. It may make sense to introduce a "parallel" primitive depending on the nature of the commands. In the abstract, we cannot talk about "the current command".
|
||||
|
||||
# Extensions
|
||||
|
||||
The orchid embedder and extension API mean something different by command than any particular programmer or embedder does, and something different still from what Orcx and systems programmers do. The Orchid extension API should not assume any capability that may make an embedder's job unduly difficult.
|
||||
|
||||
## Continuation
|
||||
|
||||
Since commands are expected to be composed into arbitrarily deep TC structures,to avoid a memory leak, commands should not remain passively present in the system; they must be able to express certain outcomes as plain data and return. The most obvious of such outcomes is the single continuation wherein a subexpression evaluating to another command from the same set will eventually run, but other ones may potentially exist. Are there any that cannot be emulated by continuing with a call to an environment constant which expresses the outcome in terms of its parameters?
|
||||
Reference in New Issue
Block a user