v0.2.8
Added 4
- The new @scriptc/threads package adds publish(value), which makes an object graph read-only so native executables share it by reference across workers, while Node.js uses its JavaScript implementation
- Deeply frozen plain data sent to workers is shared rather than cloned
- Recursive functions throw a catchable RangeError: Maximum call stack size exceeded on Linux and macOS, on the main thread, in workers, and inside async functions and generators
- Diagnostics explain what stopped a compile and where native behavior differs from Node.js
Changed 12
- A rejected declaration reports its own diagnostic instead of only a follow-on error
- Async functions and generators run on 512 KiB stacks
- Code is divided into partitions that are optimized and compiled in parallel, with small functions imported across partitions for inlining
- Rebuilds reuse the partitions an edit does not touch, so large executables rebuild incrementally and compile faster
- Nullable references are stored as plain pointers and release fast paths are inlined without cycle-color writes
- More parameters, receivers and locals are borrowed, and provably 32-bit integer fields and values use native integers
- Temporary arrays are avoided in generated native code
- Strings cache a proven-ASCII flag and read elements inline
- Number-keyed Maps and Sets index directly, and loops over arrays without holes read elements directly
- Exception checks run inline, and a single exception alert word is used
- A per-thread allocator and initial-exec thread-local storage reduce overhead for single-threaded code in worker programs
- Native program objects use runtime ABI v9, and external consumers must link the matching v0.2.8 runtime pack requirement raised · inferred, marked in the notes below
Fixed 7
- Out-of-range typed array reads produce undefined, matching Node.js
- Holes in for...of loops produce undefined, matching Node.js
- Object literals built from missing array elements produce undefined, matching Node.js
- Class fields read before assignment produce undefined, matching Node.js
- Optional values keep their state through callbacks, captures, pop() and initialization order
- Records and arrays reached through unions and empty object literals work as WeakMap and WeakSet keys
- Shared helpers no longer appear on user source lines, so a breakpoint on a line stops only at that line's code
1 change to check, marked in the notes below
From scriptc
0.2.8
Features
- Workers can share immutable object graphs without copying. The new
@scriptc/threadspackage addspublish(value), which makes a graph read-only so native executables hand the same objects to every worker by reference; Node.js runs its JavaScript implementation. Deeply frozen plain data sent to workers is also shared rather than cloned. - Deep recursion throws a catchable
RangeError. Recursive functions check the native stack on Linux and macOS and throwRangeError: Maximum call stack size exceededon the main thread, in workers, and inside async functions and generators, which now run on 512 KiB stacks. - Compile blockers and Node.js differences are easier to act on. Diagnostics explain what stopped a compile and where native behavior differs, and a rejected declaration now reports its own diagnostic instead of only a follow-on error.
Performance
- Large executables compile faster and rebuild incrementally. Code is divided into partitions that are optimized and compiled in parallel, with small functions imported across partitions for inlining, and rebuilds reuse the partitions an edit does not touch.
- Native code does less reference-count and allocation work. Nullable references are stored as plain pointers, release fast paths are inlined without cycle-color writes, more parameters, receivers and locals are borrowed, provably 32-bit integer fields and values use native integers, and temporary arrays are avoided.
- Strings, collections, loops and exceptions use more direct paths. Strings cache a proven-ASCII flag and read elements inline, number-keyed Maps and Sets index directly, loops over arrays without holes read elements directly, and exception checks run inline.
- Programs that create workers pay far less overhead. A per-thread allocator, initial-exec thread-local storage and a single exception alert word keep single-threaded code in worker programs close to its non-worker speed.
Fixes
- More values behave as in Node.js. Out-of-range typed array reads, holes in
for...ofloops, object literals built from missing array elements, and class fields read before assignment all produceundefined. Optional values keep their state through callbacks, captures,pop()and initialization order. - Weak collections accept more keys. Records and arrays reached through unions and empty object literals work as
WeakMapandWeakSetkeys. - Debuggers stop only at user code. Shared helpers no longer appear on user source lines, so a breakpoint on a line stops only at that line's code.
- Native program objects use runtime ABI v9. External object consumers must link the matching v0.2.8 runtime pack; the versioned marker rejects incompatible runtime objects at link time. requirement raised · inferred