mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 00:56:31 +02:00
df5ef6429360ea8a40b5aa5785b235876225e88f
What is it?
YesNt is a line-based, interpreted scripting language. The core idea is simple: each line maps to one primary statement. Lines are processed top-to-bottom, and inline tokens (like ${variable} or %read_line) are substituted before the statement executes. Postfix modifiers like calc and task can also appear at the end of a line to evaluate arithmetic or fork execution into a background thread.
Key characteristics:
- Line-based execution: Lines are processed top-to-bottom. Each line is a self-contained statement
- Explicit control flow: Labels,
goto, and conditional jumps alongside structuredif/whileblocks - Explicit scoping:
varfor function-local variables,globalfor cross-scope shared state - Functions with stacks: Arguments and return values are passed via explicit push/pop stacks (
push_in,%in,push_out,%out) - Background tasks: Any line can be forked into a background execution flow with
task - Embeddable: The interpreter ships as a C# library. Custom statements can be registered, and built-in ones can be removed or disabled for sandboxing
YesNt is intentionally minimal and transparent. It is well suited for scripting, education, and embedding in applications that need a lightweight, controllable scripting engine.
Usage
- Download & install the latest release
- GitHub (Windows/Linux/macOS): releases
- Run a script with the interpreter CLI
YesNt.Interpreter.App script.yntruns a script
- Or use the terminal code editor
YesNt.CodeEditoropens the editor (optional path to load a file)run/debugto execute the open scriptformatto auto-format indentation
Example
func greet:
var name = %in
print_line Hello, ${name}!
return
func add:
var result = %in + %in calc
push_out ${result}
return
call greet with Alice
call greet with Bob
call add with 3, 7
var sum = %out
print_line 3 + 7 = ${sum}
Languages
C#
98.1%
PowerShell
1.6%
JavaScript
0.2%
Python
0.1%