Developer Documentation
Technical documentation for contributors who want to help improve and extend Spindle.
Important Note
This documentation explains how Spindle works internally and is intended for contributors. If you're looking to learn how to write code in Spindle, please visit our User Documentation.
architecture Spindle: From Code to Execution
This section explains how Spindle transforms source code into a running program, detailing each stage of the compilation and execution process.
Execution Pipeline
Semi-Parsing (Pre-processing)
- • Direct execution or front-end file processing
- • Handling
RUN("")
commands - • Standardizing
IF
statements withELSE{}
blocks - • Isolating function definitions for independent processing
Lexical Analysis
- • Character-by-character scanning, handling whitespace and newlines
- • Tokenization of keywords, identifiers, operators (
+
,-
), and literals - • Basic syntax validation and error checking
Parsing
- • Analyzing token structure for
IF
,FOR
, and expressions - • Rigorous syntax validation and error detection
- • Converting tokens into interpreter instructions
Interpretation
- • Working with Abstract Syntax Tree (AST) representation
- • Executing program logic (loops, expressions, functions)
- • Managing program output and return values