Skip to content

Mimic 0.4.0-preview.1

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Nov 22:38
· 205 commits to main since this release
8bb19a1

A preview of the next version: not a stable release. Install it with mimic upgrade --preview.

Stage 0.4.0, the measuring stick, so far (0.4.0-preview.1): a benchmark corpus of everyday algorithms, each in Mimic, C and Rust; the machine's limits; and a speed gate that fails CI on a slowdown. The corpus already found two bugs and the gaps the rest of stage 0.4 closes.

Changed

  • Benchmarks against C and Rust only: the Go versions are gone, from the suite and from the tables in BENCHMARK.md and on the website. The http benchmark's load generator is now a Rust program (bench/http/load/main.rs).

Added

  • The speed gate: bench/run.py --gate BEFORE builds every benchmark with the changed compiler and with the one it changes, times them in turns on the same machine, and fails on a slowdown beyond that benchmark's tolerance (twice its noise measured on GitHub's machines, 3–25%, from bench/noise/) in 2 of 3 measurements. The bench workflow runs it on release pull requests, nightly on dev, and on pull requests that change what is measured, and checks each time that the compiler without its optimizer (MIMIC_DEBUG_DISABLE=optimizer) fails it.
  • The 0.4.0 corpus, hashing: crc32, adler32, fnv1a, murmur3, xxhash32 and sha256 benchmarks in Mimic, C and Rust, checked against independent references. They show sequential passes over arrays 13–57× slower than C and SHA-256 170× (docs/gaps.md, with the 0.4 steps that fix them), and that Mimic has no fold.
  • The 0.4.0 corpus, parsing: csv, expr, tokenize, url and http_parse, checked against Python's csv, eval, re and urllib. Parsing that splits into independent pieces runs in parallel and is at or near C's time on all cores (csv 0.90×, expr 0.95×); scanning characters one at a time is 25× C on one core (docs/gaps.md).
  • The 0.4.0 corpus, compression: rle, base64 and lz77, checked against Python (base64, and reference implementations). They show where growing a list in a loop copies it: the LZ77 decoder is 476× C (docs/gaps.md). rle found flatten quadratic (fixed above). huffman and bwt follow: huffman showed a settle step written as a lambda copying its state where a named step function changes it in place (37 s against 2.1 s).
  • The share of the machine: bench/machine/ measures the peak floating-point rate and the memory bandwidth, on one core and on all, and benchmarks that declare their work (meta.json: matmul, mandelbrot, prefix_sum so far) also show what share of that limit each version reached (bench/run.py --machine measures again).
  • bench/run.py --json writes a run's times as JSON, and --noise N runs everything N times unchanged and records how much each ratio to C varies on the machine (bench/noise/<platform>.json; the bench workflow's noise input runs it on GitHub's machines). It is the first part of 0.4.0: the speed gate's tolerances come from this measured noise.

Fixed

  • No release without its files: a release is now published only after its binaries and checksums are uploaded. Before, for a moment a new release could be the latest with nothing to download, and the install command failed with "Not Found" (the install scripts' check on the 0.3.18 release did). That check now runs when the release workflow finishes; it never ran on a release before.
  • Builds at the same time no longer spoil the runtime: files Mimic writes "atomically" (through a temporary file) used a temporary name per process, so two threads of one build writing the same runtime file shared it and could interleave their bytes; CI saw redefinition of 'MIM_UI_JS' once. Every write now has a temporary name of its own, the runtime's object file too.
  • flatten is linear: it joined the lists two at a time, copying the growing result again for every list, so flattening many small lists was quadratic (200,000 pairs: about a minute; now milliseconds). Each element is now placed once, in parallel. The same in the ui module. Found by the 0.4.0 benchmark corpus.

Install

Download the file for your system below and unpack it. Then run the install script inside: it copies mimic to ~/.mimic/bin, puts that folder on your PATH, and checks what your system needs.

System File Install Also needed
Windows x86_64 (10, 11) mimic-0.4.0-preview.1-windows-x86_64.zip Double-click install.cmd Nothing: Windows programs are linked with the MinGW-w64 inside mimic.
macOS Apple silicon mimic-0.4.0-preview.1-macos-arm64.tar.gz ./install.sh The Xcode Command Line Tools (xcode-select --install), for the macOS SDK.
Linux x86_64 mimic-0.4.0-preview.1-linux-x86_64.tar.gz ./install.sh glibc 2.28 or newer (Ubuntu 20.04, Debian 10, RHEL 8 or later) and a C compiler (cc) to link native programs. --target x86_64-linux needs nothing else.

On Windows, if double-clicking install.cmd does nothing (some company PCs block scripts), open PowerShell in the unpacked folder and run:

powershell -NoProfile -ExecutionPolicy Bypass -File ".\install.ps1"

The script says if something is missing and how to install it. Open a new terminal afterwards so the new PATH applies.

Upgrading from an earlier Mimic: run the new install script the same way. It replaces the old mimic, clears the build cache the old version left in ~/.mimic/cache (it is rebuilt on first use), and keeps your projects and installed libraries. If another mimic comes first on your PATH, it says where, and offers to remove it.

  • macOS: the script clears the download quarantine. If you copy mimic by hand instead, run xattr -d com.apple.quarantine mimic once.
  • Windows: the script unblocks the downloaded files. SmartScreen may still ask the first time: "More info" → "Run anyway".
  • Uninstall: ./install.sh --uninstall, or install.cmd -Uninstall on Windows. Your projects are not touched.

First program

mimic create hello
cd hello
mimic run

mimic --help lists every command. SHA256SUMS has the checksum of each file.