Skip to content

Release history

Ant releases

All releases

32 shown

Review required
v0.12.0.1780342116 Breaking risk
Auth RCE / SSRF Breaking upgrade

Sandbox runtime + Release API

No immediate action
v0.11.1.1778652979 New feature

`--inspect` + faster regex

v0.11.0.1778361484 Breaking risk
Notable features
  • Added WebSocket API support
  • Added EventSource (Server‑Sent Events) API
  • Introduced ant:rpc module with example server and client
Full changelog

Ant 0.11.0

A major compatibility release focused on modern JavaScript behavior, richer networking APIs, stronger Node support, and a runtime that feels much more complete in real-world app code.

Highlights

ES6 & Proxy correctness

  • Private class brands now behave properly
  • Proxy, Reflect, own-key ordering, and Object.assign got a broad correctness pass
  • Classes, typed arrays, parser edge cases, and with () {} behavior all moved closer to spec

Networking APIs

  • Added WebSocket
  • Added EventSource
  • Added a ant:rpc module

Node/npm compatibility

  • Better compatibility for real packages, including the Discord example
  • Improved node:http/https behavior and CommonJS export handling
  • Better socket, TLS, and connect-failure behavior

Memory & runtime cleanup

  • Lower allocation pressure and less transient buffer churn
  • Better GC marking across more native-backed modules
  • Safer native object layout and pointer handling

Performance

  • Faster string building
  • Better JIT behavior for numeric loops and bailout snapshots
  • More benchmark coverage to track regressions and wins

Developer experience

  • console.inspect for strings
  • Broader spec and regression coverage across the runtime

Compatibility Scoreboard

| Area | Status |
| --------------------- | -------------------------------------------------------------------------------- |
| compat-table | 1511 / 1511 passing |
| test262 | ~64% passing |
| Big wins this release | Proxies, Reflect, private brands, WebSocket, EventSource, Node/npm compatibility |

Try It Now

Language compatibility
  • Added proper brand-based private class support
  • Added Array.isTemplateObject
  • Fixed class-method enumerability behavior
  • Enabled implicit strict mode for classes
  • Fixed typed-array and parser ES6 compatibility cases
  • Improved proxy behavior across a broad fixing pass
  • Improved Reflect behavior
  • Fixed own-key ordering regressions
  • Cleaned up Object.assign behavior
  • Added a better IsArray check for userland-facing paths
  • Fixed js_to_primitive exotic-helper behavior
  • Added more with () {} correctness fixes
  • Fixed thrown set-trap behavior
  • Emitted proper URLSearchParams array lengths
  • Fixed constructor-wrapper target-depth lookup
  • Fixed static-child this behavior
  • Fixed CommonJS export namespace behavior
Strings, functions, symbols, and object semantics
  • Improved ES6 function name support
  • Improved handling of explicit function length
  • Improved object primitive handling
  • Improved symbol primitive behavior
  • Improved Annex B string compatibility
  • Added more Annex B follow-up fixes
  • Improved string tags for newer builtins
  • Improved string_builder_t performance
  • Added console.inspect support for strings
  • Updated string specs and template-string coverage
  • Fixed a small .splice edge case
  • Improved flatMap performance
  • Fixed JSON and object behavior in more ES6-leaning cases
Networking, Web APIs, and real app support
  • Added EventSource
  • Added WebSocket
  • Added a basic ant:rpc module
  • Added spec coverage for EventSource and WebSocket
  • Added RPC examples
  • Added Node compatibility needed for the Discord npm example
  • Added a Discord example app
  • Improved node:http/https compatibility for more userland packages
  • Replaced the older tls.mjs path with a tls.c stub implementation
  • Improved TLS handle draining
  • Emitted synchronous connect failures on a microtask
  • Allowed better cleanup when listeners are aborted
  • Fixed stdin lockups
  • Fixed connection cleanup in net
  • Added better protocol, upgrade, TLS, and socket coverage in tests
Memory, GC, native layout, and runtime stability
  • Reduced allocation pressure in hot paths
  • Reduced transient buffer usage
  • Added a temporary parse arena with rewinding for short-lived parse work
  • Added finalizers for Request and Response
  • Added GC marking for crypto, events, LMDB, TLS, N-API, generators, and sockets
  • Improved native object layout by moving away from ANT_PTR
  • Stopped storing pointers in SLOT_DATA
  • Unified the native tag API
  • Removed redundant pointer-type checks in native paths
  • Reduced sv_func memory significantly with a sidecar layout
  • Added a hot path for both sidecar layouts
  • Reduced object size in some hot allocation paths
  • Fixed a MIR leak during bailout/unload paths
  • Fixed miscellaneous memory leaks
  • Improved stream allocation shapes
  • Optimized padding and memory layout for internals
Buffers, streams, TLS, and runtime polish
  • Fixed buffer offset safety issues
  • Fixed Buffer#indexOf range handling
  • Fixed UTF-8 buffer handling edge cases
  • Improved stream allocation behavior
  • Added more readable/writable state predicate coverage
  • Improved timers, event listeners, and stream lifecycle behavior
  • Updated event listener globals and related compatibility paths
  • Enabled WASM SIMD
Performance, JIT, and measurement
  • Optimized JIT numeric local loops
  • Hardened JIT bailout snapshots
  • Added a broad runtime/perf pass on the proxy-es6 branch
  • Improved performance in several proxy and object-model hot paths
  • Improved T_CFUNC promotion fallback behavior
  • Added deeper microbench coverage
  • Added more advanced Fibonacci benchmarks

To install Ant v0.11.0:

curl -fsSL https://ant.themackabu.com/install | bash
v0.10.2.1777541521 New feature
Notable features
  • Consistent handling of XDG paths
Full changelog

Patch Notes

Ant v0.10.2 is a tiny patch release focused on user directory behavior.

  • Ant now respects XDG paths more consistently.
  • Ant also keeps working with the legacy $HOME/.ant layout, so existing setups do not break.

To install Ant v0.10.2:

curl -fsSL https://ant.themackabu.com/install | bash
v0.10.0.1777368030 Breaking risk
Breaking changes
  • Removal of Ant binaries for version 0.10.0 due to a critical bug in number parsing.
Full changelog

[!CAUTION]
Ant binaries for 0.10.0 have been removed due to a critical bug in number parsing

Release Notes

Release v0.10.0 is a broad step forward for the language surface, Node compatibility, async/generator semantics, crash reporting, FFI, runtime performance, and developer tooling.

Language & ECMAScript Features

  • Added support for yield and generator functions
  • Added spec-shaped async generator prototype chains
  • Implemented explicit resource management support
  • Added parser, compiler, and runtime support for using, await using, and throw expressions
  • Added disposal symbols, SuppressedError, DisposableStack, and AsyncDisposableStack
  • Wired disposal cleanup through blocks, returns, breaks, continues, for...of, and async disposal paths
  • Added async-iterator helper plumbing needed by the new resource-management flow
  • Implemented Set.prototype.union
  • Implemented Set.prototype.intersection
  • Implemented Set.prototype.difference
  • Implemented Set.prototype.symmetricDifference
  • Implemented Set.prototype.isSubsetOf
  • Implemented Set.prototype.isSupersetOf
  • Implemented Set.prototype.isDisjointFrom
  • Added Map / WeakMap upsert support
  • Added BigInt64Array
  • Added Uint8Array base64 helpers
  • Added Uint8Array hex helpers
  • Added regexp index-group support
  • Fixed ES2019 symbol descriptions and function source-string behavior

Async, Generators & Coroutine Semantics

  • Stabilized async coroutines across more reentrant and callback-heavy cases
  • Fixed async generator await / yield interactions
  • Fixed async-generator overlap semantics
  • Fixed reentrant async-generator next() behavior
  • Added focused async-iterator and async-materialization coverage
  • Compiled async iteration correctly alongside TLA
  • Redesigned lazy-start and materialization cases
  • Switched coroutine tracking to a linked-list model
  • Only destroy coro->vm when the coroutine is actually reaped
  • Added promise assimilation helpers
  • Cleaned up dead code in promise paths
  • Used the active VM/coroutine more consistently for tracing and async work
  • Improved promise-job resume and dead-await/TLA fast-path coverage

Node Compatibility & Builtin Coverage

  • Expanded compatibility across builtins and npm packages
  • Added Object.getOwnPropertyDescriptors
  • Treated native C functions as objects for Object-prototype operations
  • Preserved display names for builtin module namespaces
  • Used node: aliases in missing named export errors
  • Attached module-context metadata to cached builtin namespaces
  • Registered FS constants as the constants module
  • Added fs.chmod / fs.chmodSync support for numeric and octal-string modes
  • Added fs.readlink / fs.readlinkSync
  • Exported more FS open/stat mode constants
  • Added fs.realpath.native callback compatibility
  • Added registered path/posix and path/win32 variants
  • Added buffer constants including kMaxLength, kStringMaxLength, and INSPECT_MAX_BYTES
  • Added util.callbackify
  • Added util.aborted for AbortSignal-driven promises
  • Added process.listeners
  • Added process.emitWarning formatting and warning-event payload support
  • Added stream default high water mark getters/setters
  • Improved fs/promises FileHandle compatibility
  • Improved util.promisify behavior
  • Improved EventEmitter.listeners()
  • Improved console instance routing and trace sink behavior
  • Added SubtleCrypto.digest
  • Exposed node:url.parse
  • Improved node:net client shim coverage
  • Wired CommonJS exports onto Object.prototype semantics more cleanly
  • Made EventEmitter inherit from the expected function/object shape

Runtime, Compiler & JIT

