Skip to content

Language Specification

github-actions[bot] edited this page Oct 2, 2026 · 1 revision

Language Specification

TumorScript is an experimental programming language merging biological principles with computational execution. This document outlines the official language identity, syntax paradigm, and file extension taxonomy.


1. Project Identity

  • Language Name: TumorScript
  • Target Paradigms: Biomorphic, Entropic, Dynamic, Imperative, Object-Oriented (Cellular).
  • Reference Implementation: Lua 5.4+ (Prototype / Tree-walking Interpreter). Native LLVM / Rust backend planned for future versions.
  • Indentation Model: Minimalist, Python-like significant indentation without statement semicolons (;).
  • Brace Exclusivity: Curly braces {} are strictly prohibited across the entire language grammar except immediately after the quarantine keyword.

2. File Extension Taxonomy

TumorScript introduces a multi-tiered file system representing varying biological containment levels:

Extension Formal Name Containment Level Description
.tmq Tumor Quarantine Primary Main executable source files. Contains full quarantine {} logic, main entrypoint, and core application workflows.
.tmr Tumor Source Module Intermediate Auxiliary logic modules imported into the main host program. Contains secondary cell structures and gene definitions.
.tmh Tumor Header Sterile / Immune Protected header files containing exclusively immutable rna constants. Inherently immune to entropic decay.
.tmz Tumor Zone Extreme Hazard High-risk, uninhibited experimental areas. Mutation and metastasis rates are amplified tenfold.
.tmb Tumor Bytecode Binary Artifact Compiled intermediate bytecode generated by the compiler for execution by the virtual machine.

3. Grammar Synopsis

A TumorScript program consists of a sequence of top-level declarations, including metastasis imports, cell definitions, gene definitions, and executable statements.

Program         ::= Statement* EOF ;
Statement       ::= VarDecl | GeneDef | CellDef | Metastasis | Quarantine | Chemo | Apoptosis | IfStmt | WhileStmt | PrintStmt | AssignStmt ;

VarDecl         ::= ("dna" | "rna") IDENTIFIER "=" Expression ;
CellDef         ::= "cell" IDENTIFIER ":" INDENT VarDecl* DEDENT ;
GeneDef         ::= "gene" IDENTIFIER "(" ParameterList? ")" ":" INDENT Statement* DEDENT ;
Quarantine      ::= "quarantine" "{" NEWLINE Statement* "}" ;
Chemo           ::= "chemo" (IDENTIFIER | DotAccess) ;
Apoptosis       ::= "apoptosis" Expression? ;

Clone this wiki locally