techscript

Virtual Machine (VM) Specification

The TechScript VM is a stack-based virtual machine written in Rust that executes optimized bytecode files (.txc).


🏗️ Core Architecture Components

1. Execution Stack

Stores runtime values. Binary math operators pop the top two values, execute calculations, and push results back.

2. Stack Frames

Each active function call pushes a new StackFrame holding:


🧬 NaN-Boxed Value Representation

To maximize cache locality, TechScript values are represented using 64-bit floating-point numbers:


🔁 Garbage Collector (GC)