Under the hood, Ant changed a lot:

  • Reduced compile time by removing a fast-path bypass
  • Reworked Silver string building around a builder-backed path instead of deep rope-heavy append chains
  • Taught the VM, compiler, JIT glue, and GC to preserve and flush builder-backed strings
  • Rewrote the string pool for performance
  • Threaded more string operations through the JIT
  • Added broader OP_SPECIAL(1..3) JIT support for super, this, and import metadata
  • Fixed a JIT method-call stack-growth regression
  • Improved regex compile speed
  • Added regexp abstract exec work
  • Migrated Array.prototype.includes into a dedicated opcode
  • Optimized the dense-array includes fast path
  • Improved dense and overall array indexing performance
  • Fixed ES2016 conformance regressions introduced along the way
  • Undid an arguments-lowering change that regressed behavior
  • Added safer entry frame-pointer handling in the engine
  • Avoided VM stack relocation pitfalls in destructuring iterator helpers
  • Removed unused T_CLOSURE
  • Allowed promotion from T_CFUNC to metadata-backed objects
  • Stored native functions exactly during assignment
  • Allowed constructed C-function prototypes during promotion
  • Fixed super lookup for extracted static methods and constructors
  • Moved array/object prototype references under the symbol struct

Memory Management & Correctness

  • Added write barriers for slots inside pipes, writable streams, and readable streams
  • Adjusted GC thresholds as part of broader promise/runtime tuning
  • Updated RSS reporting to reflect truer usage
  • Fixed iterable WeakMap regressions
  • Added a proper ERRNO path for FS modules
  • Fixed N-API exception handling
  • Prevented row/column assignment bugs in process/TTY paths
  • Shared enumerable-property iteration between spread and assign
  • Centralized proxy enumeration in smaller runtime fixes
  • Added inspect support for Headers, Request, and Response
  • Allowed generator/map support for object keys in Object.fromEntries-style paths

Streams, Fetch, URL & Server

  • Migrated process.stdout and process.stdin to ReadableStream-based plumbing
  • Aligned stdio encoding behavior and fixed TTY teardown on exit
  • Improved stream lifecycle behavior around flowing startup and transform callbacks
  • Rejected invalid readable-stream chunks more consistently
  • Handled broader stream chunks in reporting paths and cancelled abandoned bodies
  • Added fetch redirect support
  • Added proper URL parsing for hashable paths
  • Added a fast URL parsing path
  • Added proper idle/request timeouts in the server
  • Fixed a server string-buffer oversight
  • Prevented tlsuv from closing a request before completion

