Philosophy of Starlight
Starlight is designed to be:
- Readable for beginners
- Strict enough to avoid mistakes
- Simple but expandable
Output: sldeploy
sldeploy "Hello, Starlight!";
Reason:
sldeploy clearly means “send output to user”.
It avoids confusion with traditional print or console.log.
Variables: let
let age = 18; let name = "Alex";
Reason:
Only let exists to reduce cognitive load.
No var, no const confusion.
Input: ask()
let username = ask("Enter your name:");
Reason:
ask reads naturally in English.
Type Conversion
let count = num("5"); let text = str(123);
Reason: Starlight forces explicit conversions to avoid silent bugs.
Conditions
if (age >= 18) { sldeploy "Access granted"; } else { sldeploy "Access denied"; }
Reason: Curly braces enforce structure and prevent logic errors.
Loops
let i = 1; while (i <= 5) { sldeploy i; i = i + 1; }
Reason: Minimal loop types keep learning simple.
Functions
func greet(name) { return "Hello " + name; }
Reason: Functions exist for reuse and clarity.
Imports
import chalk;
Reason: Imports are explicit and simple. No destructuring or alias complexity.
Error Safety
Reason: Fail fast to help beginners learn faster.
Final Thoughts
Starlight is intentionally minimal. Every keyword exists for a reason.
Learn it once. Understand it fully. Build confidently.