tape repl

Planned — design subject to change

This feature is designed but not yet implemented. The syntax and behavior described here represent the target specification.

Usage

bash
tape repl

Features

  • Line-by-line expression evaluation
  • Multi-line input (auto-detected by unclosed braces)
  • Variable persistence across lines
  • Import modules interactively
  • Tab completion for identifiers

Example session

plaintext
tape> let x = 42
tape> x * 2
84
tape> import math from "math"
tape> math.sqrt(144.0)
12.0
tape> fn square(n: i64) -> i64 { return n * n; }
tape> square(7)
49

Profile

The REPL defaults to t2 (scripting) — type annotations are optional:

plaintext
tape> var name = "world"
tape> "Hello, {name}!"
Hello, world!

Commands

CommandAction
:quitExit the REPL
:clearClear defined variables
:type <expr>Show the type of an expression
:disasm <fn>Show TAC for a function

Last modified: