Skip to content

DevYatsu/YatsuScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YatsuScript

A register-based bytecode interpreter with a generational GC, async task execution, and a custom LSP.

YatsuScript is a lightweight scripting language designed for simplicity, performance, and modern developer experience. It features a register-based VM, NaN-boxed values, and true parallel execution via Tokio.

Workspace Structure

The project is organized into modular crates:

  • ys-core: The linguistic frontend (Lexer, Parser, Compiler).
  • ys-runtime: The execution engine (VM, Heap, GC, Natives).
  • ys-cli: The user-facing tool (yatsuscript) with REPL and Formatter.
  • yatsuscript-lsp: Language Server Protocol for IDE features.

Why YatsuScript?

  • Simple Syntax: Clean, newline-terminated statements with : for assignment.
  • Async First: First-class spawn { ... } blocks for effortless concurrency.
  • Modern Tooling: Built-in code formatter and a full LSP for highlighting/diagnostics.
  • Efficient Memory: NaN-boxed 64-bit values and a generational, concurrent GC.

Quick Start

Installation

cargo install --path ys-cli

Running a script

yatsuscript examples/fib.ys

Starting the REPL

yatsuscript

Language Features

Variable Declarations

let x: 10      // Immutable
mut y: 20      // Mutable
y: x + y       // Assignment

Concurrency

spawn {
    print("Running in parallel!")
}

Collections

let list: [1, 2, 3]
let user: { name: "Yanis", age: 30 }

Functional Style

let r: (0..10).step(2)
for i in r {
    print(i)
}

Documentation

License

MIT © Yanis

About

A small interpreter

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors