Skip to content

Releases

Mini 0.10.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 08:34
3d0f844

Mini 0.10.0 is a language-coverage, performance and size release: 98.3% of the applicable Kotlin box tests now compile and pass natively (5853 of 5953, up from 67.1% at the 0.9.0 baseline), executables are smaller, array-heavy loops are close to Rust, and a round of memory-safety gaps is closed.

Kotlin conformance

The new harness in tools/conformance runs the applicable codegen box tests of JetBrains/kotlin (v2.0.21) through minic. Against the 0.9.0-era toolchain (4008 of 5971, 67.12%) eight rounds of fixes reached 5853 of 5953 (98.3%), with every round checked test by test for regressions. Remaining failures are 63 compile errors, 15 compiler crashes, about 20 runtime failures and a few timeouts (see docs/conformance.md).

Language and library work behind that number: enum bodies and entries, property and builtin references, annotations with arguments, tailrec (including tailrec suspend), unsigned types, value classes (unboxed, generic), Byte/Short boxing and arrays, provideDelegate, adapted callable references, non-local break/continue, CharSequence, suspend inside inline lambdas, coroutineContext, and a much larger standard library (Regex engine, String.format, sequences, Random, Duration, TreeMap, kotlin.test). Coroutines (CPS state machines), sequence, mini.coroutines and native threads are available without libuv.

Memory safety

Strict mode gained inferred borrow summaries, borrowing closure captures, anonymous objects, .mlib summaries, and a corpus of 111 programs. In Managed mode an audit closed these gaps (docs/memory-model.md, "Memory-safety gaps closed"): erased-to-specific conversions are now checked casts (heap pollution throws ClassCastException instead of reading foreign layouts), non-null fields read before initialization throw NullPointerException, huge array allocations and failed allocations are checked, list.addAll(list) terminates, the exception at the end of an uncaught-exception exit no longer leaks, reference-count races between threads are fixed, and local function references no longer escape the Strict checker. A cycle collector and a memory stress suite were added, and the new tests run under AddressSanitizer and LeakSanitizer.

Performance

  • MIR optimizer: inliner, exact-type devirtualization, scalar replacement (escape analysis), internal linkage, unreachable-function pruning, early release of last-use locals.
  • Latin-1 strings, reference-count elision across ArrayList.add, cheaper cycle collection, a HashMap last-key cache, object field reordering to reduce padding.
  • Array length caching and bounds-check loop versioning: in the 4-core test VM fannkuch went from 1.31x to 1.04x of Rust's time and spectralnorm from 1.32x to 1.10x. Plain C division for constant divisors.
  • Persistent stub cache: parsed standard-library stubs are kept between runs, and inline stub bodies are checked lazily. The REPL hands the JIT only the library code an input reaches.

Mini compared with Rust (rustc -O, codegen-units=1), median of 7 runs, same session:

benchmark Rust s Mini s Mini / Rust
fannkuch 2.27 2.35 1.04
spectralnorm 1.29 1.42 1.10
nbody 0.94 1.24 1.31
wordcount 1.25 2.82 2.26

Earlier baseline ratios for the other four benchmarks: binarytrees 0.88, mandelbrot 0.86, strbuild 1.22, json 1.24. Peak RSS is within 15 percent of Rust. The remaining gaps are explained in docs/optimization/rust-gap-2026-11.md (nbody needs escape analysis of object arrays; wordcount needs an unboxed HashMap<K, Int> path).

Executable size

Optimized Linux builds are linked with --gc-sections,--strip-all, programs link the cycle collector and arena only when they use them, and the Unicode tables are encoded compactly (26 KB down to 11 KB).

program 0.9.0-era now Rust, stripped
hello 27 KB 14 576 B 342 520 B
collections 166 984 B 133 520 B 397 544 B
strings 135 128 B 96 656 B 360 448 B

Mini executables are 3-23x smaller than stripped Rust. Set MINIC_KEEP_SYMBOLS=1 (MINI_KEEP_SYMBOLS=1 for mini) to keep the symbol table; --debug builds always keep it. mini build --release now also compiles with function and data sections and no unwind tables.

Other changes

The wasm docs site no longer duplicates library helpers in separate-mlib programs, and CI caches the LLVM 18 development packages. Windows packages keep the 0.9.0 behavior (LLVM API and REPL included).

Installation

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh

Windows x64, in PowerShell 7:

curl.exe -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.ps1 -o install-mini.ps1 && pwsh -File .\install-mini.ps1

Release archives are provided for Linux x64/arm64, macOS arm64 and Windows x64, together with the portable C bootstrap seed and SHA256SUMS.

