v1.2.0 #25
minirang
announced in
Announcements
v1.2.0
#25
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
Performance: replaced the exception-based
return/stopcontrol-flow implementationwith an explicit
ExecOutcomevalue threaded throughexecStatement/execBlock/execIf/execLoop(engine/interpreter/Signals.h). C++ exceptions are reserved for genuineCuffErrorconditions again. Measured effect: afib(27)recursion benchmark (~635kfunction calls) went from 2.75s to 0.26s (~10.7x). This also fixed two real bugs the
exception-based version had:
stopused inside a function with no loop of its own used toleak through the function-call boundary and terminate whatever loop was active in the
caller; and
return/stopused at the top level (outside any function/loop) used tocrash the whole process with an uncaught exception. Both are now clean, catchable
CuffRuntimeErrors (StopOutsideLoop,ReturnOutsideFunction).Async: calling an
asyncfunction withoutawaitno longer runs it immediately —it's queued and runs once the entire top-level script's synchronous code has finished,
in the order it was queued (FIFO).
awaitis unchanged (still runs immediately andreturns the value). This is cooperative, single-threaded deferral — not real concurrency —
chosen for safety (the interpreter's shared state isn't thread-safe). See
docs/IMPLEMENTATION_NOTES.mdsection 1 andexamples/10_async_ordering.cuff.DLC libraries: added
DLC:list(sort,reverse,join,unique— allnon-mutating) and
DLC:convert(to_number,to_str,to_boolean).Fixed a parser bug uncovered while adding
DLC:list:use DLC:<name>/use <name> from ...only accepted anIDENTIFIERtoken for the name, so any name colliding with areserved word (like
list) failed to parse at all.ImportParsernow accepts anyword-shaped token (identifier or keyword) as a name.
Minor interpreter micro-optimizations:
Environmentpre-sizes its variable table for afunction call's known parameter count, and arguments are moved rather than copied into
parameter bindings.
Added
examples/10_async_ordering.cuffand expandedexamples/08_dlc_libraries.cufftocover the new libraries.
This discussion was created from the release v1.2.0.
All reactions