RuleScript v1.5.0
RuleScript v1.5.0
RuleScript v1.5.0 adds script-level parallel execution, cooperative parallel debugging, and recursive user functions.
Parallel Execution
Parallel execution uses four keywords: parallel, task, endtask, and endparallel. Both dedicated endings and the generic end are accepted.
values = parallel:
task:
return LoadA();
endtask
task:
return LoadB();
endtask
endparallel;
parallel waits for every task. Expression results preserve declaration order, and a task without return contributes null. Task-local variables and function stacks are isolated; the host RuntimeContext is shared and synchronized. Concurrent reads and writes are safe, but compound operations such as read-modify-write are not atomic.
Host Integration and Safety
Host functions are denied inside tasks unless registered as thread-safe. Use the threadSafe: true registration overload or decorate a public instance method with [RuleScriptFunction(ThreadSafe = true)] and call RegisterFunctions(host).
RuleScriptEngine.Stop(), execution timeout, loop limits, statement limits, and call-depth limits cooperatively cancel or constrain parallel work. A task failure cancels sibling tasks and is reported with its declaration index. Static analysis also detects indirect calls to host functions from parallel tasks.
Debugging and User Functions
- A breakpoint or step pause establishes a shared barrier so all parallel tasks pause cooperatively.
- Continue, Step Over, and Stop release every task waiting at the shared pause barrier.
- Long-running host functions join a pause after returning to the next cooperative boundary.
- Recursive user functions can complete within
MaxCallDepth; infinite recursion remains constrained whenCallDepthLimitEnabledis enabled.
This release does not add async, await, locks, channels, actors, task handles, or fire-and-forget execution to the language.
Validation
- Release build: 0 warnings and 0 errors.
- Test suite: 534 passed, 0 failed, 0 skipped.
- NuGet package version:
1.5.0.