All changes since v0.9.0

  • Regenerate website internals listings for the current compiler output (1733670)
  • Prepare 0.10.0 release notes (bab82e4)
  • docs: Mini vs Rust gap, November 2026 (a577c2d)
  • Conformance results: 5853/5953 (zero regressions vs main 5852) (5f75a20)
  • Fix conformance regressions: kotlin.test assertFailsWith(KClass, block), discarded erased results unchecked, ::arrayOfNulls type argument, pruned boxed value class casts, unset getter read as safe-call receiver; run.py handles the purity-safe prelude (1acf92c)
  • RangeCheck: no lambdas (0.9.0 stage0 cannot compile closures over locals) (0aa3cd0)
  • MIR opt: bounds-check hoisting by loop versioning; plain division by constants in C; object arrays use the cached length (20b9522)
  • MIR opt: cache array lengths of primitive-array locals indexed in loops (array-len) (dba6a4a)
  • Pruned-class check: external classes count as pruned (C and LLVM); docs: null passes array casts (187456e)
  • mini test prelude: spell kotlin.reflect.KClass via interpolation so check-purity passes (8688789)
  • Conformance 8a: results (5852/5953) and docs (b510a3d)
  • Conformance 8a: regression test (bbb55ec)
  • Conformance 8a: safe-call receiver smart cast in arguments, SAM from function-typed class values, annotation args see enclosing members (5188710)
  • Erased checked casts match JVM checkcast: null passes, nullability is not part of an array's class, generic pass-through unchecked, special bridges, value-class and reference fixes (bd4bb53)
  • Conformance 8a: assertFailsWith(KClass), set operator lambda values, EVALUATED markup (3c5f493)
  • Conformance 7b: results on the tree merged with 7a (5838/5953) (365edbd)
  • Fix merge: unsigned vararg arrays call varargArray with the objType parameter (0145ff1)
  • Conformance 7b: expand fake-override inline members only for reified type parameters; docs and results (aa63570)
  • Reified arrays: empty arrays pass every array cast, CCE names the element types (e6b3859)
  • Lower collection literals in annotation parameter defaults to arrays (25119d8)
  • Conformance 7b: member and extension functions with the same erased signature get distinct symbols (daedffc)
  • Conformance 7a: quoted underscore destructuring entry, results (5808/5953, 97.56%), docs (9693559)
  • Runtime: initialize MkTypeInfo.elem in every static type descriptor (-Wmissing-field-initializers) (67b0d51)
  • Docs: reified object arrays, cost table re-measured against origin/main (37182cf)
  • Reified object arrays: Array records its element type; reads from Array need no check (e325fe8)
  • 7a test fix (3413710)
  • Conformance 7a: vararg parameter defaults are arrays, backticked underscore destructuring, UInt<->Int retype (c3dcfb4)
  • Memory safety: inline checked casts and unboxes, cast elimination, fewer null checks for objects and top-level properties; cost table (2c0c1eb)
  • Conformance 7a: imported inherited object members, unsigned vararg arrays (e350e75)
  • WIP 7a: imported inherited object members, unsigned vararg (untested) (1ae6602)
  • Conformance round 6 combined (6a + 6b): full harness run on the merged tree, 5745/5953 (3adaa4c)
  • Conformance 7b: fake-override inline members, object literal delegates, LowPriorityInOverloadResolution, SAM reference equality (bd8ce32)
  • Conformance 7a: data objects, companion property lookup, enum interface properties, inline members of inner classes, more (635a3c2)
  • Conformance 7a: Number subclasses, annotation instances, suspend function supertypes, do-while scoping, local-class contexts, Unit/Nothing fixes (982b62d)
  • Conformance 7b: non-local finally, special bridges, value-class inner classes, casts, lazy file init, local inner closures (679b5bf)
  • AstCodec: shared empty lists; docs: Linux size measurements (3c7a1d4)
  • Conformance 6b: results, docs (sixth round b) (04e893b)
  • conformance 6a: results (5711/5971, 95.65%), docs (01ce23b)
  • Strict: captures of a function reference to a local function are borrowed like lambda captures (no count taken on a manually freed owner) (e054d0a)
  • Strict checker: a local function used as a value (::helper) is a closure over its captured owners (f074bb9)
  • Threads: record the cycle candidate before dropping the reference; HashMap reads no longer write the lookup cache while threads run (d36aa1c)
  • Smaller executables: strip symbols in optimized Linux builds, compact Unicode tables; stub cache for mini and e2e (296e77c)
  • Persistent stub cache: parsed stdlib stubs kept between runs; ASCII fast path for UTF-8 decoding (3433f7d)
  • Memory safety: checked casts of erased generics, NPE for unset fields, array OOM, addAll(self), uncaught-exception leak (918ca86)
  • conformance 6a: a local function-typed variable shadows member extensions of the same name (8de0e7e)
  • Bound property reference receiver evaluated once in Ir2Mir; suspend reference guard for unresolved types (1c9dd33)
  • index_incdec: the prefix form reads the element again (K2) (7d1a653)
  • For loop over a var array eva...
Read more

Mini 0.9.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 21:01
754e769

Mini 0.9.0 brings the LLVM API compiler and native REPL to experimental Windows x64 packages, and simplifies installation with a standalone PowerShell release installer.

Windows LLVM API and REPL

The Windows ZIP includes statically linked LLVM 18. mini build, mini run and mini test use the LLVM API by default; --backend c selects the C fallback. mini repl keeps declarations and values across inputs without replaying previous cells. No external LLVM SDK is needed to run the packaged compiler. Building native programs still requires Visual Studio's LLVM Clang toolset and Windows SDK.

Native Windows checks cover byte-identical stage 2/3 C, MIR, LLVM IR and object output; Unicode source and output paths; required PE runtime exports; JIT execution; session ownership and rollback; installed API/C backends; and REPL execution. The packaged LLVM license is included alongside Mini's license and notice.

