AI gen programming language
  • TypeScript 62.3%
  • Zig 32.7%
  • JavaScript 2.3%
  • Astro 1.5%
  • CSS 1.2%
Find a file
2026-07-22 15:18:32 +00:00
.opencode/agents feat: jumps 2026-07-16 22:29:41 +00:00
compiler format(v0.2): add integrity checks 2026-07-22 15:18:32 +00:00
docs docs: stuff 2026-07-22 13:41:22 +00:00
frontend format(v0.2): add integrity checks 2026-07-22 15:18:32 +00:00
vm format(v0.2): add integrity checks 2026-07-22 15:18:32 +00:00
AGENTS.md docs 2026-07-17 10:26:41 -05:00
README.md docs(v0.2): define evolution paths 2026-07-22 03:26:23 +00:00

Nik lang

Nik is a high-level, general-purpose language compiled for a register-based virtual machine.

VM

The VM currently executes version 0.1 nikfiles on 64-bit Linux:

  • 64 general-purpose registers (r0 is hardwired to zero)
  • 8 normalized comparison registers (c0 through c7)
  • A bounded 128-word operand stack
  • Moving heap allocation for immutable byte strings, U64 arrays, U64 pairs, and traced objects
  • Relative conditional and unconditional branches
  • Function calls with a bounded 128-frame call stack

The complete file format, instruction encoding, runtime behavior, and validation rules are documented in vm/docs/SPEC.md.

Build and test the VM with:

cd vm
zig build
zig build test

Compiler

The TypeScript bootstrap compiler is in compiler/. It reads Nik source, indexes declarations, resolves lexical names, checks typed HIR, and emits executable .nikb files with typed string values, immutable U64 arrays and pairs, explicit U64-to-string coercion, concatenation, string and Bool equality, and literal/runtime print calls. See compiler/README.md for setup, commands, and current backend limits.

The proposed v0.2 format and language evolution paths are tracked in docs/ROADMAP_0.2.md.

cd compiler
pnpm install
pnpm test
node dist/src/cli.js build ../vm/testdata/hello_source.nik

Run the resulting file with the VM from vm/zig-out/bin/vm.