FFI, WASM, Intl & Platform Work

  • Rewrote the entire FFI module
  • Cleaned up related reflect/internal_prop behavior around the FFI rewrite
  • Removed unused T_FFI
  • Added new FFI wrapper coverage and refreshed the SQLite example
  • Migrated Intl into a dedicated module
  • Added a Lua example
  • Added WASM table fixtures
  • Allowed faster WASM paths
  • Handled WASM exit messages more cleanly
  • Prevented WASM from throwing stack-related failures in specific paths
  • Prevented WASI from starting unless running as a reactor
  • Removed a duplicate WAMR check
  • Improved the WASM demo and demo script
  • Switched to a patched MIR (http://github.com/themackabu/mir)
  • Bumped Windows stack limits
  • Used pthread_get_stacksize_np correctly
  • Added arena/mmap hints and Linux-specific arena tuning

Crash Handling & js.report

  • Added a native crash handler
  • Added Windows crash-handler support
  • Added upload-based crash reporting
  • Improved crash error-print formatting
  • Improved crash-message summaries

Install

curl -fsSL https://ant.themackabu.com/install | bash
v0.10.1.1777537212 Bug fix
Notable features
  • Added completion-value support to REPL and `eval` for more intuitive interactive results
  • Allowed multi-line REPL history
  • Added the generator string tag
Full changelog

Release Notes

Ant v0.10.1 is a focused polish release that makes Ant feel more predictable in everyday use. The biggest improvements land in number parsing, REPL behavior, HTTP compatibility, and a handful of small but important correctness fixes.

Number Parsing & Numeric Correctness

Number handling is more accurate and more consistent in this release:

  • Improved decimal parsing and formatting accuracy
  • Fixed rounding and precision edge cases in JavaScript number conversion
  • Made Number() and parseFloat() behavior more consistent
  • Tightened handling of malformed numeric literals, including bad exponent forms
  • Rejected invalid numeric literals that run directly into identifier characters

REPL, Eval & Completion Values

Interactive use is smoother and more intuitive:

  • Added completion-value support to REPL and eval, so interactive results behave more like users expect
  • Allowed multi-line REPL history
  • Fixed eval cases that could incorrectly return undefined

Language & Parser Fixes

This release also includes a few visible language-level fixes:

  • Added the generator string tag
  • Invalid dot-property syntax now throws a proper error instead of being accepted ambiguously

Node HTTP, Networking & Examples

HTTP-driven app code should work a little more smoothly:

  • Improved the node:http compatibility shim
  • Added an h3 demo project
  • Improved socket closing behavior

Runtime, Compiler & JIT Fixes

The remaining changes are small but useful stability fixes:

  • Fixed an x86 JIT stack-guard ABI mismatch
  • Fixed internal eval/codegen paths that could lose completion values

To install Ant v0.10.1:

curl -fsSL https://ant.themackabu.com/install | bash
v0.9.0.1775718146 Breaking risk
Notable features
  • Added comprehensive Web Platform API surface: DOMException, AbortController, EventTarget, Headers, Blob, FormData, Request, Response, URL, Promise.allSettled, regex v‑flag, matchAll, Float16Array, TypedArray.from.
  • Implemented full streaming support with ReadableStream, WritableStream, TransformStream, queue handling, blob streaming and compression/decompression (including Brotli).
  • Revamped fetch API to include buffer‑backed bodies, chunked uploads, improved error handling and Node HTTP compatibility helpers; introduced new server.c with fresh parser/listener/connection plumbing.
Full changelog

Release Notes

Web Platform, WinterTC & Core Runtime Surface

Ant’s WinterTC API surface grew substantially in this cycle:

  • Added DOMException
  • Added AbortController and AbortSignal support as first-class runtime pieces
  • Added WinterTC global scaffolding and related globals wiring
  • Brought EventTarget much closer to compliance and separated global-vs-emitter event type handling
  • Added Headers
  • Added Blob
  • Added FormData
  • Added Request
  • Added Response
  • Added BOM stripping in response handling
  • Brought URL closer to spec
  • Fixed URL sorting/index-walk edge cases
  • Added Promise.allSettled
  • Added regex v flag support
  • Added matchAll
  • Added Float16Array
  • Added TypedArray.from
  • Improved JSON behavior, including UTF-8 parsing and several response/request integration paths
  • Improved structured clone behavior, including DataView cloning
  • Added more reliable brand helpers and branding checks across web-facing objects
  • Marked Date brand information more reliably in slots

Streams, Pipes, Encoding & Compression

Streaming support moved from partial support into a much more complete platform layer:

  • Rewrote the iterator system and added iterator hooks that several web APIs now rely on
  • Added ByteLengthQueuingStrategy
  • Added CountQueuingStrategy
  • Added ReadableStream
  • Added WritableStream
  • Added TransformStream
  • Added queue handling for streams
  • Added blob streaming
  • Added stream codec support
  • Added compression/decompression streams
  • Added Brotli to compression and decompression paths
  • Revised text encoding and decoding to be closer to spec
  • Migrated the old node:stream stub to a proper module and wired in FS stream hooks
  • Revised FS stream behavior after the stream-module work landed

Fetch, HTTP, Server & Networking

The server and HTTP stack changed dramatically:

  • Added shared http.c helper plumbing
  • Revised the fetch API surface
  • Added buffer-backed fetch bodies
  • Added chunked upload support in fetch
  • Improved fetch error handling
  • Added appendHeader support in the Node HTTP compatibility layer
  • Added internal HTTP parser/writer helpers and exposed ant:internal helpers for HTTP work
  • Landed a brand new server.c with fresh parser/writer, listener, and connection plumbing
  • Added node:http
  • Added node:http2
  • Added node:https
  • Added node:tls
  • Added node:net
  • Added node:zlib
  • Improved compatibility for modern SSR/RSC-style workloads, especially around fetch, async iterables, promises, collections, abort handling, path handling, builtin lookup, and server behavior

Node Compatibility & Utility Modules

The Node-facing compatibility layer broadened:

  • Added node:assert
  • Added node:v8
  • Added node:diagnostics_channel
  • Added node:querystring
  • Added string_decoder
  • Added util.deprecate
  • Added util.debuglog
  • Added a V8/Node-style error shim
  • Added missing prototypes in worker_threads
  • Improved CommonJS namespace/default interop
  • Fixed exports defined as accessors in CommonJS
  • Fixed CommonJS namespace population so accessors do not invoke getters unexpectedly
  • Switched missing named exports from an undefined placeholder to an explicit error
  • Prevented nested export graphs from erroring incorrectly
  • Added a loader path for circular dependencies
  • Added canonical module handling
  • Rewrote readline to use a proper EventEmitter
  • Added async readline support
  • Preserved readline flags more carefully
  • Continued cleaning up the readline module after the rewrite

Module Loader, Import Semantics & Resolution

Import and resolution behavior saw a lot of work:

  • Allowed dynamic TLA
  • Centralized module import context for import.meta and dynamic import
  • Simplified module context handling through the module_ctx backlink
  • Added lexical bindings for subdirectory import metadata
  • Started preferring reads from node_modules first for executable/package resolution paths
  • Fixed crashes and bad states when trying to fetch CommonJS defaults
  • Improved builtin bundle handling as more Node compatibility modules were added

Async Engine, Event Loop & Promise Behavior

The async side of the runtime got one of the deepest internal rewrites in the release:

  • Rewrote the async engine
  • Added support for custom thenables
  • Fixed microtask ordering coverage with new tests
  • Improved event loop throughput substantially after eliminating a stack scan
  • Fixed several promise/coroutine/GC interactions during async resolution
  • Deferred active async coroutine unlinking so GC can still see VM state during promise resolution
  • Marked awaited coroutines during GC through the promise handler path
  • Reworked timer/process/io integration around the new async behavior
  • Improved async compatibility for server workloads, streams, and SSR/RSC-style flows

VM, Compiler, JIT & Object Model

A huge amount of work landed below the public API layer:

  • Fixed a crash involving upvalues
  • Optimized garbage collection during JIT execution
  • Re-enabled GC during JIT in phases
  • Added dynamic buffer handling for string replacements while tuning JIT+GC behavior
  • Refactored VM call handling around clearer call modes and execution plans
  • Added support for explicit this binding mode in call handling
  • Improved closure and cfunc resolution logic in the VM
  • Enabled JIT in regex paths
  • Moved iteration to new opcodes
  • Added an iteration fast path
  • Added faster string-shape slot lookup
  • Added a direct own-shape fast path for with() on ordinary objects
  • Improved hot property access fast paths
  • Fixed optional chaining behavior
  • Passed through active strict context more reliably
  • Fixed arrow-parameter handling around void token lists
  • Cleaned up proto-constructor handling
  • Added Ant.match
  • Added Ant.highlight
  • Cleaned up unused internal slots and removed dead headers

Closures, Upvalues, Shapes & Object Semantics

Many smaller commits in this range were correctness and hot-path-oriented:

  • Ensured upvalues stay in VM stack range before being dropped
  • Added slot-in-VM-range upvalue capture
  • Prevented arg closure buffers from being dropped during deopt
  • Made local capture lighter
  • Made JIT capture lazier
  • Classified child closure kinds more precisely
  • Dried up JIT fallback paths
  • Prevented segmentation faults when assigning to T_CFUNC
  • Re-synced cached pointers in sv_frame
  • Trimmed slot_buf usage in JIT paths
  • Pinned object and array literals to primordial prototypes
  • Prevented prototype enumeration leaks
  • Improved object enumeration handling for exotic objects
  • Walked the prototype chain in for...in for more spec-compliant behavior
  • Refactored Object.assign through a clearer enumerable-property helper
  • Updated collections to use canonical values

Memory Management, GC & Safety Fixes

This release includes a dense run of GC and safety work:

  • Fixed crashes on cstack paths
  • Made N-API interaction safer under GC
  • Prevented N-API stripping on Darwin builds
  • Migrated buffers to a finalizer-based lifetime system
  • Revised buffer semantics and root collection
  • Fixed a WeakMap mark-phase use-after-free
  • Prevented OOM during JSON parsing by tightening temp-root handling
  • Fixed a compile-time string table slowdown
  • Reduced one string scan from O(n^2) to O(n) with caching
  • Prevented unnecessary string allocation during initialization
  • Prevented a calloc crash
  • Ensured shapes never receive a bare T_ERR
  • Improved symbol usage and followed up with more symbol cleanup
  • Rooted important prototypes during stream/queue work

WebAssembly, WASI & Platform Coverage

WASM and platform portability has been added:

  • Added WebAssembly support
  • Added WASI support
  • Added a WebAssembly demo and example assets

Crypto, TLS, Dependencies & Build System

  • Killed MbedTLS and started the move to BoringSSL
  • Updated TLSUV for the BoringSSL backend
  • Added Brotli as a vendored dependency
  • Migrated away from libuuid
  • Migrated away from libsodium

Validation, Specs, Benchmarks & Regressions

A lot of the range is also validation work, which is useful to call out in a changelog this size:

  • Added or expanded spec coverage for assert, blob, buffer, diagnostics_channel, events, fetch, formdata, headers, match, readline, request, response, streams, text codecs, url, v8, and zlib
  • Added import, import.meta, and nested-directory regression coverage
  • Added WebAssembly API tests
  • Added stream abort capture coverage
  • Added multiple Vite watcher repros
  • Added SSR/RSC-style regressions around async iterables, row parsing, server actions, and mixed HTTP/fetch data flows
  • Added promise/thenable ordering tests
  • Added regressions for literal primordials, array subclassing, accessor spreads, missing named exports, property shape slots, iterator-result fast paths, JSON temp roots, and typed-array metadata leaks
  • Added server and regex benchmarks
  • Added JIT bailout and captured-local/param benchmarks
  • Refreshed compatibility results repeatedly as new features landed

To install Ant v0.9.0:

curl -fsSL https://ant.themackabu.com/install | bash
v0.8.0.1774087286 New feature
Notable features
  • Generational garbage collector with nursery, write barrier, and adaptive thresholds
  • Hidden-class system for slot‑indexed property access with inline storage of first four properties
  • Typed memory pools providing size‑class buckets for ropes, symbols, bigints, and strings
Full changelog

Release Notes

Generational Garbage Collector

The monolithic gc.c has been split into six modules

  • Nursery-based generational scheme with adaptive thresholds for minor/major collection
  • Write barrier for old→young cross-generation references
  • Integrated rope string and interned string GC with pool-aware sweep

Object Shapes & Inline Caches

A hidden-class system replaces hash-based property lookup with slot-indexed access:

  • Shape transitions when properties are added; shared shapes are COW-cloned on mutation
  • First 4 properties stored inline in the object struct, overflow spills to a separate array
  • Per-slot writable, enumerable, configurable flags with optional getter/setter pairs
  • Support for both interned string keys and symbol keys
  • IC epoch bumped on every GC cycle to invalidate stale cache entries
  • Shapes integrated into the collection cycle

Typed Memory Pools

A new pool allocator (include/pool.h) for frequently allocated types:

  • 32 size-class buckets with free-list reuse
  • Dedicated pools for ropes (64 KB), symbols (32 KB), bigints (64 KB), and strings (128 KB)

Swarm Compiler Type Hints & Inline Caches

The Silver bytecode compiler now emits type information and inline cache indices:

  • Local type tracking with inferred types (NUM, STR, ARR, OBJ, BOOL, etc.)
  • Numeric fast-path opcodes: ADD_NUM, SUB_NUM, MUL_NUM, DIV_NUM skip type checks
  • 16-bit inline cache index on field and global access opcodes
  • IC slot on INSTANCEOF for prototype chain caching
  • Iterator hints for fast-path array/string iteration
  • Object literal site caching for shape reuse across repeated allocations
  • Per-IC warmup/miss tracking for adaptive IC disabling

Boxing & JIT Fixes

  • Value stack operations properly unbox Number, String, and Boolean wrappers before operating
  • Post-increment/decrement on upvalues correctly boxes the result

Internal Slot Optimization

  • sv_closure_t now stores bound_this, bound_args, super_val, and call_flags directly, eliminating hash-based slot lookups for hot paths like Function.prototype.bind

To install Ant v0.8.0:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.7.1.1773194854 New feature
Notable features
  • BigInt arithmetic (add, sub, mul, div, mod)
  • Bitwise ops (AND, OR, XOR, NOT) with two's complement
  • Limb‑level left/right shift support
Full changelog

Release Notes

BigInt

BigInt rewritten with a limb-based implementation:

  • Full arithmetic: addition, subtraction, multiplication, division, modulo
  • Bitwise operations: AND, OR, XOR, NOT with two's complement conversion
  • Left/right shift at the limb level
  • Radix string conversion for bases 2–36
  • Overflow-safe allocation throughout

Math

  • Math.random() now backed by libsodium's randombytes_buf() instead of the C stdlib
  • Boxed Number coercion fixes for wrapped math values

REPL

  • UTF-8 aware cursor movement, backspace, and delete
  • Virtual rendering for proper cursor positioning across wrapped lines

Additional Changes

  • Consolidated resolution and loading logic in ESM
  • Improved boxed value handling in the Swarm JIT

To install Ant v0.7.1:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.7.0.1772610809 Breaking risk
⚠ Upgrade required
  • Dependency bump: tlsuv updated from 0.40.10 to 0.40.13.
  • Vendored addition of MIR JIT backend, uriparser, and utf8proc for URI parsing and Unicode processing.
Breaking changes
  • Engine architecture changed from monolithic interpreter to `silver` bytecode compiler with JIT backend, altering observable performance and semantics.
Notable features
  • REPL overhaul: syntax highlighting, multiline wrapping, lexical declaration tracking, `.copy` clipboard command.
  • `ant:worker_threads` module providing subprocess‑based workers with `Worker`, `MessageChannel`, `MessagePort`, and async termination promise.
  • New modules: `ant:tty`, `ant:date`, `ant:regexp`, plus stubs for `dns`, `util`, `async_hooks`, `module`, and `net`.
Full changelog

Release Notes

Bytecode Compiler & JIT

Engine rewritten to a full bytecode compiler (silver) and JIT backend powered by MIR:

  • Silver: AST → bytecode pipeline with lexer, parser, compiler, and opcode set
  • MIR JIT: hot functions are compiled to native code with type-feedback-guided specialization for arithmetic, comparisons, and calls
  • On-stack replacement (OSR): long-running loops can transition mid-execution from interpreted to JIT'd code
  • Bailout & deoptimization: JIT'd code safely falls back to the interpreter when type assumptions are violated

REPL Overhaul

The REPL has been completely rewritten:

  • Syntax highlighting: live JS highlighting with 30+ token classes (keywords, strings, regex, template literals, numbers, comments, functions, classes)
  • Multiline-aware wrapping: proper cursor movement and rendering across wrapped lines and terminal widths
  • Lexical declaration tracking: let/const/class redeclaration errors are caught before evaluation, matching browser DevTools behavior
  • .copy [expr]: evaluate an expression and copy the result to the system clipboard
  • _ and _error: special variables for last result and last error

N-API Module

A new napi implementation enables loading native Node addons:

  • Value creation, type checking, coercion, and property access
  • Function/constructor calls, napi_wrap/napi_unwrap
  • napi_create_async_work / napi_queue_async_work via libuv
  • Threadsafe functions with queue, mutex, and uv_async dispatch
  • Handle scopes, references, error handling, and napi_module_register

Worker Threads

A new ant:worker_threads module provides subprocess-based workers:

import { Worker, isMainThread, workerData } from 'ant:worker_threads';

const worker = new Worker(new URL('./task.js', import.meta.url), {
  workerData: { input: 42 }
});

worker.on('message', msg => console.log('got:', msg));
worker.on('exit', code => console.log('exited:', code));
  • Worker, MessageChannel, MessagePort constructors
  • parentPort.postMessage() for child→parent communication
  • setEnvironmentData / getEnvironmentData for shared config
  • worker.terminate() returns a Promise

TTY Module

A new ant:tty module with ReadStream and WriteStream classes:

  • tty.isatty(fd), stream.getWindowSize(), stream.getColorDepth()
  • clearLine(), clearScreenDown(), cursorTo(), moveCursor()
  • setRawMode() for stdin
  • hasColors() with FORCE_COLOR / NO_COLOR / COLORTERM detection
  • rows and columns getters on process.stdout / process.stderr

Date Module

The Date constructor has been fully reimplemented as a standalone module:

  • All ES5/ES6 getters, setters, and string formatters
  • Date.parse() supporting ISO 8601, RFC 2822, and loose formats
  • Date.UTC(), Date.now()
  • Symbol.toPrimitive with proper hint dispatch
  • Timezone abbreviation parsing (GMT, EST, PST, CET, etc.)

RegExp Module

RegExp has been extracted into a dedicated module backed by PCRE2:

  • Symbol.match, Symbol.replace, Symbol.search, Symbol.split well-known symbol protocols
  • Symbol.species for subclass construction in @@split and @@replace
  • RegExp.escape() static method
  • RegExp.prototype.compile() for legacy compatibility
  • flags getter synthesized from individual flag properties
  • Named capture groups, Unicode property escapes (\p{Letter}), and JS→PCRE2 pattern translation
  • Regex cache with GC-aware eviction

Additional New Modules

  • ant:dns (stub): DNS resolution
  • ant:util: util.inspect(), util.format(), util.types
  • ant:async_hooks: async hook stubs
  • ant:module (stub): module.createRequire()
  • ant:net (stub): TCP socket stubs

Runtime Architecture

The monolithic src/ant.c has been decomposed into focused subsystems:

  • src/errors.c: error formatting and stack traces
  • src/gc.c: garbage collector
  • src/descriptors.c: property descriptors
  • src/esm/loader.c: ES module loader
  • src/esm/commonjs.c: CommonJS require
  • src/esm/library.c: built-in module registry
  • src/silver/: bytecode compiler, VM, JIT, lexer, AST, and opcode definitions

ES6 Spec Compliance

  • new.target meta-property
  • Enhanced destructuring for arrays and objects (nested patterns, defaults, rest elements)
  • Symbol.unscopables for with statement property hiding
  • Symbol.species for Promise, Array, and RegExp
  • Super class expressions in class definitions
  • String literal export/import names
  • Improved spread operator for arrays, strings, and dynamic arguments
  • Internal subclassing system rewrite

fs Module Additions

New synchronous and async filesystem operations:

  • fs.mkdirSync, fs.rmdirSync, fs.unlinkSync, fs.renameSync
  • fs.copyFileSync, fs.chmodSync, fs.chownSync
  • fs.realpathSync, fs.accessSync
  • Async variants via the unified event loop

Vendor Updates

| Dependency | Old | New |
| ---------- | ------- | ------- |
| tlsuv | 0.40.10 | 0.40.13 |

New vendored dependencies:

  • MIR: lightweight JIT compiler backend
  • uriparser: RFC 3986 URI parsing
  • utf8proc: Unicode text processing

Additional Changes

  • Windows builds use WIN32_LEAN_AND_MEAN and compat.h for platform specifics
  • Uint8Array constructor validation fixes
  • Binding loss fixes for this context
  • process.features, TypeScript declarations for util, worker_threads, and fs

To install Ant v0.7.0:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.6.4.1771407535 Breaking risk
Breaking changes
  • js_gc_compact() removed from public API, replaced by internal gc_compact()
Notable features
  • Watch mode (`--watch`) automatically restarts a module on entry‑file changes with debounced SIGTERM → SIGKILL fallback
  • New `ant:lmdb` module providing LMDB key‑value storage API
Full changelog

Release Notes

Watch Mode

Ant can now restart a module automatically when the entry file changes:

ant --watch server.js
ant --watch app.ts --no-clear-screen
  • Debounced restarts with graceful SIGTERM → SIGKILL fallback
  • --no-clear-screen preserves terminal output across restarts

LMDB Database Module

A new ant:lmdb module exposes the LMDB api for fast key-value storage:

import lmdb from 'ant:lmdb';

const env = lmdb.open('./mydb', {
  noSubdir: true,
  mapSize: 4 * 1024 * 1024,
  maxDbs: 8
});

const db = env.openDB('main', { create: true });

db.put('hello', 'world');
db.getString('hello');   // 'world'
db.get('hello', 'utf8'); // 'world'

const bytes = new Uint8Array([1, 2, 3, 255]);
db.put('bin', bytes);
db.getBytes('bin'); // Uint8Array [1, 2, 3, 255]

const tx = env.beginTxn();
tx.put(db, 'key', 'value');
tx.commit();

const ro = env.beginTxn({ readOnly: true });
ro.getString(db, 'key'); // 'value'
ro.abort();

db.close();
env.close();

File Encoding Support

fs.readFile and fs.readFileSync now accept encoding options and return Uint8Array by default, supports utf8, utf16le, latin1, base64, base64url, hex, and ascii encodings:

import fs from 'ant:fs';

const bytes = fs.readFileSync('image.png');        // Uint8Array
const text = fs.readFileSync('file.txt', 'utf8');  // string
const hex = fs.readFileSync('data.bin', 'hex');    // hex string
const b64 = fs.readFileSync('data.bin', 'base64'); // base64 string

GC Compaction Improvements

Garbage collection compaction has been simplified and made less likely to stall:

  • js_gc_compact() internalized as gc_compact() — no longer part of the public API
  • needs_gc flag now set at the beginning of compaction instead of after skip

Additional Changes

  • Multiple input arguments now supported via command line
  • process.features object added to snapshot generation
  • Enter key in raw mode normalized to emit '\r'

To install Ant v0.6.4:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.6.3.1771218233 Maintenance

Minor fixes and improvements.

Full changelog

Release Notes

All core vendored dependencies have been updated:

| Dependency | Old | New |
| ---------- | ------ | ------- |
| libuv | 1.51.0 | 1.52.0 |
| nghttp2 | 1.62.1 | 1.68.0 |
| tlsuv | 0.40.6 | 0.40.10 |
| zlib-ng | 2.3.2 | 2.3.3 |

libuv and llhttp now build as Meson subprojects instead of external CMake dependencies.
Windows builds now use the MSYS2 Clang64 toolchain instead of MinGW64.

Additional Changes

  • All platforms now have a MbedTLS binary option
  • hex_digit() uses a 256-byte lookup table instead of branch chains
  • libant header generation receives version metadata as arguments

To install Ant v0.6.3:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.6.2.1770953487 New feature
Notable features
  • Dot Operator Inline Cache for frequent property lookups with automatic invalidation on structure changes.
  • Package Manager enhancements: bulk package installation (ant add ...) and project scaffolding (ant create ...).
Full changelog

Release Notes

Dot Operator Inline Cache

Property lookups on objects now use an inline cache for frequently accessed properties:

const obj = { name: 'Ant', version: '0.6.2' };
console.log(obj.name); // Cached after first access
console.log(obj.version);

class MyClass {
  get value() { return 42; }
}
const instance = new MyClass();
console.log(instance.value); // Still benefits from caching
  • Cache keyed by code pointer and offset for stable property lookups
  • Automatic invalidation when object structure changes
  • Eliminated memory leaks in tail call argument handling

Array.from Iterator Support

Array.from now properly supports iterable objects and mapping functions:

const unique = Array.from(new Set(['a', 1, 'a', 2, '1']));
console.log(unique); // ['a', 1, '1', 2]

const doubled = Array.from(new Set([1, 2, 3]), x => x * 2);
console.log(doubled); // [2, 4, 6]

const chars = Array.from("abc");
console.log(chars); // ['a', 'b', 'c']

const arr = Array.from([10, 20, 30]);
console.log(arr); // [10, 20, 30]

Package Manager Enhancements

The CLI package manager now supports bulk operations and project scaffolding:

# Install multiple packages at once
ant add pkg1 pkg2 pkg3

# Create project from template
ant create react my-app
ant create next my-next-app

# Create from GitHub repository
ant create github-org/repo my-project
ant create https://github.com/org/repo.git my-project

To install Ant v0.6.2:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.6.1.1770760605 New feature
Notable features
  • Unified escape sequence decoder handling all formats consistently in strings and template literals
  • Process `beforeExit` event emitted after the event loop finishes but before termination, allowing final async work
Full changelog

Release Notes

Unified Escape Sequence Decoder

String escape sequence handling has been completely rewritten with a unified decoder:

// All escape sequences now handled consistently
const str = "\x41\x42\x43\u0041\u0042\u{1f600}\n\t";
console.log(str); // "ABCAB😀" + newline + tab

// Template literals use the same decoder
const name = "world";
const tpl = `Hello\n\u0041\u{1f600} ${name}`;
console.log(tpl); // "Hello\nA😀 world"
  • Fixed incorrect unhex implementation
  • Octal escapes properly rejected in template literals
  • Proper UTF-8 encoding for all Unicode escape sequences (\u{NNNNN})

beforeExit Event

The process module now emits a beforeExit event before the event loop exits:

let iterations = 0;

function work() {
  iterations++;
  if (iterations < 1000000) setImmediate(work);
}

work();

process.once('beforeExit', () => {
  console.log(`Completed ${iterations} iterations`);
});
  • Emitted after the event loop finishes but before process termination
  • Can schedule additional async work to keep the process alive
  • Useful for final cleanup and performance reporting

Tail Call Optimization Fixes

Multiple TCO edge cases have been fixed:

// Zero-argument tail calls now work correctly
function countdown(n) {
  if (n <= 0) return 'done';
  return countdown(n - 1);
}
countdown(1000000); // No stack overflow

// TCO disabled for array/object literals to prevent incorrect optimization
const arr = [1, 2, 3];  // Properly parsed
const obj = { a: 1 };   // Not subject to TCO
  • Fixed zero-argument tail call iteration
  • TCO disabled during array and object literal parsing
  • Ternary expressions and tail span checks now properly supported
  • Eliminated memory leaks in tail call argument handling

To install Ant v0.6.1:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.6.0.1770714933 New feature
Notable features
  • Class computed property keys (dynamic symbols, strings, numbers) evaluated once at definition
  • ES6 additions: Symbol.species, Object.is(), Number.parseInt/parseFloat aliases, Promise.race/all iterable support, Proxy trapping for array methods and instanceof, static class member initialization
  • Ant reads from stdin when no file argument is provided
Full changelog

Release Notes

v0.6.0 is the one of the largest releases since the project began. 56 commits touching 73 files with over 8,000 lines of new code. Three core data structures have been replaced: strings now use ropes, arrays use dense backing buffers, and the tokenizer caches streams per function body. The garbage collector gained conservative stack scanning and controlled safepoints, and the runtime now performs tail call optimization. This is effectively a new engine underneath the same API.

We also now have a discord: http://discord.gg/CH7YSjWGzY


Rope Strings

String concatenation now uses a rope data structure for deferred flattening:

let s = '';
for (let i = 0; i < 10000; i++) {
  s += 'x'; // O(1) concatenation via rope nodes
}
  • Flattening deferred until string content is actually read
  • Max depth of 64 with automatic flattening at 32KB threshold

Dense Arrays

Arrays now use a dense backing store for indexed elements:

const arr = [1, 2, 3, 4, 5]; // Stored as contiguous jsval_t buffer
arr.push(6);                 // Appends to dense buffer
arr[100] = 'sparse';         // Falls back to property storage

Token Streaming Cache

Function bodies are now tokenized once and replayed on subsequent calls:

  • token_stream_t caches token type, offset, length, and literal values
  • Cached per-function via parsed_func_t hash table

Tail Call Optimization

Recursive functions in tail position are optimized to reuse the current call frame:

function factorial(n, acc = 1n) {
  if (n <= 1n) return acc;
  return factorial(n - 1n, n * acc); // Tail call: no stack growth
}

factorial(10000n); // Works without stack overflow
  • Token stream scanned at parse time to detect tail call patterns
  • scan_tail_span() analyzes return statements for eligible calls

GC Safepoints & Stack Scanning

Garbage collection now uses controlled safepoints and conservative stack scanning:

  • Engine now marks safe points for collection
  • GC scans C stack for heap pointers reducing manual rooting overhead
  • Expression operands rooted across sub-expression evaluation
  • Adaptive cooldown tuned for heap size (2-8 second intervals)
  • GC throttling during server response handling and coroutine execution
  • Promise offset tracking prevents premature collection of pending promises

BigInt Bitwise Shifts

BigInt now supports left and right shift operators:

const a = 1n << 64n;  // 18446744073709551616n
const b = 256n >> 4n; // 16n
  • Optimized fast path for values fitting in uint64_t
  • Arbitrary-precision fallback using multiply/divide by powers of 2

Class Computed Property Keys

Classes now support computed property names for fields, methods, and static members:

const key = 'x';
class Vec {
  [key] = 0;
  ['get' + 'Value']() { return this.x; }
  static ['create']() { return new Vec(); }
}

const sym = Symbol('id');
class Entity {
  [sym] = 42;
}
new Entity()[sym]; // 42
  • Computed keys evaluated once at class definition time
  • Symbol, string, and numeric keys supported
  • Side-effect expressions ([makeKey()]) only run during class creation

ES6 Feature Additions

  • Symbol.species for subclass constructor customization
  • Object.is() for same-value equality
  • Number.parseInt / Number.parseFloat aliases
  • Promise.race() and Promise.all() accept any iterable
  • Proxy support for push, pop, splice, includes, indexOf, and instanceof
  • Static class members properly initialized

Stdin Piping

Ant now reads from stdin when no file argument is given:

echo "console.log('hello')" | ant
cat script.js | ant

Unified Event Loop

All async modules now share uv_default_loop() directly:

  • Removes per-module private event loops (fs, fetch, child_process)
  • Fixes deadlocks when async operations ran on unpolled loops
  • Server integration via js_reactor_set_poll_hook()
  • Per-emitter event tracking via emitter_registry

Unified String Handling

New js_to_cstr() API for safe value-to-C-string conversion:

char buf[512];
js_cstr_t str = js_to_cstr(js, value, buf, sizeof(buf));
printf("%s\n", str.ptr);
if (str.needs_free) free((void *)str.ptr);
  • Stack buffer fast path avoids allocation for small strings
  • Automatic heap fallback for large values
  • Eliminates memory leaks from tostr_alloc() call sites

Absolute Path Imports

ES modules now resolve absolute paths with extension probing:

import config from '/etc/myapp/config.js';
  • Tries .js, .ts, .mts, .cts, .json extensions
  • Consistent with relative path resolution behavior

URL Module Prototype Migration

The URL constructor now uses proper prototype-based methods:

  • Methods like toString(), toJSON() moved to URL.prototype
  • SLOT_ENTRIES for search params iterator state
  • js_eval_cached() API for snapshot-based evaluation

Additional Changes

  • Arena shrinking and memory decommit for reduced RSS
  • Interned property cache invalidated by generation counter on GC
  • Weak reference handling for collections GC updates
  • Dedicated descriptor entry for array length property
  • Reactor event polling optimized for fewer wakeups
  • Consolidated runtime cleanup logic
  • Child process event loop detection and polling improvements
  • Event system memory cleanup on emitter teardown
  • Comprehensive BUILDING.md guide added

To install Ant v0.6.0

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.5.2.1770185958 Breaking risk
Notable features
  • Dynamic object key enumeration with `js_set_keys()` callback
  • BigInt methods `asUintN` and `asIntN` for N‑bit wrapping
  • Full support for enumerating and modifying `process.env`
Full changelog

Release Notes

Revised Symbol System

The Symbol implementation has been completely rewritten for spec compliance:

const sym = Symbol('desc');
console.log(sym.toString());        // "Symbol(desc)"
console.log(sym.description);       // "desc"

const obj = { [Symbol.toPrimitive]: () => 42 };
console.log(+obj);                  // 42
  • Symbol.toPrimitive and Symbol.hasInstance now supported
  • Symbol keys properly handled in object coercion

BigInt Performance & Methods

BigInt.prototype.toString rewritten for faster radix conversion:

const big = 2n ** 256n;
console.log(big.toString(16));  // much faster hex conversion
  • O(n²) → O(n log n) improvement for large numbers
  • BigInt.asUintN(bits, value) - wrap to unsigned N-bit integer
  • BigInt.asIntN(bits, value) - wrap to signed N-bit integer

(API change) Dynamic Object Keys

Custom objects can now provide dynamic key enumeration:

js_set_keys(js, obj, my_keys_fn);

Object.keys(dynamicObj);    // Calls custom keys function
Object.values(dynamicObj);  // Uses keys + getter
Object.entries(dynamicObj); // Uses keys + getter
  • js_set_keys() registers a callback for Object.keys()
  • Works with existing js_set_getter() and js_set_setter()
  • Used internally for process.env enumeration

Improved process.env

Environment variable handling now fully supports enumeration and modification:

process.env.MY_VAR = 'value';
console.log(Object.keys(process.env));  // lists all env vars
delete process.env.MY_VAR;

Scope Management Fixes

Function call scope handling has been corrected:

  • Function scope now pushed to stack after creation (not parent scope)
  • Fixes variable resolution in nested function calls
  • Constant assignment errors now always throw (not just in strict mode)

Map/Set GC Improvements

Collection registry restructured for proper GC forwarding:

  • map_registry_entry_t and set_registry_entry_t track object offsets
  • Separate reserve and update phases for GC roots
  • Prevents dangling references after compaction

Additional Changes

  • Array literal handling optimized
  • Buffer out-of-bounds access fixed
  • js_try_get() as single source of truth for property access
  • Null check for realloc in various modules
  • [object Array] now returned for Object.prototype.toString.call([])
  • Redundant GC code and gc_suppress flag removed
  • File prefix resolution for package manager

To install Ant v0.5.2

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.5.1.1770076318 New feature
Notable features
  • Built‑in package manager supporting `ant install`, `add`, `remove`, `run`, and other commands
  • HTTP/2 multiplexing with 6 tarball and 3 metadata persistent connections
  • LMDB content‑addressable cache for fast reinstalls and zero‑copy linking
Full changelog

Release Notes

Package Manager

Ant now includes a built-in package manager for installing npm packages:

# install dependencies from package.json
ant install

# Add a package
ant add react
ant add -D typescript  # dev dependency

# Remove a package
ant remove react

# Global packages
ant add -g prettier

# Run scripts
ant run build
ant test

Features:

  • Full npm registry compatibility with HTTP/2 support
  • LMDB-backed content-addressable cache for fast reinstalls
  • Hard-linking from cache to node_modules (with copy fallback)
  • Lifecycle scripts (postinstall, prepare, etc.) with trust prompts

Commands:

| Command | Description |
| -------------------- | -------------------------------------- |
| ant init | Create a new package.json |
| ant install | Install dependencies from lockfile |
| ant add | Add a package to dependencies |
| ant remove | Remove a package from dependencies |
| ant trust | Run lifecycle scripts for packages |
| ant run | Run a script from package.json |
| ant exec | Run a command from node_modules/.bin |
| ant why | Show why a package is installed |
| ant info | Show package information from registry |
| ant ls | List installed packages |
| ant cache | Manage the package cache |

Performance

The package manager is designed to be faster than alternatives like Bun:

HTTP/2 Multiplexing

  • 6 persistent connections for tarballs, 3 for metadata
  • All requests multiplexed over shared connections, with automatic request queuing

Parallel Resolution & Extraction

  • Dependency tree resolved concurrently with streaming fetches
  • Tarballs extracted in parallel as they download (no wait-for-all)
  • 8-thread parallel linking for large node_modules (>500 packages)

LMDB Cache

  • Content-addressable storage keyed by tarball SHA-512
  • Single-file database with memory-mapped reads (zero-copy)
  • No filesystem overhead from thousands of cached tarballs

Zero-Copy Linking

  • Hard links from cache on supported filesystems
  • Falls back to reflinks (FICLONE) on Btrfs/XFS/APFS
  • Copy only when cross-device or permissions require it

Minimal Overhead

  • Written in Zig with no runtime allocator overhead
  • Direct libuv/tlsuv integration (same event loop as Ant runtime)
  • No JSON parsing for cached metadata (binary lockfile format)

To install Ant v0.5.1

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.5.0.1769931688 New feature
Notable features
  • Arrow functions now handle expression bodies natively without synthetic `return` wrapper.
  • Coroutine settlement handling improved with `settle_coroutine()` and `resume_coroutine_if_suspended()` helpers.
Full changelog

Release Notes

Timer Arguments Support

setTimeout and setInterval now accept additional arguments passed to the callback:

setTimeout((name, count) => {
  console.log(`Hello ${name}, count: ${count}`);
}, 1000, 'World', 42);

setInterval((msg) => console.log(msg), 500, 'tick');

Coroutine Settlement Handling

Improved async/await behavior when promises settle while coroutines are suspended:

  • New settle_coroutine() helper for unified resolution/rejection handling
  • resume_coroutine_if_suspended() immediately resumes waiting coroutines
  • Fixes edge cases where awaited promises resolve via microtask queue

Arrow Function Expression Bodies

Arrow functions with expression bodies (no braces) now handled natively:

const add = (a, b) => a + b;        // expression body
const greet = name => `Hi ${name}`; // implicit return
  • Expression bodies evaluated directly without synthetic return wrapper
  • Cleaner Function.prototype.toString() output for arrow functions

Additional Changes

  • Map, Set, WeakMap, and WeakSet implementations refactored into dedicated module
  • SLOT_ARROW now set for all arrow function variants
  • Internal uint_to_str(), mkarr(), and setprop() exposed in internal.h

To install Ant v0.5.0:

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.5.0.1769643644 New feature
Notable features
  • Async‑safe GC with coroutine state rooting and adaptive cooldown
  • Custom arena allocator replaces Boehm GC, adds code intern cache
  • Array.prototype.sort rewritten using merge sort for O(n log n) performance
Full changelog

Release Notes

Garbage Collection Overhaul

The GC subsystem has been significantly rewritten for better performance and async-awareness.
The runtime also now uses 64-bit offsets for memory addressing, enabling support for larger heaps.

Async-Safe Collection

GC now runs safely alongside coroutines and async operations:

  • Coroutine state (scope, this, promises, yield values) properly rooted during collection
  • gc_suppress flag prevents collection during startup and critical sections
  • Adaptive cooldown based on heap size (2-8 seconds between collections)
  • Collection skipped if allocation delta is below threshold

Memory Management

  • Platform-native mmap/VirtualAlloc for scratch buffers
  • Goto-table dispatch for object/property/string forwarding
  • Weak references for accessor registry (auto-cleanup of unreachable accessors)
  • Buffer and TypedArray roots properly tracked across GC cycles

Arena Memory Management

Memory allocation migrated from Boehm GC to a custom arena allocator:

  • Dedicated arenas for runtime objects with explicit lifetime management
  • Code intern cache for function source deduplication
  • Ant.stats() now reports arenaUsed and arenaSize metrics

Process Event Emitter

Node.js-style event handling with signal support:

process.on('SIGINT', () => {
  console.log('Caught interrupt');
  process.exit(0);
});

process.once('exit', (code) => console.log(`Exiting with ${code}`));
process.emit('custom', { data: 'value' });
  • on, once, off, emit, addListener, removeListener, removeAllListeners
  • listenerCount, setMaxListeners, getMaxListeners
  • Signal handlers: SIGINT, SIGTERM, SIGHUP, SIGUSR1, SIGUSR2, etc.

Process Stdin Support

Interactive input via process.stdin:

process.stdin.setRawMode(true);
process.stdin.on('keypress', (key) => {
  if (key.name === 'q') process.exit(0);
});
  • Raw mode for character-by-character input
  • Keypress events with key name, ctrl, alt, shift modifiers
  • TUI application support (see examples/tui/)

Improved Stack Overflow Detection

Stack limits now use OS-level detection with coroutine awareness:

  • js_setstacklimit() and js_setstackbase() for custom limits
  • Coroutine stacks checked independently from main stack
  • ANT_CORO_STACK_SIZE environment variable for custom coroutine stack size

Optimized Array Methods

Array.prototype.sort rewritten with merge sort for O(n log n) performance:

const sorted = [3, 1, 4, 1, 5].sort();   // Much faster for large arrays
const reversed = arr.toReversed();       // Non-mutating
const spliced = arr.toSpliced(1, 2);     // Non-mutating
  • Merge sort replaces O(n²) bubble sort
  • toSorted, toReversed, toSpliced reuse optimized implementations
  • Callback validation for map, filter, reduce, some, every
  • Property iteration order now matches insertion order (ECMA spec)

UTF-8 Module

Dedicated UTF-8 encoding/decoding utilities:

  • ASCII character cache for single-byte string optimization
  • Improved for...of iteration over strings

Object Inspector

Debug introspection via console.inspect():

console.inspect(someObject);  // Detailed view with internal slots
  • Shows internal slots (SLOT_PROTO, SLOT_ASYNC, etc.)
  • Circular reference detection
  • Configurable depth limit

Global Object Reference

The global object is now properly tracked:

console.log(global === globalThis);  // true
  • js->global field stores root global object
  • js_glob() returns proper global reference

Template Literal Improvements

Nested template literals with expressions now parse correctly:

const nested = `outer ${`inner ${value}`} end`;
  • Dedicated helpers for template scanning
  • Proper depth tracking for ${} expressions

Additional Changes

  • process.ppid returns parent process ID (non-Windows)
  • Weak reference handling for accessor registry
  • ArrayBuffer.transfer() and transferToFixedLength() support

To install Ant v0.5.0

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.4.1.1769323323 New feature
Notable features
  • New `access()` and `accessSync()` functions for file permission checks with constants R_OK, W_OK, X_OK
  • Extended `Stats` objects now include `uid`, `gid` properties and `isSymbolicLink()` method
  • Full Unicode code point support via `codePointAt()` with proper UTF-8 handling
Full changelog

Release Notes

File Access Checks

New access() and accessSync() functions to check file permissions:

import { access, accessSync, constants } from 'fs';

await access('/path/to/file', constants.R_OK);
accessSync('/path/to/file', constants.W_OK);
  • fs.constants provides F_OK, R_OK, W_OK, X_OK permission flags
  • Throws with code property (e.g., ENOENT, EACCES) on failure

Improved Stats Object

Stats objects now include additional properties and methods:

import { stat } from 'fs';

const info = await stat('/path/to/file');
console.log(info.uid, info.gid);       // Owner/group IDs
console.log(info.isSymbolicLink());    // true/false
  • Added uid and gid properties for file ownership
  • Added isSymbolicLink() method for symlink detection

Import default as Named Binding

The default keyword can now be used as a named import binding:

import { default as myDefault } from './module.js';

ECMA-Compliant Math Functions

All Math methods now follow the ECMA specification for type coercion:

Math.abs("42");     // 42 (string coercion)
Math.floor(null);   // 0 (null → 0)
Math.sqrt({});      // NaN (object → NaN)
  • Arguments are converted using ToNumber() semantics before computation
  • Consistent NaN handling for non-numeric inputs

String codePointAt() Support

Full Unicode code point access with proper UTF-8 handling:

const str = '𝄞';  // U+1D11E (Musical Symbol G Clef)
console.log(str.codePointAt(0));  // 119070
console.log(str.charCodeAt(0));   // 55348 (high surrogate)
  • charAt() and charCodeAt() now accept any value and coerce to number
  • Properly handles multi-byte UTF-8 sequences (2, 3, and 4 byte)

Module Scope Isolation

ES modules now create properly isolated scopes:

// module.js
var x = 1;  // Does not leak to global scope

// main.js
import './module.js';
console.log(typeof x);  // "undefined"

Runtime NaN-Boxing Validation

GC allocations now include runtime checks for pointer validity:

  • Validates that allocated pointers fit within 48-bit NaN-boxing range
  • Provides clear error message if architecture returns out-of-range pointers
  • Prevents silent corruption on exotic memory configurations

JSON Signed Integer Support

JSON parsing now correctly handles signed 64-bit integers:

JSON.parse('{"value": -9007199254740991}');  // Correct negative value
JSON.stringify({ n: -42 });  // "-42" (not "-42.0")

Improved Error Handling

  • Missing tokens in loops now produce proper syntax errors instead of crashes
  • Function body parsing validates expected structure before execution
  • Invalid string indices return appropriate undefined or NaN values
  • Scope cleanup on loop errors prevents corruption in non-let for loops

ant_t Type Alias

The public API now uses ant_t as an alias for struct js:

#include <ant.h>

ant_t *engine = js_create_dynamic(1024 * 1024, 64 * 1024 * 1024);
jsval_t result = js_eval(engine, "1 + 1", 5);

To install Ant v0.4.1

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.4.0.1769154308 Bug fix
Notable features
  • Contextual keywords (`from`, `of`, `as`, `async`) usable as identifiers
  • OXC‑powered variable hoisting for improved accuracy and performance
  • Code arena allocator for function source code memory management
Full changelog

Release Notes

Contextual Keywords as Identifiers

Contextual keywords (from, of, as, async) can now be used as variable names, parameter names, and function names in non-reserved positions:

const async = 'meow';

function size(from, to) {
  return to - from + 1;
}

console.log(size(1, 10), async);  // 10 meow

OXC-Powered Variable Hoisting

Variable hoisting is now handled by the OXC parser for improved accuracy and performance:

  • var declarations are collected at parse time using OXC's AST visitor
  • Hoisted variables are cached per-function in SLOT_HOISTED_VARS
  • Function declaration hoisting properly detects expression contexts to avoid false positives
  • code_has_function_decl() pre-scans function bodies to skip unnecessary hoisting passes

Code Arena Allocator

Function code is now stored in a dedicated arena allocator for better memory management:

  • code_arena_alloc() provides persistent storage for function source code
  • Eliminates GC overhead for code strings
  • Function code stored via SLOT_CODE (pointer) and SLOT_CODE_LEN (length)

Improved GC Performance

Garbage collection has been optimized with better data structures:

  • Forward table uses open-addressing hash map with 70% load factor
  • Work queue replaces recursive copying for iterative traversal
  • Reduced memory fragmentation from linked-list node allocations

Async Loop Closure Fixes

for-let loops with await now correctly capture iteration variables:

async function test() {
  const fns = [];
  for (let i = 0; i < 3; i++) {
    await delay(5);
    fns.push(() => i);  // Each closure captures its own `i`
  }
  return fns.map(f => f());  // [0, 1, 2]
}
  • Coroutine scope stack properly preserved/restored across await points
  • for_let_capture_scope() creates snapshot of loop variables
  • Nested async loops work correctly with independent variable capture

Improved Error Messages

  • const declarations without initializers now report: "Missing initializer in const declaration"
  • Strict mode eval properly creates isolated scope via SLOT_STRICT_EVAL_SCOPE

Function Prototype Support

All functions now properly inherit from Function.prototype:

function foo() {}
console.log(foo.__proto__ === Function.prototype);  // true

const arrow = () => {};
console.log(arrow.__proto__ === Function.prototype);  // true
  • SLOT_FUNC_PROTO stores the Function prototype reference
  • Arrow functions, async functions, class methods, and bound functions all get correct prototype chain

To install Ant v0.4.0

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.13.1768970059 New feature
Notable features
  • Observable implementation per TC39 proposal with `new Observable`, static `of`/`from`, subscription API and cleanup handling
  • Embedding API allowing Ant to be used as a static C library with new functions `js_mkscope()`, `js_getscope()`, `js_getprop_proto()`
Full changelog

Release Notes

Observable Module

New Observable implementation following the TC39 Observable proposal. See examples/spec/observable.js:

const observable = new Observable(observer => {
  observer.next(1);
  observer.next(2);
  observer.next(3);
  observer.complete();
  
  return () => console.log('Cleanup');
});

const subscription = observable.subscribe({
  next: value => console.log(value),
  complete: () => console.log('Done')
});

subscription.unsubscribe();
  • new Observable(subscriber) - Create observable from subscriber function
  • Observable.of(...values) - Create observable from values
  • Observable.from(iterable) - Create observable from iterables or @@observable objects
  • observable.subscribe(observer) - Subscribe with observer object or callbacks
  • subscription.unsubscribe() - Cancel subscription and run cleanup
  • subscription.closed - Check if subscription is closed
  • Symbol.observable - Well-known symbol for observable protocol

Embedding API

Ant can now be embedded as a static library in C applications. See examples/embed/embed.c:

#include <ant.h>

int main(void) {
  struct js *js = js_create_dynamic(0, 0);
  jsval_t scope = js_mkscope(js);
  
  // register C functions
  js_set(js, js_glob(js), "add", js_mkfun(my_add));
  
  // evaluate JavaScript
  jsval_t result = js_eval(js, "add(1, 2)", 9);
  printf("Result: %g\n", js_getnum(result));
  
  js_destroy(js);
}

Build with -Dbuild_examples=true:

meson setup build -Dbuild_examples=true
meson compile -C build
./build/embed_example

New public APIs:

  • js_mkscope() now returns the scope object
  • js_getscope() - Get current scope
  • js_getprop_proto() - Get property with prototype chain lookup

GC Performance Improvements

Reduced garbage collection overhead in microtask-heavy workloads:

  • Promise handlers now use lightweight ID-based triggers instead of wrapper function objects
  • GC is suppressed during microtask batch processing via js_set_gc_suppress()
  • queue_promise_trigger() queues promise resolution by ID without allocating closures

Improved Error Messages

Unambiguous operator precedence errors for exponentiation:

-2 ** 2  // SyntaxError: Unary operator used immediately before 
         // exponentiation expression. Parenthesis must be used 
         // to disambiguate operator precedence

(-2) ** 2  // OK: 4
-(2 ** 2)  // OK: -4

EventTarget and EventEmitter Improvements

Both EventTarget and EventEmitter now use prototype-based construction for better memory efficiency and proper instanceof support:

const emitter = new EventEmitter();
console.log(emitter instanceof EventEmitter); // true

const target = new EventTarget();
console.log(target instanceof EventTarget); // true

Internal

  • Fixed memory leak in loop block scope management - scopes are now only created when let, const, class, or function declarations are present
  • Fixed block_needs_scope() to account for function declarations
  • Fixed array toString() to properly handle null/undefined elements (output empty string instead of literal text)
  • Fixed array string concatenation to use direct string copy for string elements
  • Added scope_clear_props() to reuse existing scope objects in loops
  • Unified JS type constants into shared enum and flag macros between internal.h and GC
  • Events module refactored to use internal slot storage instead of hidden properties
  • Observable uses js_heavy_mkfun() for subscriber functions with attached data
  • New js_process_promise_handlers() API for direct promise handler invocation

To install Ant v0.3.13

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.12.1768953664 New feature
Notable features
  • Full ES2021 WeakRef and FinalizationRegistry implementations for advanced memory management
  • TypedArray immutable methods: toSorted, toReversed, with (copy‑on‑write)
  • Enhanced Promise API including finally(), try wrapper, unhandled rejection tracking, subclassing support and AggregateError
Full changelog

Release Notes

WeakRef and FinalizationRegistry

Full implementations of ES2021 weak reference primitives for advanced memory management. See examples/spec/weakref.js and examples/spec/finalizationregistry.js:

const registry = new FinalizationRegistry(heldValue => {
  console.log(`Cleaned up: ${heldValue}`);
});

let obj = { data: 'important' };
const ref = new WeakRef(obj);
registry.register(obj, 'my-object', obj);

console.log(ref.deref()); // { data: 'important' }
  • WeakRef - Hold weak references to objects without preventing garbage collection
  • FinalizationRegistry - Register cleanup callbacks when objects are collected
  • registry.unregister(token) - Remove registrations by token

TypedArray Change-by-Copy Methods

ES2023 immutable array methods now available on all TypedArray types:

const arr = new Uint8Array([3, 1, 2]);

arr.toSorted();    // Uint8Array [1, 2, 3] (original unchanged)
arr.toReversed();  // Uint8Array [2, 1, 3]
arr.with(0, 99);   // Uint8Array [99, 1, 2]
  • toReversed() - Returns new reversed TypedArray
  • toSorted(comparefn?) - Returns new sorted TypedArray with optional comparator
  • with(index, value) - Returns copy with one element replaced (supports negative indices)

Promise Improvements

Enhanced Promise implementation with better ES spec compliance:

  • Promise.prototype.finally() - ES2018 finally handler support
  • Promise.try(fn, ...args) - Wrap sync functions in promises safely
  • Unhandled rejection tracking - Automatic detection and reporting to stderr
  • Promise subclassing - Proper new.target handling for extending Promise
  • AggregateError - Full support for Promise.any() rejections

Buffer Encoding Support

The Buffer module now supports multiple string encodings:

Buffer.from('hello', 'utf8');
Buffer.from('68656c6c6f', 'hex');
Buffer.from('aGVsbG8=', 'base64');

buf.toString('hex');    // '68656c6c6f'
buf.toString('base64'); // 'aGVsbG8='

Supported encodings: utf8, hex, base64, ascii, latin1, ucs2/utf16le

New Buffer static methods: isBuffer, isEncoding, byteLength, concat, compare

Multiline REPL

The REPL now automatically detects incomplete expressions and continues on the next line:

> function greet(name) {
|   return `Hello, ${name}!`;
| }
> greet('world')
'Hello, world!'
  • Tracks unclosed brackets, braces, parentheses, and template literals
  • Handles string continuations and multi-line comments
  • Ctrl+C cancels multiline input

DataView Methods

Complete DataView implementation with full endianness support:

const buffer = new ArrayBuffer(8);
const view = new DataView(buffer);

view.setInt32(0, 0x12345678, true);  // little-endian
view.setFloat64(0, 3.14159);
view.getFloat64(0);  // 3.14159

New methods: setInt16, setInt32, setFloat32, getFloat64, setFloat64

Internal

  • TypedArray constructor now accepts iterables
  • Shared TypedArray prototype reduces memory footprint
  • TypedArray and DataView now expose .buffer property referencing the underlying ArrayBuffer
  • BigInt support in js_truthy() and string conversion
  • Class inheritance properly delegates to super() constructor via SLOT_DEFAULT_CTOR
  • super.method() and super[key]() calls work correctly in class methods
  • Fixed Promise object slot offset for multi-access scenarios
  • Improved typeof handling for error types (returns correct error type on ReferenceError)
  • Display async functions as [AsyncFunction: name] in output
  • Error handling for empty parenthesis expressions
  • New token checks for block statements and automatic semicolon insertion (ASI)
  • ES1 arguments property on function instances in non-strict mode
  • Date objects now use internal slot for timestamp storage
  • ArrayBuffer and SharedArrayBuffer display with hex contents in console output
  • Proxy data support for WeakRef/FinalizationRegistry internals
  • Refactored error constructor logic with standardized new.target handling

To install Ant v0.3.12

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.11.1768813913 New feature
Notable features
  • `new_target` field tracks constructor calls distinguishing `new` vs direct function invocations
  • Custom array subclasses display their class name with contents in console output
Full changelog

Release Notes

new.target Support

The runtime now properly tracks constructor calls with a dedicated new_target field:

  • Enables correct detection of new vs direct function calls
  • Error constructors properly determine their name from new.target
  • Bound functions ignore bound_this during constructor calls

Array Subclass Display

Arrays created from custom classes now display their class name:

class MyArray extends Array {}
let arr = new MyArray(1, 2, 3);
console.log(arr); // MyArray(3) [ 1, 2, 3 ]
  • Non-index properties on arrays are also displayed
  • Class name detection works through prototype chain

Improved Class Inheritance

Default constructors for derived classes now properly delegate to parent constructors without generating intermediate code:

class Child extends Parent {} // automatically calls super(...args)
  • Parent constructor is called directly in do_call_op
  • Prototype chain is correctly set after super() calls

Bug Fixes

  • Super method calls: Class methods can now call parent methods using super.method() and super[method]() syntax. Methods are automatically bound to the correct this context.

To install Ant v0.3.11

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.10.1768460853 New feature
Notable features
  • Unified iterator infrastructure makes `for-in` consistent with `for-of` and supports labeled `break`/`continue`.
  • Optimized property lookups remove `SLOT_VERSION` overhead; cache invalidation occurs only on property deletion.
Full changelog

Release Notes

For-In Iterator Support

The for-in loop now uses the unified iterator infrastructure, bringing consistency with for-of loops and enabling proper support for labeled break and continue statements:

outer: for (const key in obj) {
  for (const k in nested) {
    if (condition) continue outer;
  }
}
  • Works with objects, arrays, and functions
  • Properly handles labeled loop control flow
  • Correctly skips non-enumerable properties and internal symbols

Optimized Property Lookups

Property cache invalidation has been rewritten for better performance. Instead of traversing the prototype chain to increment version numbers on every property change, the cache now uses targeted invalidation only when properties are deleted.

  • Removes SLOT_VERSION overhead from property operations
  • Cache entries are invalidated directly by matching object offset and interned key
  • Setting properties no longer triggers version increments

To install Ant v0.3.10

curl -fsSL https://ant.themackabu.com/install | bash
# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.9.1768454788 New feature
Notable features
  • Full support for `Object.create(null)` and class instances inheriting from a null prototype
  • Module garbage collection improvements covering string interning, property descriptors, Buffer, events, localStorage/sessionStorage, and timer memory management
Full changelog

Release Notes

Null Prototype Objects

Full support for Object.create(null)

const obj = Object.create(null);
obj.foo = 'bar';
console.log(obj);
// [Object: null prototype] { foo: 'bar' }

class MyClass extends null {}
const instance = new MyClass();
console.log(instance);
// MyClass <[Object: null prototype] {}> {}
  • Objects with null prototype are properly detected and displayed
  • Class instances inheriting from null prototype show their lineage

Module Garbage Collection

Internal module allocations now use the GC arena, enabling better memory reclamation across the runtime:

  • String interning, property descriptors, and GC forward tables
  • Buffer, events, localStorage, and sessionStorage modules
  • Timer module memory management

Internal

  • Fast-path for numeric operations
  • Function hoisting skipped entirely when block contains no function keyword
  • Built-in constructors now have proper name properties (Object.name === 'Object')
  • New SLOT_CTOR internal slot tracks constructor for null-prototype instances

To install Ant v0.3.9

curl -fsSL https://ant.themackabu.com/install | bash

# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.8.1768256333 New feature
⚠ Upgrade required
  • Default max memory increased from 512MB to 1GB.
  • `Ant.serve` now performs garbage collection automatically every 10,000 requests.
Security fixes
  • Fixed buffer overflow in server byte buffer.
Notable features
  • Added `process.features` exposing runtime capabilities (uv, tls_mbedtls, typescript).
  • Improved export statement handling with full specifier collection and better error messages.
  • Garbage collection now shrinks heap automatically and triggers every 10,000 requests in Ant.serve.
Full changelog

Release Notes

Process Features Object

Added process.features to expose runtime capabilities:

console.log(process.features);
// { uv: true, tls_mbedtls: false, typescript: 'transform' }

Improved Export Statement Handling

Export statements now support re-exporting from modules with proper specifier collection:

export { foo, bar as baz } from './module.js';
export { default as myDefault } from './other.js';
  • Collects all export specifiers before processing
  • Supports default as both local and exported names
  • Better error messages for non-object module re-exports

JSON Array Parsing

JSON.parse() now returns proper JavaScript arrays instead of array-like objects:

const data = JSON.parse('[1, 2, 3]');
console.log(Array.isArray(data)); // true
data.push(4); // array methods work correctly

Garbage Collection Improvements

Heap memory is now automatically shrunk after GC when usage drops significantly:

  • Heap shrinks to 2x used memory when old size ≥ 4x the target
  • Minimum heap size of 64KB preserved
  • Reduces memory footprint for long-running servers
  • Ant.serve now trigger garbage collection every 10,000 requests, preventing memory buildup under sustained load.

Internal

  • Fixed buffer overflow in server byte buffer
  • Optimized output color lexer
  • Increased default max memory from 512MB to 1GB

To install Ant v0.3.8

curl -fsSL https://ant.themackabu.com/install | bash

# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.7.1768117368 New feature
Security fixes
  • Fixed segfault when using `@` in fetch module resolution — mitigates crash vulnerability
Notable features
  • Response methods like `c.res.body` can be used directly in `.then()` chains without manual binding
  • Static buffers replaced with dynamic allocations improving stability and large payload handling
Full changelog

Release Notes

Response Methods Work Without .bind()

Response methods like c.res.body can now be passed directly to .then() without losing context:

addRoute(router, 'GET', '/echo', c => {
  c.res.header('X-Ant', 'meow');
  fetch('http://localhost:8000/meow')
    .then(res => res.text())
    .then(c.res.body);
});

Memory Safety Improvements

Static buffers replaced with dynamic allocations throughout the codebase, improving stability and removing fixed-size limitations.

  • Eliminates potential buffer overflow issues
  • Better memory utilization for varying workloads
  • Improved handling of large payloads

Internal

  • Fixed segfault when using @ in fetch module resolution
  • Methods use SLOT_DATA internally to preserve context
  • req.* and property accessors also updated
  • New js_heavy_mkfun() API for creating functions with attached data

To install Ant v0.3.7

curl -fsSL https://ant.themackabu.com/install | bash

# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.6.1768105977 New feature
Notable features
  • ESM import support for HTTP/HTTPS URLs with caching and default/named export handling
  • Improved error messages for missing named exports in import statements
Full changelog

Release Notes

Remote URL Imports

ESM imports now support fetching modules directly from URLs. See examples/demo/remote.js:

import { hello } from 'https://r.justjs.dev/[email protected]';

hello();
  • HTTP/HTTPS URLs work as module specifiers in import statements
  • Remote modules are cached after first fetch
  • Supports both default and named exports from remote sources

Improved Import Error Messages

Named imports now provide clear error messages when exports are missing:

The requested module does not provide an export named 'foo'
  • Better error reporting for missing named exports
  • Proper SyntaxError types for import failures
  • Clearer messaging for non-object module imports

To install Ant v0.3.6

curl -fsSL https://ant.themackabu.com/install | bash

# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash
v0.3.5.1768099770 New feature
Notable features
  • Added readline module (`ant:readline`) with createInterface, event system, line editing, history support, terminal utilities, async iteration, and promises API.
  • ESM imports now support `.txt` and `.json` files; JSON parsing and raw string import.
Full changelog

Release Notes

Readline Module (ant:readline)

Added a full-featured readline module compatible with the Node.js API. See examples/demo/readline.js:

  • createInterface(options) - Create interactive line interfaces with customizable prompt, history, and tab handling
  • Event system - on, once, off, emit, addListener, removeListener for line, close, pause, resume events
  • Line editing - Arrow keys, Home/End, Ctrl+U (clear line), backspace, and cursor positioning
  • History support - Configurable history size with optional duplicate removal
  • Terminal utilities - clearLine(), clearScreenDown(), cursorTo(), moveCursor()
  • Async iteration - Symbol.asyncIterator support for for await...of loops
  • Promises API - readline/promises with async question() method

Text and JSON Imports

ESM imports now support .txt and .json files:

import config from './config.json';
import { name, version } from './package.json';
import readme from './README.txt';
  • JSON files are parsed and support both default and named imports
  • Text files are imported as raw strings

Internal

  • REPL now persists command history to $HOME/.ant/repl_history
  • REPL runs the event loop after evaluating expressions

To install Ant v0.3.5

curl -fsSL https://ant.themackabu.com/install | bash

# or with MbedTLS (darwin only)
curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash

Beta — feedback welcome: [email protected]