Files
zeekayandHanzo Dev b7e2b62a39 refactor(scriptvm): name the emitted runtime for what it does
The compiler emits its runtime helpers by name and the VM defines them by
name, so the two are one contract. It was renamed on one side only: all
three engines -- the Python VM, the TypeScript VM, and the JS emitter --
already said `__printScriptValue`, while every committed snapshot still
said `__printHogValue`. The snapshots had not been regenerated since.

That was not only cosmetic. `catch.script` and `catch2.script` call
`HogError(...)`, an STL name that became `ScriptError`, so both had been
failing; and `stl.stdout` recorded `__hogInterval__` for a marker the
engines stopped writing two renames ago.

So: drop the language's name from the helpers, since inside its own
runtime every value is a Script value and the infix distinguishes
nothing. Both sides move here, together, and the snapshots are
regenerated from the compiler rather than edited to agree.

Two names could not simply lose the infix, and the collision is the
interesting part:

  __toScriptDate/DateTime -> __newDate/__newDateTime, not __toDate,
  which already exists and is a different function -- the STL builtin
  that PARSES a foreign input, where these build a value from its parts.
  They join `__newError`, which was already named that way.

  ScriptError stays. Its remaining word is `Error`, also taken, and also
  a different function: `Error(message)` fixes the type, `ScriptError(
  type, message)` takes it.

Leaving the families orthogonal: `__new*` builds, `__to*` converts,
`__is*` tests, `__x__` marks, `__print*` renders.

Verified with the two engines this ABI spans, python-VM output against
compiled-JS output per test: 31 pass / 4 fail, against 29 / 6 on the
commit before this one. The two it fixes are catch and catch2. The four
that remain fail identically on both trees and are untouched by this.

`insightsqlx.js` is deliberately NOT regenerated and still spells the
old names: its source does not compile on either tree
(`BytecodeCompiler has no method visit_insights_qlxtag`), and editing a
snapshot by hand to agree with a rename is the exact failure this commit
exists to undo.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-13 20:04:08 -07:00

119 lines
1.4 KiB
Plaintext

-- empty, notEmpty, length, lower, upper, reverse --
3
TEST
null
rennips
-- encodeURLComponent, decodeURLComponent --
http%3A%2F%2Fwww.google.com
tom%20%26%20jerry
http://www.google.com
tom & jerry
-- tryDecodeURLComponent --
hello world
null
null
-- base64Encode, base64Decode --
aHR0cDovL3d3dy5nb29nbGUuY29t
dG9tICYgamVycnk=
http://www.google.com
tom & jerry
-- empty --
true
false
false
false
false
false
true
false
false
true
true
true
false
false
false
false
-- notEmpty --
false
true
true
true
true
true
false
true
true
false
false
false
true
true
true
true
-- replaceAll, replaceOne --
heLLo worLd
heLlo world
-- generateUUIDv4 --
36
-- isNull, isNotNull --
true false
false true
false true
false true
false true
false true
-- comparisons --
true false false
true false
true true
true true true
true false true true false true true true
false false false false false true true true true true
-- logic --
yes no
one
-- math --
3
15 5
3 4
[0, 1, 2, 3, 4]
[3, 4, 5]
-- string/array --
true false
true false
true bcd
bcdef
firstNonNull notNull
-- date --
2024 12
datetime
DateTime(1734480000.0, 'UTC') DateTime(1734307200.0, 'UTC')
202412
Date(2024, 12, 19) 5
DateTime(1734480000.0, 'UTC')
Date(2024, 12, 21)
{'__interval__': true, 'value': 5, 'unit': 'day'} {'__interval__': true, 'value': 2, 'unit': 'month'}
date
-- json --
123 null
123.1 null
"123.1" "hello"
null null
[] ["hello"]