MIMIC
A programming language Ā· 0.4.3

MIMIC

Everything that can run in parallel will run in parallel.

Mimic is an array-based, memory-safe, compiled language. Write what you want computed, over whole arrays; Mimic turns it into one fast pass over your data and runs it on every core, with SIMD and the GPU where it helps. No annotations.

$curl -fsSL https://mimic.codes/install.sh | sh
The Mimic octopus
What Mimic is

Say what to compute. Mimic decides how to run it.

Arrays first

Whole-array operations replace loops. Every glyph has a word (ā³ is iota, ĀØ is each), and you can mix them.

Parallel by default

No annotations, no threads to manage. Your steps become one fast pass over the data, spread over every core, with SIMD and the GPU where it helps.

Memory safe

Immutable unless marked mut. Reference counts and updates in place: no garbage collector, no use after free.

Compiled, everywhere

LLVM to native code. One binary holds the compiler, Clang and a linker to build for macOS, Linux and Windows.

Glyphs or words

One program, two spellings

Glyphs are short and read like mathematics; words read like any other language. Both are the same Mimic. Type glyphs with digraphs (\i is ā³) or let your editor complete them.

main.mim
module main

// the sum of the squares of the even numbers
// below a million: one fused loop, on every
// core, with SIMD
fn main() {
    let xs = ā³ 1000000
    print(xs ⌿ (xs % 2 == 0) ĀØ (x => x * x) ā–· +/)
}
No guessing

Ask Mimic what it did

mimic why shows how each line runs: fused, on the cores, with SIMD, on the GPU, or why not. mimic profile and mimic audit show where time goes.

Terminal
$ mimic why
main  (main.mim:8)
  ⇶ fused    line 8 xs ⌿ (xs % 2 == 0) ĀØ (x => x * x)
      the operations and the reduction are one loop,
      with no arrays in between; it is split over the
      cores when large, and uses SIMD where the CPU
      has it
  ≋ simd     line 8 (x => x * x)
      SIMD across elements: the function runs on 8
      elements at once (vector instructions)

$ mimic run --release
166666166667000000
Your editor

Ready in your editor

VS Code, Cursor, Windsurf and VSCodium: highlighting, completion of words and glyphs, errors as you type, run and profile buttons.

$curl -fsSL https://mimic.codes/vscode.sh | sh
Community

Build it with us

Mimic is open source under the Apache License 2.0. Questions, ideas and bugs are welcome, wherever you are.