Experimental開発中(実験段階)

One language.
Every core.
ひとつの言語で、
すべてのコアを。

A statically typed language with TypeScript-like syntax. It compiles through LLVM to native executables and WebAssembly, with no garbage collector — and lets you write CPU and GPU code in the same source. TypeScriptに近い構文の、静的型付け言語です。GCを持たず、LLVMを経由してネイティブとWebAssemblyにコンパイルします。CPUとGPUのコードを、同じソースに書けます。

particles.um
struct Particle {
  pos: f32;
  vel: f32;
}

// A kernel runs once per index, on the CPU (all cores) or on the GPU.
kernel function integrate(i: u32, ps: mut Buffer<Particle>, dt: f32): void {
  ps[i].pos = ps[i].pos + ps[i].vel * dt;
}

export function main(): i32 {
  let ps = new Buffer<Particle>(1000);
  ps[0].vel = 2;
  dispatch(integrate, ps.length, mut ps, 0.5);
  print(ps[0].pos);   // 1
  return 0;
}

Why UnifiedMozaicUnifiedMozaicの特徴

One source for CPU and GPUCPUとGPUを、ひとつのソースで

kernel functions mean the same on every backend: a CPU thread pool, Apple GPUs through Metal, and experimentally WebGPU. dispatch picks CPU or GPU by measurement.kernel 関数は、CPUのスレッドプール、Metal経由のApple GPU、実験的にWebGPUのどれでも同じ意味で動きます。CPUかGPUかは dispatch が計測して選びます。

Ownership instead of GCGCの代わりに所有権

Heap values have a single owner. Arguments are borrowed, mutably borrowed (mut) or moved (own), checked at compile time.ヒープの値の持ち主は常にひとり。引数は借用・可変借用(mut)・移動(own)のどれかで、コンパイル時に検査します。

Safe by default標準で安全

Out-of-bounds access, division by zero and oversized shifts stop with a clear message. No undefined behaviour, and no unsafe.範囲外アクセス・ゼロ除算・大きすぎるシフトは、分かりやすいメッセージで停止します。未定義動作はなく、unsafe もありません。

TypeScript-like, explicit typesTypeScript風、型は明示

Sized numbers down to f16, structs, classes, enums with match, interfaces, generics and nullable types. No implicit conversions.f16 まで揃った数値型、構造体、クラス、match 付きの enum、インターフェース、ジェネリクス、nullable。暗黙の型変換はありません。

Threads without data racesデータ競合のないスレッド

thread.spawn / thread.join, with RacyBuffer as the only shared mutable data — every element access is atomic.thread.spawn / thread.join。共有して書き換えられるのは、要素のアクセスがアトミックな RacyBuffer だけです。

Low-level speed when you need it必要なときは低レベルの速さ

128-bit SIMD types, Math.prefetch, bounds-check elimination and bulk fill. Compiled through LLVM.128ビットのSIMD型、Math.prefetch、範囲検査の除去、一括の fill。LLVMでコンパイルします。

AI-nativeAIネイティブ

Runs AI.
Written with AI.
AIを動かし、
AIと書く。

Built for the code that runs models, and for the models that write code.モデルを動かすコードのために。そして、コードを書くモデルのために。

Made for AI workloadsAIの処理のために

Numeric kernels run on CPU and GPU from one source, with small types like f16, i8 and u8 buffers.数値計算のカーネルを、ひとつのソースでCPUとGPUの両方に。f16 や i8・u8 の Buffer のような小さな型も使えます。

Diagnostics for humans and AI人にもAIにも読める診断

Every error carries a code, a location and a hint, and check --json gives machine-readable diagnostics.エラーには必ずコード・場所・ヒントが付き、check --json で機械が読める形の診断を出せます。

Safe when AI writes itAIが書いても安全

A syntax that language models already know, ownership checked at compile time, and no undefined behaviour to slip through.言語モデルが慣れた構文に、コンパイル時の所有権検査。未定義動作が紛れ込む余地もありません。

Get Startedはじめる

Requirements必要なもの

  • Node.js 22.18 or laterNode.js 22.18 以上
  • clang from LLVM 18 or later (wasm-ld for WebAssembly)LLVM 18 以上の clang(WebAssemblyには wasm-ld も)
  • For GPU on a Mac: Apple Silicon with Xcode or the Command Line ToolsMacでGPUを使うなら、Apple SiliconとXcodeまたはCommand Line Tools
  • No npm dependenciesnpmの依存はありません

Step-by-step setup, including the um command, is in the documentation.um コマンドを含む詳しい手順はドキュメントにあります。

git clone https://github.com/UnifiedMozaic/UnifiedMozaic.git
cd UnifiedMozaic

# Native executable
node src/cli.ts build examples/structs.um --target host -o structs
./structs

# Kernels on the GPU through Metal (Apple Silicon)
UM_METAL=1 node src/cli.ts build examples/kernels.um --target host -o kernels
./kernels

# WebAssembly
node src/cli.ts build examples/structs.um -o structs.wasm
node runtime/run-node.mjs structs.wasm