Windows remains experimental. Threads and Windows sanitizer parity are not provided. The documented REPL input/runtime-exception limits and LLVM API debug-symbol limitation remain in effect. The Unix minic shell wrapper is not included in the Windows package; use mini.exe for projects.

Installation

Windows x64, in PowerShell 7:

curl.exe -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.ps1 -o install-mini.ps1 && pwsh -File .\install-mini.ps1

The installer verifies the release ZIP against SHA256SUMS, checks its paths and payload, and installs into a new directory. It refuses to overwrite an existing installation and leaves persistent PATH settings unchanged. The website's main page now shows both Windows and Unix setup commands.

Linux and macOS:

curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh

The C source installer remains available; selecting -Backend llvm-api builds the Windows API compiler and REPL from source. Release archives are provided for Linux x64/arm64, macOS arm64 and Windows x64, together with the portable C bootstrap seed and SHA256SUMS.

All changes since v0.8.0

  • Prepare 0.9.0 release notes and include the Windows LLVM license (893a480)
  • Export built-in exception and array metadata for Windows ORC sessions (5722a57)
  • Keep standalone program CRT separate from the LLVM compiler runtime (cc6d4e7)
  • Validate PowerShell syntax before Windows builds and fix installer interpolation (dd48094)
  • Export the Windows compiler runtime explicitly for ORC symbol lookup (1737f4c)
  • Verify the Windows API source installer and prepare LLVM release packages (97eb266)
  • Smoke the native API driver with its supported check command (90ca6cb)
  • Add a standalone Windows release installer and homepage setup commands (b6ce426)
  • Normalize custom CMake paths for the Windows API bootstrap (99787f8)
  • Export the Mini runtime ABI without compiler-generated COFF constants (15ffc69)
  • Sort Windows API compiler sources as explicit string arrays (36760de)
  • Read the portable seed checksum manifest as text (603713e)
  • Relocate the LLVM SDK DIA GUID library to the active Visual Studio (6e01bbe)
  • Select clang-cl for both CMake probe languages on Windows (02ea852)
  • Use 7-Zip for Windows LLVM SDK extraction with phase diagnostics (ea71336)
  • Exercise installed Windows API default, C fallback and REPL (a092277)
  • Use canonical LLVM target component names in CMake (32f37de)
  • Port API compiler host operations and add Windows LLVM selfhost proof (2334e0d)
  • Harden LLVM prefix acquisition and CMake probe configuration (e1de40c)
  • Add cached Windows LLVM 18 API probe lane (7d8c481)

Mini 0.8.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 15:21
1da8668

Mini 0.8.0 adds experimental native Windows x64 support and includes the measured compiler/runtime improvements developed since 0.7.0.

Windows x64 (experimental)

The Windows package provides mini.exe, minic-native.exe, the runtime and standard-library sources. mini new, build, run, test and check use the C backend. Native Windows tests cover self-compilation with identical stage 2/3 C and MIR, Unicode paths and arguments, subprocess quoting, large captured output, environment/working-directory isolation and compiler failures.

Windows builds require Visual Studio 2022 C++ Build Tools with LLVM Clang and the Windows SDK. Use Developer PowerShell and PowerShell 7. The install page documents the PowerShell source installer, which verifies its bootstrap download and refuses to overwrite an existing prefix.

The Windows ZIP is C-backend only. Windows LLVM API, REPL, native thread support and sanitizer parity are not included. Linux and macOS retain the LLVM API default, bundled LLVM and mini repl; the explicit C fallback remains available.

Compiler and runtime improvements

  • Optimized macOS application links remove unused code, and the packaged macOS compiler drops local symbols while retaining external exports. Debug and bootstrap paths remain separate.
  • The compiler avoids empty substitution maps for non-generic classes.
  • Reviewed runtime changes reduce allocation/RC overhead in reference arrays, ArrayList and StringBuilder. LLVM string access fast paths retain bounds/null checks and fallback behavior.
  • WebAssembly fixtures keep browser-only allocator behavior separate from native compiler checks. Browser programs continue to compile live; only libraries are shipped precompiled.

On the recorded local fixed-input C/MIR self-compilation workload, the combined campaign reduced median wall time by 7.9% and retired instructions by 9.6%, with identical output. These are not complete build/link measurements. The JSON confirmation remained about 1.205 times the fastest tested strict C reference: the broader 1.2x target has not been established. See the repository's optimization reports for methods, tradeoffs and rejected experiments.

Assets and installation

  • Linux x64, Linux arm64 and macOS arm64: LLVM API toolchain .tar.gz archives.
  • Windows x64: experimental C-only .zip archive. Extract it to a new directory and add its bin directory to a Developer PowerShell session's PATH.
  • Portable C bootstrap seed and SHA256SUMS.

Unix installation remains:

curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh

REPL input/runtime-exception limits and the LLVM API debug-symbol limitation documented in 0.7.0 remain in effect.

