All notable changes to the MiniLang compiler are documented here.
- Added explicit integer floor division with the
divkeyword and exact or deliberately rounded integer conversions instd.math. - Normal arrays now accept
voidas an element (including clearing an occupied slot), while byte buffers remain strict. Added safestd.arrayaccessors with Option, fallback, conditional-write, and detailed-error forms. - Added compile-time diagnostics for provably non-integer indices, constant out-of-bounds access, and missing members on statically known struct values.
- Added struct field defaults for positional and named constructor calls.
- Lowered statically string-starting left concatenation chains iteratively, avoiding expression-temp exhaustion and repeated dynamic add dispatch.
- Added cross-compiler positive, negative, GC, and runtime regression coverage.
- Added cross-platform ECDSA P-256/SHA-256 signature verification through Windows CNG and OpenSSL 3, with fixed-width raw public keys/signatures and Windows/Linux regression coverage.
- Fixed the Python emitter's native C-string return conversion after the copy helper clobbers its volatile length register, preventing GTK text-return crashes.
- Added matching Unicode, empty and null C-string return regressions in both compiler repositories. The self-hosted conversion already preserved the length.
- Advanced both compiler versions together and documented MiniGui integration.
- Reduced generated x64 code size with accumulator-immediate opcodes, implicit-one shifts, flag-equivalent narrow AND masks, and conservative fallthrough branch-pair folding in both compiler implementations.
- Added independent opcode/boundary regressions, direct native result/flag comparisons, relocation-chunk/page-boundary checks, and a reproducible alternating A/B size/runtime benchmark. No executable packing is involved.
- Fixed self-hosted MLO escape analysis losing variadic-array lifetime facts when emitted function bodies were released. A cross-batch regression now checks escaped arrays after their caller returns and garbage collection runs.
- Refreshed the self-hosted Linux syscall/pthread blob to the same compact
encoding and added
scripts/check_linux_runtime_blob.pyto verify its bytes, labels and external relocation offsets against the Python emitter.
- Added exact, statically resolved struct operator overloads for arithmetic, comparison, bitwise and unary operators, including inline declarations, overload sets and deterministic ambiguity diagnostics.
- Added variable compound assignments and unary numeric
+, updatedmlfmt, and covered positive, invalid, ambiguous, Windows and Linux operator cases. - Added the cross-platform
std.testunit-test runtime with suites, lifecycle fixtures, assertions, filtering, deterministic repetition, bounded timeouts, and console, JSON, and JUnit reporting. - Added the self-hosted
mltestdeclaration-tag discovery generator plus Windows/Linux launch scripts and end-to-end regression coverage. - Updated
mlfmtfor the complete modern MiniLang syntax, preserving atomic lambda/optional/variadic tokens and correctly indenting interfaces, match cases, prefixed functions, synchronized blocks and both loop forms. - Made recursive formatting native on Windows and Linux with directory-link cycle protection, and added golden, semantic, idempotence and target tests.
- Added meaningful docstrings for every public module-level Python declaration and a source-policy regression that prevents undocumented public APIs.
- Replaced placeholder standard-library comments with module-specific English descriptions and made checked-in MiniDoc output timestamp-free.
- Synchronized the release contract with the optimized self-hosted compiler, whose MiniDoc-guided fixed-point profile removed redundant lexical-frame fallback scans and cached stable package-suffix resolution without changing generated Windows or Linux program bytes.
- Hardened the shared Windows networking regression so candidate sockets stay below the dynamic ephemeral range. This avoids false failures on hosts where virtualization reserves long consecutive port ranges.
- Revalidated the complete Python suite, cross-compiler Windows/Linux output, strict MiniDoc documentation and the 1.2.2 version/predefined-value contract.
-
Added explicit
///declaration-comment handling to the reference parser, documented the shared standard library in English, and added a strict MiniDoc configuration plus generated HTML and Markdown API references. Documentation comments remain compile-time-only and do not enter the AST or affect generated target bytes. -
Made native millisecond timeouts portable and explicit:
threadSleepandThread.Join(timeout)now reject non-integers, negatives and values above2147483647; synchronization, socket, time and thread-pool wrappers enforce the same boundary without 32-bit truncation. Linux semaphore releases now validate the native count atomically under a release guard, eliminating a stale-bookkeeping handoff race. -
Made lazy Linux extern resolution an atomic one-owner transition, cached failed lookups and closed handles after missing-symbol failures. Concurrent first calls no longer repeat
dlopen/dlsymwork or leak loader references. -
Validated every public TCP/UDP port before 16-bit encoding and made Windows TCP listeners and ordinary UDP binds exclusive by default; explicit UDP
setReuseAddress(true)now clears the conflicting Winsock exclusivity option. Serialized process-wide socket initialization/cleanup and added boundary, duplicate-bind, explicit-reuse and concurrent-initialization regressions. -
Made
Thread.Startan atomic one-shot transition, preventing concurrent callers from launching the same thread object twice or overwriting its argument/handle state.SetLogicalIdis atomic against that transition,Stopowns the publicly alive startup window, concurrent LinuxJoincalls share onepthread_join, and atomic handle references makeJoinsafe against a concurrentClose. Blocking cleanup is published as native to the GC and cannot release roots or handles before every waiter and worker has exited. -
Packed stable thread control records into synchronized 64-KiB arenas instead of allocating one OS page per
Thread. A 50,000-object stress case reduced Windows working set from about 202 MiB to about 17 MiB without changing the process-lifetime identity contract. -
Fixed native
out doubleparameters to pass their address in an integer ABI register, reject aliases that give one library/symbol incompatible native ABI classes, and preserve exact Linux library spelling consistently. Missing Linux libraries/symbols remain catchable managed errors. -
Fixed the x64 PUSH/POP peephole so it only cancels truly adjacent operations; an intervening instruction ending in a PUSH-like byte can no longer be deleted. Also fixed Python async-variadic lowering, lambda expressions in default arguments, and interface declarations in imported modules and namespaces.
-
Hardened Linux output: float formatting propagates rounding into the integer part,
writeAllTextretries partial writes, and source externs resolve through their declared library'sdlopenhandle so equal symbol names in different shared libraries remain distinct. -
Corrected
std.fs.Sleepto declare the native function'svoidreturn and integrated Linux loader identity, scalar-out and ABI-conflict regressions into the standard test commands. -
Distinguished actual conversion failures from pooled user strings whose text is
"void"or"<unsupported>", so those literals concatenate normally while realvoidoperands still raise error 1303.
- Added gradual runtime type annotations and optional values, expression
lambdas, default/named/variadic calls, value/range
match, eager and lazy pull iterators withyield, structural interfaces, and pooledasync/await/select. Type contracts now feed representation flow; small typed expression functions/lambdas are considered for bounded automatic inlining; proven non-escaping variadic tails use immutable stack views; and proven primitive returns elide redundant contract checks while async calls share a four-worker pool. The positive/negative and performance fixtures remain byte-identical with the self-hosted compiler on Windows and Linux x64. - Added Windows/Linux x64 target parity, native Linux self-hosting, typed conditional compilation, cross-platform TLS/system services and a matching standard library surface on both operating systems.
- Added structured concurrency with tasks, futures, cooperative cancellation,
bounded channels,
async/await/selectand fine-grainedsynchronized(lock)cleanup semantics. - Added thread-local allocation buffers and hardened cooperative GC safepoints, Linux pthread behavior, project caching, host process boundaries and compiler thread-pool shutdown.
- Kept the reference compiler byte-identical with the self-hosted compiler's
canonical streamed
.mlopipeline, compact internal representations, phase-local graph release, reused analysis state and native bulk copies for both Windows PE and Linux ELF output. - Added matching regression coverage for resumed assembler emission and unresolved patch application after materialization in the self-hosted assembler.
- Bounded variable-size GC scans to their candidate heap blocks. This prevents conservative interior pointers whose payload resembles arrays or closure environments from causing out-of-bounds reads; the regression is exercised on Windows and Linux and restores native Linux self-hosting stability.
- Added the shallow native
copyArrayprimitive and synchronized its runtime emission with the self-hosted backend. The sibling compiler now uses it for exact one-allocation chunk materialization; controlled self-build private peak fell by about 65 MiB (3.58%) while Python and self-hosted outputs remain byte-identical. - Revalidated target parity after the sibling self-hosted compiler compacted
its internal
FastMapslot generations into byte buffers and raised their occupancy limit from 70% to 80%. The self-build private peak fell by 120.3 MiB (6.19%) and object-emission time by 2.68%; Python Stage 1 and self-hosted Stages 2/3 are byte-identical 60,690,432-byte images. - Coalesced a retired TLAB tail with the still-adjacent central free-list head in O(1). This avoids retaining two neighboring fragments until the next full sweep without adding a list scan to the allocation path. A controlled self-build improved from 105.781 to 103.573 seconds with an unchanged 2,279 MiB process-tree private peak. Python Stage 1 and self-hosted Stage 2 are byte-identical at 60,690,944 bytes; the threaded allocation/GC fixture is also byte-identical and verifies the new retirement path in both suites.
- Revalidated target parity after the sibling self-hosted compiler began reusing capacity-backed worklists and epoch-cleared maps across serial per-function analysis. The optimization changes compiler allocation traffic only; controlled MiniQuake and optimizer outputs remain byte-identical.
- Added a Windows/Linux heap-shrink runtime regression and synchronized the self-hosted backend's post-GC decommit block and default 4 MiB threshold with this reference implementation. Python-built and self-hosted Stage 2/3 compiler images now have the same size and SHA-256.
- Revalidated target parity after the sibling self-hosted compiler began reusing one materialized semantic state across its serial function-object batches. The change is internal to self-hosted compiler throughput and does not alter Python code generation or MLO v2. All 297 fixed-point compiler objects, all 497 MiniQuake objects and their final executables remain byte-identical to the clone-per-batch baseline.
- Revalidated target parity after the self-hosted MLO writer stopped flattening its complete local-patch set before folding. The optimization is internal to the sibling compiler and leaves the MLO v2 wire format and this Python implementation unchanged. Windows optimizer, Linux static and Linux FFI outputs remain byte-identical across Python, self-hosted monolithic and self-hosted object builds.
- Revalidated target parity after the self-hosted MLO v2 writer began folding
same-fragment
rel32/rip32fields directly into materialized text. Its reader remains compatible with v1 and earlier numeric-target v2 caches; the Python compiler continues to emit the equivalent canonical monolithic image. Representative Windows and Linux outputs remain byte-identical. - Documented and revalidated compatibility with the self-hosted compiler's
backward-readable MLO v2 pipeline. The Python compiler continues to emit its
canonical monolithic image when
--object-pipelineis accepted for CLI and manifest parity. Representative Windows and Linux outputs remain byte-identical to the self-hosted MLO-v2 results. - Added fine-grained
synchronized(lock)blocks with exactly-once lock evaluation and guaranteed release on normal, return and propagated-error exits, while retaining synchronized variables/functions unchanged. - Added cross-platform futures/tasks, cooperative cancellation tokens,
whenAll/whenAnycompletion helpers and bounded MPMC channels with backpressure, timeouts, close/drain semantics and validvoidmessages. - Added a native Linux self-host script and completed canonical
.mlolinking for ELF. Large links now stream sections, labels and relocations by object; dynamic-import ordering preserves byte identity with monolithic ELF output. - Fixed self-hosted array-stack truncation that incorrectly called the
bytes-only
slice()builtin. Parent-path normalization, assembler patch rollback and namespaced enum type-query optimization now retain array values; the Linux self-build also verifies project-manifest path handling. - Aligned package-qualified enum-variant resolution in the Python compiler with the self-hosted compiler while preserving local shadowing, restoring exact target bytes for the complete language acceptance suite.
- Added
--target windows-x64|linux-x64and manifesttargetselection. The new deterministic ELF64 backend includes the managed runtime, global GC heap, TLABs, native Linux threads/synchronization and glibc-compatible.soFFI. - Made the complete public standard library usable on Windows and Linux: filesystem, IPv4 TCP/UDP, monotonic/calendar time, locks/semaphores/events and shared-value storage use native platform adapters, while cryptography selects Windows CNG or Linux OpenSSL 3 behind the same API.
- Added target-neutral platform, path, process and console modules; durable
positional file I/O with advisory locks and atomic replacement; explicit
socket options and listener addresses; UUID v4; PBKDF2-SHA-256/SHA-384; and a
provider-neutral TLS stream contract. Linux builds now diagnose unguarded
Windows
.dllimports during validation. - Completed
std.tlswith native Schannel and OpenSSL 3 client/server providers, system or explicit trust, DNS-name verification, SHA-256 leaf pinning, TLS 1.2/1.3 minimums, server identities and clean shutdown. Added real cross-target handshake tests and fixed the Linux null-addressacceptFFI signature exposed by TLS listeners. - Hardened Linux servers by ignoring
SIGPIPE, made nonblocking OpenSSL reads report retryable readiness, and made exact leaf-pin validation independent of a machine CA store while retaining hostname, validity-period and TLS server-purpose checks. - Replaced raw
clone(2)workers withpthread_create/pthread_joinso every Linux thread owns valid glibc TLS for malloc, pthread synchronization and native providers. The SysV bridge now preserves MiniLang's nonvolatile XMM contract, process termination usesexit_group, and Linux thread-pool/GC regressions run as part of the target gate. - Kept extern lookup package-qualified when user functions share a native symbol's basename, and synchronized the conservative small-loop unroll complexity budget across both compilers. This prevents TLS-heavy Windows code bloat while preserving byte-identical Python/self-host targets.
- Made committed-heap growth precede the one emergency full collection at the
reserved ceiling, so normal heap expansion does not bypass
--gc-limitor repeatedly scan large retained object graphs. - Fixed
--gc-limitand--no-gc-periodicso generated runtime pressure counters receive the requested values in both compilers, including the unboxed signed-64-bit disable sentinel used by the self-hosted backend. - Fixed inactive empty lines shifting source/debug locations in the self-hosted conditional preprocessor, and removed quadratic label-array copying from the self-hosted ELF linker for large, FFI-heavy Linux programs.
- Removed the remaining large-program relocation bottleneck in the self-hosted
compiler. Very large monolithic builds now resolve text labels directly and
materialize only section/IAT overrides, codegen assemblers omit unused full
call histories while retaining helper discovery, and the
.mlolinker preallocates its object-patch index. These changes preserve target bytes. - Added real Windows threads over a process-wide, thread-safe managed heap, per-thread stacks, cooperative stop-the-world GC and synchronization.
- Added 64 KiB thread-local allocation buffers for lock-free small-object allocation in threaded programs while preserving the single global heap.
- Fixed a rare high-CPU safepoint livelock under back-to-back collections by atomically republishing resumed workers as parked for the next GC request.
- Added thread arguments, logical thread IDs, status inspection, worker pools, locks, semaphores and thread-safe list, hash map and shared-value modules.
- Added
defer, native FFI output parameters and project manifests with content-validated incremental builds. - Added typed, nested conditional compilation with
#option,#const,#if/#elif/#else/#endif,#error, CLI-Doverrides and manifest[defines], while preserving Python/self-host target-byte parity. - Added CPU feature detection, native byte-search primitives, CRC-32, hardware-dispatched CRC-32C and platform-native cryptography helpers.
- Improved generated-code optimization with known-struct method
devirtualization/inlining, hot primitive XMM register homes and constant
integer strength reduction; also improved global/object initialization and
the memory-bounded self-hosted
.mlopipeline while preserving cross-compiler target-byte parity. - Added guarded type-flow specialization for fallible
bytes(...)results and 16-byte user-function alignment. This restores compact byte-processing hot paths without weakening runtime errors and prevents local size wins from shifting later functions onto unstable instruction-cache boundaries. - Replaced the self-hosted type-flow pass's repeated whole-function fixed-point scans with indexed facts and a dependency worklist, keeping compiler-sized source builds bounded while preserving emitted target bytes.
- Made package-qualified enum constants available to integer-flow analysis and replaced repeated self-hosted candidate-membership scans with indexed, monotone validation. This restores Python/self-host target parity without slowing large generated programs.
- Expanded cross-compiler, runtime, standard-library, fixed-point and large application regression coverage.
- First stable, source-only release of the Python reference compiler and the self-hosted MiniLang compiler.