Repository navigation
v6.4.0 #89
minirang
announced in
Announcements
v6.4.0
#89
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
args(),exit(),assert()andprint_error(). Four built-ins for a script run from a command line, available withoutuse:args()is the list of arguments the program was given (cuffc tool.cuff a bgives["a", "b"]),exit(status)ends the program at once with a status from 0 to 255,assert(condition, message)raisesE7-002when the condition is false, andprint_error(...)writes whatprintwould to standard error. A program that declares a function of one of these names keeps its own, as before. See arguments, exit and assert.E7-002, anassertwhose condition was false.or_elsecatches it, as it catchesfail.cuffc script.cuff a brefused a second argument ("only one script file may be given", status 2); every argument after the script is now the script's own, even one that looks like an option, andcuffc's own options come before the script.cuffsh file.cuff a bdoes the same for its startup file. A command line that worked before works the same.exit()reaches the host.Engine::OutcomehasexitedandexitStatus: a run or a call that ended inexit()is a success with no report, and the engine can run again.EngineOptions::argumentsis whatargs()gives.cuffcends with the status,cuffshleaves with it (at the prompt, in its startup file or in a file run with:load), and the WebAssembly binding returns{ success, error, exited, exitStatus }. Noor_elsestopsexit(), and tasks still waiting do not finish.find,find_all,count,split,replaceandreplace_allon a short line: 2.4 times fewer instructions. 5,000 generated patterns and texts give the same results, flags and errors included, as 6.3.0.lengthtwice a pass runs 25% fewer instructions, andstr_upperin a loop 23% (with an ASCII text changed in place in a copy).loop eachand JSON. Astrthat is used as a map key remembers its hash, so a map read again and again with the same key hashes it once (1,000 keys read 100 times: 35% fewer instructions);loop eachtakes each item out of its snapshot directly (28%);from_jsonandto_jsoncopy runs of plain characters at once and read whole numbers of up to 15 digits directly.RangeError. A repeated group in a pattern ((a)+over about 185 characters under Node 22), an object'sto_strthat shows another object, and a field's default value that makes an object of its own class nested deeper than the JavaScript engine's stack allows, andcuffRunthrew. The WebAssembly build now counts: a pattern attempt may nest 240 deep and the machine may run inside itself 100 times, and then it raisesE3-103andE4-017, as a native build does. A native build is unchanged.(,[,{,"or'puts the closing one after the cursor; typing the closing one in front of it steps over it; a selection is put between the pair; Backspace between an empty pair removes both; Enter between brackets puts the closing one on a line of its own. Inside a string or anote:comment, and in front of a word, one character is typed as before. The IDE colours the four new built-ins, and itsRUNandBYTECODEcommands pass the words after the file to the script'sargs()(after--, even ones that start with-).CUFFSH_TEST_HANGseconds (300 by default, times the wait scale) stops and prints the line it was on, and the workflow's test step has its own 25-minute limit. The shell itself did not change.wasm/README.mdsaid the binding exposes two calls; it has three.cuffcis 16 KB smaller than in 6.3.0 (1,225,248 to 1,208,872 bytes), with the four built-ins in it: a library function that keeps no state is now held as a plain function pointer instead of astd::function, which took code of its own for each of some 300 functions (21 KB of code less). The build without all fourteen libraries that can be left out is 4 KB larger (868,896 to 873,000 bytes): the four built-ins are in every build, and it has few library functions to gain from the pointers.control/assert_and_args,control/exit_ends_programandcontrol/exit_in_task, eight error cases for the new built-ins, twocuffccommand-line cases (arguments after the script andexit(), arguments after-) intests/run.shandtests/run.ps1in place of the one for two scripts (the shell's PowerShell suite likewise, forcuffsh), and 10 checks ofexit()andargs()throughEngineinembedding_test.cuffc(usage, arguments, exit status) andcuffsh, Embedding and the C++ API (exited,exitStatus,arguments), the WebAssembly and npm READMEs, the cookbook (a command-line script), the limits (two internal ones), the known limitations (WebAssembly) and design note 83.EXCLUDED_DLCmode (246 passed, 116 left out);tests/run.ps1passes under PowerShell; the shell suites pass (71, 40 and 60 fuzzed sessions, and the PowerShell native checks); the engine,cuffc,cuffsh, the unit tests and the embedding example compile as C++20 and C++23 with GCC, Clang and libc++; the documentation check passes. 1,500 generated programs give the same output as on 6.3.0 and 500 the same on the sanitizer build; 3,000 mutated programs on the sanitizer build drew no report; 5,000 generated patterns and texts match 6.3.0. Elsewhere:cuffc.exeandcuffsh.exebuild with MinGW-w64 and-Werrorand the unit tests compile there; on s390x (big-endian, QEMU) the suite passes in full; static Android builds (NDK r27c, API level 29) pass on arm64-v8a 360 of 362 and on armeabi-v7a 361 of 362 under QEMU (the emulator lacks time zone data, and QEMU does not enforce the stack limit); WebAssembly (Emscripten 3.1.6, Node 22) passes every test the binding can run (340, with the 2 that need command-line options skipped), the three that ended in JavaScript's stack limit included. The IDE was driven with simulated keys under Xvfb (24 cases of brackets and quotes, and arguments forRUN). Not checked: a run on Windows, macOS itself, an Android device, real hardware, and the CI workflows themselves.This discussion was created from the release v6.4.0.
All reactions