All changes since v0.7.0

  • Use literal ZIP paths and clarify source install status (2252970)
  • Publish experimental Windows C-only ZIP (7db2290)
  • Prepare Mini 0.8.0 release notes and Windows install guidance (e97bb23)
  • Verify cross-volume Windows installs and report smoke status (f07a2f0)
  • Match Windows host fixture CRT compatibility flags (36837b3)
  • Cover valid long Windows process arguments (1ff41a0)
  • Run Windows host contract checks before compiler bootstrap (139e6f2)
  • Normalize extended Windows paths only at API boundaries (943c290)
  • Harden Windows install and executable linking (961b756)
  • Exercise Windows tool discovery and host processes (ebf244d)
  • Add experimental Windows source installer (218ed26)
  • Add experimental Windows C-only mini staging (314ff1d)
  • Port native mini host and project paths to Windows (0f3f104)
  • Normalize Windows bootstrap source paths (2f29494)
  • Handle Windows source basenames and escape C type metadata (3d15c17)
  • Keep skipped Windows death tests warning-clean (b1d158c)
  • Harden Windows bootstrap setup and work directory handling (11303ad)
  • Add native Windows runtime filesystem support (a0ef329)
  • Extend Windows Unicode and entry tests (f010782)
  • Add initial native Windows CI lane (3bade33)
  • Test Windows entry argument lifetime (7328548)
  • Add Windows UTF-16 process entry (e31e56d)
  • Separate portable type-family checks from native C interop (045c7fe)
  • Record rejected copy initialization and current target status (3293e1f)
  • Record final runtime and compiler suite (2e86f73)
  • Record fresh WASI and installed package validation (8f9fc57)
  • Record fresh integrated fixpoints and strict runtime validation (5e4c296)
  • Avoid null pointer arithmetic in UTF-8 strings (713f0fa)
  • Inline pure type family classifiers (5097406)
  • Record fresh profile and scope next classifier experiment (dbecbc8)
  • Record hot cold JSON candidate profile (806a97e)
  • Preserve evidence for rejected null-slot setter guard (366f3e2)
  • Keep StringBuilder reserve guard on hot path (3a9c8a4)
  • Record rejected StringBuilder inline storage pilot (6f23927)
  • Record builder tradeoffs and reject unsupported cast optimization (36c3e08)
  • Record reviewed type-family integration status (9f7e3b9)
  • Preserve custom instance-check overrides (2070f2d)
  • Add guarded type-family cache fast path (6f9cc8b)
  • Document continued escape analysis and measured runtime progress (5d4b292)
  • Coallocate private reference array storage with its owner (e40d3bb)
  • Clarify runtime-call scope of RC counters (02655e3)
  • Record combined escape optimization JSON baseline (4025625)
  • Record string fast path pilot evidence (ba0129f)
  • Inline string runtime fast paths in LLVM backend (5158886)
  • Record ArrayList capacity pilot evidence (f10fef6)
  • Reduce default ArrayList capacity to four (c223f53)
  • Skip null releases when disposing ref arrays (c1d8f24)
  • Record JSON API profiling and runtime counters (e62fafd)
  • Finalize measured optimization campaign report and validation (8433c38)
  • Record compiler API optimization triad results (1e7a98d)
  • Add isolated local API compiler control (6c63c00)
  • Record integrated compiler campaign measurements (81212ec)
  • docs: record rejected typecheck fast-path pilot (aaa8758)
  • Record fair Mini runtime baseline (ce26ec4)
  • Strip local symbols from macOS release compiler copy (924042d)
  • Record campaign targets and paired compiler pilot (2f38e45)
  • Clear provenance for untracked benchmark artifacts (f1024a5)
  • Repair benchmark runner for current Mini CLI (5aac674)
  • Avoid empty substitution maps for non-generic classes (e319fe5)
  • Record fresh compiler campaign baseline (704890d)
  • Clarify optimization measurement scope (1e2a7b5)
  • Reduce optimized macOS minic executable size (c2fa4e6)

Mini 0.7.0

Choose a tag to compare

@github-actions github-actions released this 31 Oct 19:47
f353826

Mini 0.7.0 makes the LLVM API backend the default for installed native builds, adds a persistent native REPL, and speeds up browser compilation by reusing compiled libraries.

Highlights

  • LLVM API by default. Installed mini build, mini run, mini test, minic build, and minic run use the LLVM API backend. LLVM is linked into the compiler; users do not need a separate LLVM installation. Use --backend=c for the C backend. The portable C bootstrap seed remains available.
  • Persistent native REPL. Run mini repl to define val, var, and fun declarations and evaluate expressions in a reusable ORC JIT session. Earlier inputs are compiled once rather than replayed. Compile errors preserve accepted declarations. The REPL itself does not require a system C compiler.
  • Reusable browser libraries. The playground and notebook compile user code live and reuse compatible compiled standard-library, Plot, and Tensor objects. Libraries load lazily and are cached. No precompiled example programs are shipped; recent successful compilations can be cached locally, subject to storage availability and cache limits. Other optimization settings retain the whole-module fallback.
  • Consistent floating-point rounding. Generated C disables fused contraction to preserve rounding after each Kotlin arithmetic operator, matching the LLVM backend. Both Clang and GNU GCC have regression coverage.

Install

curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh
mini repl

Archives are provided for Linux x64, Linux arm64 and macOS arm64, along with the C bootstrap seed and SHA256SUMS. Native program linking still requires a C compiler and system development libraries. The REPL uses the bundled JIT directly.

Performance

