Stubx is an intuitive, elegant, and modern programming language designed for unparalleled clarity and power. It aims to make coding feel more like writing prose, focusing on the logic and ideas rather than complex syntax.
The core capabilities of Stubx:
- Readability First: Minimal syntax reduces clutter.
- Pipes & Juxtaposition: Chain operations (
x |> f) and call functions naturally. - Implicit Value (
~): Access the result of the last operation instantly. - Control Structures: Clear
if/else,while, andforloops. - Flexible Typing: Dynamically typed with optional suffixes.
Adds powerful system integration and functional patterns:
- File System: Easily
readfrom andappend_tofiles. - System Interaction: Execute shell commands directly with
exec. - Functional Power: Use
mapandfilterfor concise list manipulations. - Error Handling: Handle exceptions gracefully with
attemptandrecoverblocks.
Focuses on tooling, interactivity, and debugging:
- Interactive REPL: Experiment with Stubx code in real-time.
- Formatter: Automatically format your code for consistent style.
- Debugger Mapping: Runtime errors in Python are mapped back to their original line in the Stubx source file for easier debugging.
To run a Stubx script using the latest version (V3):
python "Current Release (V3)/compiler.py" --file your_script.stubxStart REPL (Interactive Shell):
python "Current Release (V3)/compiler.py" --replFormat Code:
python "Current Release (V3)/compiler.py" --format your_script.stubxCompile Only:
python "Current Release (V3)/compiler.py" --file your_script.stubx --no-runFirst Version (V1)/: The original version of the compiler.Stable Release (V2)/: The previous beta, now stable with system features.Current Release (V3)/: The latest version including the REPL and Formatter.
-- A simple Stubx program
ask username
say "Hello, " + username + "!"
if username == "Louis":
say "Welcome back, creator!"
else:
say "Nice to meet you."
end
-- Using pipes and implicit value
"stubx is fun" |> upper |> say
-- Output: STUBX IS FUN
-- Using V2+ features
attempt:
read "config.txt"
recover:
say "Config missing, using defaults."
end
Stubx was created by me with a goal to create a more accessible and expressive program language. The project aims to simplify how we write code, bridging the gap between natural language and powerful scripting.
- Main page: Welcome page
- Documentation: Detailed Stubx Documentation
Beware, this project is still in development and the main features you might expect probably aren't implemented yet. I am actively working on it, but I am a student, so I obviously can't guarantee further development.