mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 00:56:31 +02:00
Update README to use standard template
This commit is contained in:
@@ -1,25 +1,52 @@
|
||||
# YesNt
|
||||

|
||||
|
||||
> YesNt is a imperative and interpreted language inspired by the Assembly language.
|
||||
- [Documentation](docs/README.md)
|
||||
- [Language Reference](docs/language-reference.md)
|
||||
- [Releases](https://github.com/Stone-Red-Code/YesNt-Interpreter/releases)
|
||||
|
||||
## Documentation
|
||||
## What is it?
|
||||
|
||||
| Document | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------- |
|
||||
| [docs/README.md](docs/README.md) | Getting started |
|
||||
| [docs/language-reference.md](docs/language-reference.md) | Full language reference |
|
||||
| [docs/library-api.md](docs/library-api.md) | Embedding the interpreter as a C# library |
|
||||
| [docs/editor.md](docs/editor.md) | Using the terminal code editor |
|
||||
YesNt is an interpreted scripting language inspired by assembly. 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.
|
||||
|
||||
## Quick example
|
||||
**Key characteristics:**
|
||||
|
||||
- **Line-based execution:** Lines are processed top-to-bottom. Each line is a self-contained statement
|
||||
- **Assembly-inspired control flow:** Labels, `goto`, and conditional jumps alongside structured `if`/`while` blocks
|
||||
- **Explicit scoping:** `var` for function-local variables, `global` for 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
|
||||
|
||||
1. Download & install the latest release
|
||||
- GitHub (Windows/Linux/macOS): [releases](https://github.com/Stone-Red-Code/YesNt-Interpreter/releases)
|
||||
2. Run a script with the interpreter CLI
|
||||
- `YesNt.Interpreter.App script.ynt` runs a script
|
||||
3. Or use the terminal code editor
|
||||
- `YesNt.CodeEditor` opens the editor (optional path to load a file)
|
||||
- `run` / `debug` to execute the open script
|
||||
- `format` to auto-format indentation
|
||||
|
||||
## Example
|
||||
|
||||
```ynt
|
||||
var name = world
|
||||
print_line Hello ${name}
|
||||
```
|
||||
func greet:
|
||||
var name = %in
|
||||
print_line Hello, ${name}!
|
||||
return
|
||||
|
||||
## Run
|
||||
func add:
|
||||
var result = %in + %in calc
|
||||
push_out ${result}
|
||||
return
|
||||
|
||||
```bash
|
||||
dotnet run --project YesNt.Interpreter.App -- path/to/script.ynt
|
||||
call greet with Alice
|
||||
call greet with Bob
|
||||
|
||||
call add with 3, 7
|
||||
var sum = %out
|
||||
print_line 3 + 7 = ${sum}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user