In local warmed Node/YoWASP tests with matching output, reusable library objects reduced Plot compilation from roughly 13–14 seconds to 0.4–0.6 seconds and Tensor compilation from roughly 7 seconds to 0.5–0.8 seconds. These measurements exclude cold toolchain downloads and initialization; results depend on the device and program.

The C backend now disables contraction to preserve per-operator rounding. Outputs matched on the measured Mandelbrot and N-Body workloads; initial measurements showed the LLVM API output about 2% and 6% faster respectively; this is not a guarantee for every program.

Current limits

  • The REPL accepts one complete input per line. Multiline declarations, imports, classes, package declarations, top-level main, and name redefinition are unsupported. Runtime exceptions can terminate the session.
  • With the LLVM API backend, -g selects unoptimized code; use --backend=c -g for native debug symbols.
  • First browser use still downloads and initializes the compiler toolchain. Library reuse primarily reduces compilation after initialization.

All changes since v0.6.0

  • Package the plain compiler as the portable C seed (9fbda08)
  • Preserve exception checks across wasm library objects (9bd3789)
  • Prepare version 0.7.0 release notes (3c43f31)
  • Include zstd license in release archives (c995a7f)
  • Fix API REPL and linker command handling (2442545)
  • Make LLVM API compiler the release default (a5fe58a)
  • Verify strict FP regression with GNU GCC in CI (5af841a)
  • Exclude dependency-owned shared mlib helpers (575c437)
  • Preserve strict floating point rounding in C output (c508471)
  • Keep inherited library dispatch imports external (0429d05)
  • Gate library object fetches on mlib hash (18801d2)
  • Fix WASI calloc ABI and object fetch gating (0d12002)
  • Add reusable wasm objects for preinstalled libraries (405eb0a)
  • Run ORC session API smoke test natively (b49bf11)
  • Split native REPL CI tests into named steps (842ea78)
  • Fix K2 oracle native REPL JVM compatibility (b18faf2)
  • Keep REPL JIT conventions consistent across inputs (8caaa1e)
  • Keep REPL JIT conventions consistent across inputs (3b7f681)
  • Fix native REPL input and cross-module ownership (b23a0e8)
  • Test local compile cache behavior (58b1ab0)
  • Add persistent LLVM ORC native REPL (020d410)
  • Precompile browser standard and bundled libraries (36a30a5)
  • Remove precompiled program artifacts (5ebae8b)

Mini 0.6.0

Choose a tag to compare

@github-actions github-actions released this 31 Oct 09:42
d6f37a2

Mini 0.6.0 adds precompiled libraries, Float32 tensors, plotting and WebAssembly library exports, plus an interactive digit classifier in the browser.

Highlights

  • Precompiled libraries. minic-native --emit-mlib and --lib, dependency builds through .mlib, mini package, and a precompiled standard library in the release archives.
  • Float and FloatArray. Real 32-bit floating-point storage and arithmetic, array accessors, boxing and C interop. mini.tensor uses Float32 tensors with BLAS acceleration where available and a Kotlin fallback.
  • Tensor and autograd library. Broadcasting, matrix multiplication, automatic differentiation, neural-network layers and optimizers. The tensor and plot libraries are available in the browser toolchain.
  • Plotting. mini.plot provides pyplot, Axes and Kotlin DSL APIs, SVG figures, subplots, log scales, tooltips and colormaps. Rich display output appears below notebook and playground cells.
  • WebAssembly libraries. Export supported functions with @WasmExport, build a wasm-lib package with mini build --target wasm32 --lib, and use the generated JavaScript module and TypeScript declarations. See the WebAssembly library guide.
  • Digit classifier notebook. Train and compare matrix and Linear classifiers, inspect three plot APIs, and try the trained models on drawings. The default experiment is precompiled; successful compilations are cached locally so repeated runs avoid loading the compiler toolchain when possible.
  • Native development workflow. Compiler unit tests and end-to-end tests run through Mini without Gradle or a JVM. mini check checks all project source files. Kotlin cross-checks remain available separately.

Install

curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh
mini new hello && cd hello && mini run

Release archives contain mini, minic, the self-hosted compiler, the runtime and the standard library for Linux x64, Linux arm64 and macOS arm64. A portable C bootstrap seed and SHA256SUMS are included. A C compiler is required for native builds; the WebAssembly library target additionally needs a WASI-capable clang and wasm-ld.

Try the digit notebook or read the documentation.

Known gaps

  • Windows releases, coroutines and async IO, reflection and JSON support are still planned.
  • Strict-mode code generation and the standard library's adoption of the ownership memory model remain in progress.
  • The digit experiment downloads a public dataset and needs network access on its first run.

