You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
0.2.10
Features
Contract types check extra promises at compile time. The new types-only @scriptc/types package adds NoThrow<T>, Int32, Immutable<T>, Acyclic and ProgramLifetime. They mean nothing to TypeScript or Node.js, but scriptc proves each one or fails the build with a diagnostic that names the throwing path, the non-int32 store, the write that breaks immutability or the reference cycle. Proven Int32 slots are stored as native integers, immutable module constants take no reference counts, and program-lifetime classes skip reference counting and cycle collection. Outside worker programs, a surrounding try/catch discharges NoThrow.
Performance
Construction and narrowed reads do less work. Private constructor stores drop publication guards, construction-only fields are borrowed, string-keyed Map reads retain inline, and narrowed member reads are rechecked only when a call can invalidate them.
Indexed reads and integer code are cheaper.charCodeAt at proven integer indices skips the double round trip, literal switch statements dispatch without range tests, indexed-read helpers are inlined, identity bitwise forms over proven int32 operands return the operand, and array counters use signed conversions.
Allocation is faster and smaller. Small arrays are sized exactly, map storage stays on the runtime allocator, array element reference-count entry points live in one shared descriptor per element type, glibc's large blocks use transparent huge pages, and Linux pre-faults allocator memory on a helper thread.
Runtime throw paths stay out of line, so hot code around checks that rarely fail stays smaller.
Fixes
Published object graphs stay immutable in more cases. A constructor that stores this into its own field keeps its publication guards, and calls that may replace a field keep their own reference to arguments read from it.
Native program objects use runtime ABI v13. Array headers changed, so external object consumers must link the matching v0.2.10 runtime pack; the versioned marker rejects incompatible runtime objects at link time.