It details how the project itself works, not how to write code in it. If you would like to know how to write code in Spindle, please look at the user documentation!
With that out of the way, this document will lay out how Spindle works and will help you contribute to it.
If you want a high-level overview of how Spindle works, you're in just the right place!
This explanation dives into how Spindle, a programming language, works behind the scenes, transforming your code into a running program. It's important to note that this explanation is geared towards developers contributing to Spindle, not for users writing Spindle code.
The Grand Tour:
Spindle's journey from code to execution involves several key stages:
The Warm-Up: Semi-Parsing (Not User-Facing)
shell.py
). This
documentation focuses on the direct execution path.
RUN("")
Command: Spindle
checks for a RUN("")
command at the
beginning. This is not part of the Spindle language itself but helps
the desktop experience. It specifies the file to run.
IF
Statements: Spindle
automatically adds ELSE{}
to any
IF
statements missing an ELSE
block. This
prevents program crashes caused by incomplete
IF
statements.
Step 1: The Lexer - Turning Text into Tokens
+
or -
), and literals (like numbers or
strings).
Step 2: The Parser - Adding Meaning to Tokens
IF
, FOR
, and expressions.
Step 3: The Interpreter - From Meaning to Results
null
. This null
value is filtered out
during presentation.
Understanding the Process:
This breakdown helps visualize how Spindle transforms your code. Each stage builds upon the last, ultimately resulting in a running program. If you're interested in contributing to Spindle's development, understanding these steps is crucial for working with the interpreter and parser logic.