All changes since v0.5.0

  • Show checker readiness and serve built assets in cache browser tests (bf5e30a)
  • Harden compile cache and cover notebook regressions in CI (1fc4c5c)
  • Prepare Mini 0.6.0 release notes and version (49c29a1)
  • Cache and precompile playground examples to shorten notebook startup (a0c93e3)
  • Compare matrix and Linear classifiers in short notebook cells with three plot APIs (fa613a6)
  • Add an interactive digit-training notebook to showcase tensor and plot (2088a6d)
  • wasm-lib: guide page, README section, unit tests, CI step (6ddf241)
  • wasm-lib: end-to-end tests (Node and Chromium), testdata for @WasmExport (48df896)
  • mini: kind wasm-lib, build --target wasm32 --lib, new --template wasm-lib (5a317c5)
  • wasm-lib: @WasmExport, reactor module glue (IR wrappers, runtime helpers, .mjs and .d.ts generator) (efb922a)
  • wasm: run-wasi.mjs avoids Node's fast API call path (GC crash in path_open under TurboFan wasm) (1349314)
  • website: mini.plot page rewritten for the matplotlib-style API, gallery, tensor training curve; check-samples builds libs with alt/ sources (a713202)
  • mini.plot: fill_between keeps the line colour, minimal palette, README (ab9b619)
  • Float: docs, cinterop_boxing expectation, e2e include paths for the interop C library (ddf6581)
  • Unit tests for the API stub writer (c6fd390)
  • mini.plot: matplotlib-style API (plt, Axes, Figure, subplots), modern themes, log scale, tooltips, colormaps (db645e0)
  • Stable names for overloads that differ in type arguments; relative stub paths; docs (6127c6b)
  • mini.tensor: Float32 tensors on FloatArray, sgemm/sgemv/sdot; FloatArray C interop test (d43bfa9)
  • Real Float/FloatArray: MkFloatArray runtime, inlined accessors, boxed Float, floatArrayOf, tests (c8ca3b2)
  • mlib documentation and tests (e7449cb)
  • stdlib.mlib by default; mini builds dependencies to .mlib, mini package (7af60c6)
  • compiler: support ++ and -- on indexed elements (a[i]++, --a[i]) (6fa8cea)
  • Precompiled libraries: minic-native --emit-mlib / --lib (95bb9b9)
  • mini.tensor: examples, benchmark, README, faster Kotlin matmul kernel (17f8f83)
  • mini.tensor: tensors, broadcasting, matmul (BLAS via dlopen with Kotlin fallback), autograd, nn, optim (24b108b)
  • mini.plot README, display protocol spec, e2e for figures in light/dark and mobile (2a1d596)
  • Preinstalled libraries in the browser toolchain (libs.json), Libraries docs section, mini.plot and display pages, CI checks for display bundles (1a3136c)
  • stdlib: kotlin.math floating point functions (sqrt, exp, ln, pow, trig, PI, E, ...) bound to libm (37765e6)
  • mini check checks every source file (bc7b8bc)
  • mini --version shows the toolchain version (5e4f2c9)
  • website: render rich display bundles below cells (notebook, playground, docs cells) (6f69baf)
  • mini.plot: SVG plotting library (line, scatter, bar, histogram, heatmap) with tests (0adbe36)
  • Explain mini and minic installation workflows for the native toolchain (22e4f3d)
  • stdlib: mini.display, the rich output bundle (display protocol) (8797e26)
  • Improve shared Kotlin editor indentation, completion and keyboard tools (3db4236)
  • Keep demo title bar inside the code window frame (d868adc)
  • Expand Learn into a 26-chapter Kotlin and Mini course (7fd347c)
  • Docs, k2-oracle workflow and README, explain generator, workflows without Gradle (4e818d2)
  • Website scripts, benchmarks and release workflow use the native compiler (0bb20c9)
  • wasm scripts use the native compiler (no JVM minic emit-mir, no native-driver) (5d2111b)
  • Native ./minic wrapper, merge fixes, DiagFormatTest on mini test (fa8a94f)
  • tools/k2-oracle: separate Gradle build for the K2 cross-checks; native CI shards (01aad95)
  • Native end-to-end runner for compiler/testdata (scripts/test-e2e.sh) (9d76214)
  • Port native-driver and mini-tool tests to mini test (a74c788)
  • Turn Learn into a guided Kotlin notebook and fix documentation sidebar layout (958d345)
  • Port backend and frontend tests to mini test; class-based tests, mini.io directory API, purity script (e421596)
  • Flat Mini project layout for the compiler, native bootstrap (4e7a003)

Mini 0.5.0

Choose a tag to compare

@github-actions github-actions released this 30 Oct 10:35
0a233cd

Mini 0.5.0: the whole toolchain is native. mini, minic and the compiler need no JVM, and the compiler compiles itself through C and LLVM.

Install:

curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh
mini new hello && cd hello && mini run

Try it in the browser: https://henryschwerdt.github.io/mini/ (every example in the docs has a Run button).

Highlights

Native project tool mini.

  • mini new, build, run, test, check, add, tree, explain, doctor.
  • mini.toml with path and git dependencies.
  • Compiled by Mini itself: about 1 ms to start and ships in the release archive. No JDK, no Gradle.

minic with good diagnostics.

  • Errors read like rustc: file:line:col, the source line with an underline, and a summary line. Memory-model errors link to their documentation page.
  • --error-format=json, --color, --error-limit.
  • New commands: minic run file.kt -- args, minic check file.kt, --help for every command, and "did you mean" for typos.
  • Clear exit codes: 0 ok, 1 compile error, 2 usage, 3 internal compiler error.
  • A missing C compiler is explained. Generated C is never shown as a raw C error.
  • -O2 is the default. minic build -g emits #line directives, so gdb and crash reports show your .kt lines.

LLVM backend.

  • MIR to LLVM IR, as text or in memory through the LLVM C API bound in Mini (minic-native --backend=llvm|llvm-api).
  • minic-native --run runs programs with the ORC JIT.
  • Now as fast as the C backend, or faster on numeric code: TBAA, the initial-exec TLS model, and no exception test on the fast path of array accesses.

