Welcome to Kubus, a unique programming language designed for simplicity, flexibility, and seamless transpilation! With Kubus, you can write expressive, concise code that can be effortlessly transpiled into PHP, opening up endless possibilities for cross-platform development and experimentation.
-
Custom Syntax:
- Shorthand keywords like
ns
fornamespace
,pu
forpublic
, andfre
forforeach
. - Unique symbols such as
$$
for local variables and$$$
for static local variables.
- Shorthand keywords like
-
Lexical Structure:
- Supports keywords, operators, literals, and delimiters.
- Includes common data types like
int
,float
,string
,char
,bool
, andvoid
. - Operators include arithmetic (
+
,-
,*
,/
), comparison (==
,!=
,>
,<
), and increment/decrement (++
,--
).
-
Parsing and Syntax:
- Constructs an Abstract Syntax Tree (AST) for statements like
if
,foreach
,return
, and variable declarations. - Supports blocks, expressions, and array operations (e.g., appending values).
- Constructs an Abstract Syntax Tree (AST) for statements like
-
Control Flow:
- Includes
if-else
andforeach
constructs. - Allows return statements and expression-based statements.
- Includes
-
Variable Handling:
- Supports static and local variables with increment and decrement operations.
- Handles array operations, including indexed assignments and appends.
-
Error Handling:
- Provides detailed error messages with token type, value, and position.
-
Transpilation:
- Designed to transpile Kubus code into PHP and Kubus itself, enabling cross-platform development.
-
Comments and Whitespace:
- Supports single-line (
//
) and multi-line (/* */
) comments. - Handles whitespace and punctuation effectively.
- Supports single-line (
-
Focus on Simplicity:
- Lightweight and expressive, with a focus on clarity and efficiency.
Disclaimer: This project is in early development. Syntax may change drastically until first beta versions. Not recommended for heavy development of critical code.