Profiles

Tape programs declare a profile that controls which language features are available.

The three profiles

ProfileUse caseTypesMemoryTargets
t0Kernel, freestandingRequiredManual onlyNative only
t1ApplicationsRequiredExplicit, optional GCVM + Native
t2Scripts, prototypesOptional (any)GCVM + Native

Declaring a profile

Every file begins with a profile declaration:

tape
@profile(t1);

Import restrictions

  • t2 can import: t2, t1, t0
  • t1 can import: t1, t0 (can import t2 source — compiles it in)
  • t0 can import: t0 only

What changes per profile

t0 — freestanding

No GC, no heap unless you provide an allocator. No string (use []const u8). Can use @asm, volatile, atomics. Kernel can launch t1/t2 programs but cannot call into them.

t1 — typed application

Static types required (inferred from initializer or annotated). Compiles to native exe or DLL. Explicit memory management with optional GC. This is where most programs live.

t2 — scripting

Types optional (defaults to any). Dynamic dispatch, boxing, GC. Cannot compile to DLL. Think: JavaScript/Python-style scripting with tape syntax.

Last modified: