v3.1.0 #46
minirang
announced in
Announcements
v3.1.0
#46
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
Removed: closures / nested function values. The nested-function-as-closure feature added in the previous release has been reverted. Implementing capture the only way that didn't require rewriting
Environment's stack-allocated lifetime model — by value, once, at definition time — meant a closure over a scalar never accumulates state across separate calls (the textbook "counter closure" returning 1, 2, 3, ... on successive calls did not work; every call returned the same first value), while a closure over a list/map behaved as expected (shared by reference, like an ordinary argument). That asymmetry was judged too confusing for this language's intended audience to justify keeping a half-correct version of the feature.set funcinside another function's body is once again a hard error (NestedFunctionNotSupported,E4018), exactly as before closures were introduced.ValueType::Function/Closure(Value.h),Environment::collectCapturable(),callClosure/findClosure(Interpreter.h), and theset func NAME to EXPRclosure-typed-variable syntax are all gone. No other feature from the same release (pure-function hardening, thechange x to globalfix, reserved words as identifiers, the caret marker,DLC:filesystem, the DLC naming convention, or theloop matchremoval) is affected.Async: two real bugs fixed, two behaviors locked in with tests — no architectural change. Two error-hint messages quoted a keyword that doesn't exist in this language:
'set async function NAME(...) do:'and'set returnable function'both saidfunctionwhere the actual declaration keyword isfunc(throwAwaitOnNonAsync,throwReturnInVoidFunction). Fixed. Separately, two behaviors that were already correct but had no regression test now do: a queued task that itself queues another queued task (AqueuesBqueuesC) still drains in the order queued (tests/cases/async_self_queue_chain.cuff), and an error thrown by a queued task still stops the drain the same way an error mid-script stops synchronous execution — tasks queued after the failing one don't run (tests/errors/async_error_stops_queue.cuff). The cooperative, non-concurrent scheduling model itself (documented in the previous release) is unchanged.engine/interpreter/NativeFunctions.hsplit intoengine/dlc/. The single 1,748-line file holding every library's implementation is now one file per library —MathDLC.h,StringDLC.h,TimeDLC.h,RandomDLC.h,ListDLC.h,MapDLC.h,ConvertDLC.h,NetworkDLC.h,FilesystemDLC.h,JsonDLC.h— plusDLCCommon.hfor what several of them share (theexpectArgCount/expectNumber/expectStr/expectList/expectMapargument-checking helpers, and thetextutilUTF-8 namespace).NativeFunctions.his now ~100 lines: the always-on core builtins (print/input/type_of) andregisterDLC(), the dispatcher everyuse DLC:namecalls into. Every new file was verified to compile standalone (one#include+ an emptymain()each) rather than silently depending on include order. Pure reorganization — no declaration changed namespace, name, or behavior; full suite passes unchanged before and after.New:
tests/run.ps1. A PowerShell equivalent oftests/run.shfor running the suite on Windows without WSL or Git Bash — same section headers, same pass/fail summary line, same exit-code convention. Not executed against a real Windows/PowerShell environment during development (none available); reviewed by hand instead, same caveat as the platform notes in the previous release.Tests: 2 new cases (
async_self_queue_chain, and the error caseasync_error_stops_queue); 4 removed (closures,closure_pure_leak,closure_call_non_function,nested_async_not_supported— all specific to the now-reverted closure feature, including the one-offNestedAsyncFunctionNotSupportederror code, which reverts back to the originalNestedFunctionNotSupportedunder the same number,E4018). Net: 116 checks (previous release's 119, minus 5 closure-only checks — one of the four removed files had covered more than one assertion — plus 2 new async ones).Verification. Full suite rebuilt clean and passes (116/116) after both the revert and the file split; re-checked under AddressSanitizer + UBSan with the same clean result as the previous release (the one pre-existing, documented exception — intentional circular-structure tests triggering LeakSanitizer — is unchanged and unaffected by anything in this release).
use DLC:math/use DLC:string/use DLC:converttogether, in one script, was specifically re-tested on a report that it might not work — it does, both before and after this release's changes, so nothing needed fixing there.This discussion was created from the release v3.1.0.
All reactions