C interop. external + @CName, CPointer/*Var, memScoped, @CStruct, staticCFunction, @file:CInclude/@file:CLink, and @Owned(free=) for C-allocated memory.

Performance.

  • A thread-local size-class allocator for small objects and faster arenas: 30–48% faster on allocation-heavy code.
  • Inline array accessors, array reads without reference counting where that is safe, and fast integer formatting.
  • Against C at -O2: nbody 0.94–1.03x, mandelbrot ~1.0x, fannkuch 0.9–1.2x, binarytrees ~1.2x, spectralnorm ~1.2x.
  • Cross-language results (C, Rust, Go, JVM, Kotlin/Native): https://henryschwerdt.github.io/mini/benchmarks

Language.

  • The overloadable matrix operator a @ b (operator fun matmul, @=). It is built for tensor libraries, and nothing implements it by default.
  • Operators with context parameters now work.
  • More Kotlin parsed exactly like K2.

In the browser.

  • minic compiled to WebAssembly, together with clang and wasm-ld.
  • A playground, notebooks, and Run/Check buttons on every documentation example.
  • A notebook-style tutorial: https://henryschwerdt.github.io/mini/learn/

What is in the release

  • mini-0.5.0-<target>.tar.gz for linux-x64, linux-arm64 and macos-arm64:
    • bin/mini: the project tool
    • bin/minic: the driver, with run, build, check, emit-c
    • bin/minic-native: the self-hosted compiler
    • lib/libminirt.a and include/: the runtime
    • stdlib/: the standard library sources
  • mini-0.5.0-bootstrap-c.tar.gz: the generated C of the compiler plus the runtime sources. A C compiler alone builds a working compiler from it.
  • SHA256SUMS.

Known gaps

  • A C compiler (clang or gcc) is still needed at build time.
  • No Windows. No coroutines or async IO. No reflection or JSON yet; JSON will be a separate library, mini-serialization.
  • Programs that use allocator objects (mini.memory) do not build on every path yet. The memory checker covers them everywhere.
  • mini check on projects that are not in Strict mode only checks the first file.
  • The repository's own test suite still runs on Gradle/JVM. Moving it to mini test is in progress.

All changes since v0.4.0

  • Release notes for v0.5.0; the release workflow uses docs/releases/.md (1115b59)
  • bootstrap.sh: read the native memory-check diagnostics from stderr (38967ed)
  • wasm playground: parse position-less 'error: ...' lines of minic (ICE, usage), ignore the summary line (5cdb7a5)
  • mini-tool: drop minic-native's own summary lines, keep position-less errors in --message-format=json (deefc54)
  • minic CLI: run/check, help, did-you-mean, -O2 default, C compiler discovery, ICE reporting (263c011)
  • minic-native: rustc-style diagnostics, JSON output, exit codes, #line directives (9bd89a7)
  • parser: accept the variance keyword in as a value-parameter modifier, like K2 (d553302)
  • docs: environment variables of the native mini (MINI_ROOT layout, MINIC_NATIVE, MINI_STAGE0) (13a1a33)
  • website: bring the roadmap page up to date (b846503)
  • website: document cells and preload in the playground README (bfa999d)
  • website: landing page and mobile fixes, install sidebar, tutorial wording (404418b)
  • LLVM backend: initial-exec TLS for the pending slot, TBAA tags, no pending test after inline array accesses (a5151a8)
  • website: interactive tutorial, runnable cells everywhere, install and CLI docs, new landing page (ecbed91)
  • docs: the native mini tool, no Gradle for users (448e1ea)
  • Ship the native mini: wrapper, release archives, install.sh, CI smoke test (535bf59)
  • website: MiniCell component, markdown plugin for runnable fences, toolchain preload (WIP) (6cac662)
  • mini-tool: native Platform and a native build driven by minic-native (ba9ac10)
  • Add the overloadable matrix operator @ (a @ b is a.matmul(b), a @= b) (b2a5d83)
  • docs: quick wins section with before/after measurements (73d150e)
  • Fast int to string without snprintf; StringBuilder.append(Int/Long) without a temporary (ad5abd6)
  • plan: serialization and the web framework are separate libraries, not stdlib (fe3ea2b)
  • RcOpt: borrow array element reads that define a validated borrower (92e62c9)
  • Inline array accessors in the runtime header and in the LLVM lowering (ffc1d8b)
  • website: cross-language baseline and profile summary on the benchmarks page (437f188)
  • docs: cross-language baseline and where the time goes (benchmarks.md) (1cd9bf8)
  • bench: add full baseline run (old runtime, 4-core VM) (9cd4482)
  • docs: tighten allocator numbers wording (0b05641)
  • docs: allocator section in benchmarks.md, implementation notes in memory-model.md and runtime README (56d3cfc)
  • runtime: O(1) batch hand-off in the small-object allocator, inline arena fast path, arena chunk cache (9a1f9bb)
  • bench: cross-language benchmark suite (programs, runner, CI workflow) (e65efa9)
  • runtime: thread-local size-class allocator for Rc/Heap, faster arena bump path (0291bc0)
  • wasm: fast minic.wasm build with the host clang, browser e2e test, pages.yml wiring (707b311)
  • wasm: module worker for the playground (MiniToolchain contract), site layout, protocol test (a5bef7b)
  • wasm: minic.wasm (the compiler as a WASI module), toolchain bundle script and CI workflow, docs (1db7604)
  • wasm: libminirt and all test programs for wasm32-wasip1 with the prebuilt YoWASP clang (b8cca6b)
  • CI: install LLVM 18 dev for the llvm shard and run LlvmApiEndToEndTest there; selfcompare baseline 82 -> 43 (72a54fb)
  • ORC JIT (minic-native --run), mk_pending_slot accessor, bootstrap.sh --backend=llvm-api, LlvmApiEndToEndTest, docs (bfac13e)
  • LLVM C API bound in Mini (compiler/llvm-c) and the in-memory LLVM backend: minic-native --backend=llvm-api (1859221)
  • LLVM backend: lowering written once against an IrBuilder interface, text builder keeps the .ll output (8daa5b7)
  • website: regenerate the counter MIR listing (own frontend output) (4508f59)
  • C backend: extern asm labels carry the platform user label prefix (macOS linking) (a0866da)
  • own frontend: T::class for type parameters; reified class-literal testdata (fd10ead)
  • Pages: run the playground unit tests and typecheck (deb92fc)
  • website: playground and notebook front end (CodeMirror editor, runner, share links, .minb, Open in playground) (df62845)
  • website: toolchain interface, WASI shim, runner worker, notebook model, with node tests (4e79c62)
  • LowerPurityTest: ignore string literals (package names like "java." are data, not API use) (1881c85)
  • own frontend: Byte/Short comparisons and equality widen to Int like K2 (01c497e)
  • website: cinterop sample output matches the trailing space (24047e1)
  • interop: keep selfcompare baseline (no negative literals in interop layout code) (73da3b4)
  • C interop: docs (guide page, README, plan status, memory model), test exclusions (6b3eb71)
  • C interop: memory checker for memScoped/nativeHeap/@owned(free) on both frontends, rebase onto the checker port (09d39d2)
  • C interop: MIR pointers/Byte/Short/Float, externs, loads/stores, callbacks, kotlinx.cinterop stdlib, both frontends, K2 memory-checker support, tests (WIP) (4791dd6)
  • selfcompare: baseline 41 -> 82 (K2-fidelity differences in the new LLVM emitter code), and run it in CI (090c6ba)
  • selfcompare.py: K2 side is --frontend=k2 now that the own frontend is the default (1472a70)
  • own frontend: backtick-quoted names only for identifiers (sema parse), not string text (c9db733)
  • own frontend: backtick identifiers without quotes, no smart cast to Nothing, frontend errors printed like K2's; docs (474e124)
  • minic: own frontend is the default (--frontend=k2 selects K2); bootstrap smoke test of native --check (9236e01)
  • memory checker: native --check mode and build gate in minic-native, MiniMemoryCheckTest (corpus parity with K2, all user files) (d05153a)
  • memory checker on the own frontend: MemoryFacts port (lower), offsets in Ast2Ir, qualified annotation names, minic check --frontend=mini, all user files checked (bd31041)
  • CI: actually schedule the llvm shard (the shard list is built with fromJSON) (6fb0912)
  • CI: LLVM end-to-end tests in their own shard (557e462)
  • LLVM backend (phase 1 of 10g) on top of D2: MIR to textual LLVM IR with the Strict paths, --backend=llvm, bootstrap --backend=llvm, tests, bench, docs (c8fcdf3)

Mini 0.4.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 20:27
e930515

First prebuilt release of Mini: Kotlin compiled to native code (Kotlin to C17 to a native binary), with a memory model the compiler can check.

What it is

  • The compiler is self-hosted: minic-native (own parser, type checker, lowering and C backend, written in Kotlin) compiles itself, and stage 2 and stage 3 of the bootstrap are byte-identical. No JDK is needed to use it.
  • Memory model: reference counting by default (with RC elision), allocators as context parameters (Arena, Heap, Pool), and opt-in Strict mode (@file:MemoryMode(Mode.Strict)) where leaks, double frees and use-after-free are compile errors.
  • Kotlin 1:1: classes, sealed/data/enum/object, interfaces, generics, lambdas, inline/reified, exceptions, extensions, ranges, collections and large parts of the stdlib. The stdlib is Kotlin source and ships in the tarball.

What is in the release

  • mini-<version>-<target>.tar.gz for linux-x64, linux-arm64 and macos-arm64: bin/minic (minic build foo.kt -o foo), bin/minic-native, lib/libminirt.a, include/, stdlib/.
  • mini-<version>-bootstrap-c.tar.gz: the generated C of the compiler plus the runtime sources; a C compiler alone builds a working compiler from it.
  • SHA256SUMS. Install with curl -fsSL https://raw.githubusercontent.com/HenrySchwerdt/mini/main/install.sh | sh.

Known gaps

  • A C compiler (clang or gcc) is still needed at build time; minic is a thin wrapper around minic-native and cc.
  • The Strict-mode checker and the mini project tool run on the JVM and are not part of the native release yet.
  • No Windows, no coroutines or async IO, no reflection or JSON yet. Strict-mode codegen and the stdlib on the memory model are in progress.