Skip to content
rahadbhuiyaPublic

About

A lightweight interpreted programming language implemented from scratch in pure C, featuring a custom lexer, parser, and AST evaluation runtime.

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Latest commit

 

History

97 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yolish Logo

Yolish

The official programming language of Exploidus OS.
Fast, expressive, capability-aware, with a native x86-64 compiler.


Author .Bhuiya
Version v2.47
Extension .y
Compiler/Interpreter ys / ys.exe
Targets Linux ELF64 · Windows PE32+ · macOS Mach-O

Install

No dependencies required. Download the binary and run.

Windows

Option 1: GUI installer (recommended)

  1. Download yolish-setup.exe
  2. Double-click → Next → Next → Finish
  3. Open any new terminal and type ys

The installer automatically adds Yolish to your PATH and creates a Start Menu shortcut that opens the Yolish REPL in a terminal window. An entry in Add/Remove Programs is also created for clean uninstallation.

Option 2: manual (no installer)

  1. Download ys.exe
  2. Put it anywhere (e.g. C:\Tools\ys.exe)
  3. Add that folder to your PATH, or run the PowerShell auto-installer:
# Run once as Administrator
powershell -ExecutionPolicy Bypass -File .\install.ps1

After that: open any terminal and type ys.

Linux

curl -fsSL https://raw.githubusercontent.com/rahadbhuiya/yolish/master/install.sh | sh

Or manually:

curl -L https://github.com/rahadbhuiya/yolish/releases/latest/download/ys-linux -o ys
chmod +x ys
sudo mv ys /usr/local/bin/

macOS

curl -fsSL https://raw.githubusercontent.com/rahadbhuiya/yolish/master/install.sh | sh

Build from source (optional)

Only needed if you want to hack on Yolish itself:

git clone https://github.com/rahadbhuiya/yolish
cd yolish
make        # requires gcc or clang, no other dependencies

See BUILD.md for detailed build instructions.


Quick Start

-- hello.y
fn main() {
    y.println("Hello from Yolish!")
}
-- main() is called automatically if defined — no need to call it explicitly
ys hello.y              # interpret
ys -c hello.y           # compile to native binary
./hello                 # run the native binary

Usage

ys                              Start interactive REPL
ys <file.y>                     Interpret a file
ys -c <file.y>                  Compile for current OS
ys -c <file.y> -o <name>        Compile with custom output name
ys -c <file.y> --target linux   Compile → Linux ELF64
ys -c <file.y> --target windows Compile → Windows PE32+
ys -c <file.y> --target macos   Compile → macOS Mach-O
ys test <file.y>                Run test blocks
ys fmt  <file.y>                Format source (prints to stdout)
ys check <file.y>               Static check without running
ys vm <file.y>                   Run via the bytecode VM (faster, full language coverage)
ys --help                       Show help

Language at a Glance

-- Variables
let name  = "Yolish"     -- immutable
var count = 0            -- mutable

-- Functions + recursion
fn factorial(n) {
    if n <= 1 { return 1 }
    return n * factorial(n - 1)
}

-- Loops
for i in 0..10 { y.print(i) }

var i = 0
while i < 5 { i = i + 1 }

-- Match expression with guards
let grade = match score {
    90..100      => "A"
    80..90       => "B"
    n if n >= 60 => "C"
    _            => "F"
}

-- Enums (v2.2)
enum Direction { North  South  East  West }
let dir = Direction.North
match dir {
    Direction.North => y.println("going north")
    _               => y.println("other direction")
}

-- Structs + impl methods
struct Circle { radius }
impl Circle {
    fn area(self) {
        return y.math.pi * self.radius * self.radius
    }
}
let c = Circle { radius: 5 }
y.println(c.area())

-- Arrays + functional builtins
let nums    = [1, 2, 3, 4, 5]
let evens   = y.filter(nums, fn(x){ return x % 2 == 0 })
let doubled = y.map(nums, fn(x){ return x * 2 })
let total   = y.sum(nums)

-- String interpolation
let msg = "Hello {name}, score = {score}"

-- Backtick strings (raw, no interpolation, perfect for JSON/templates)
let json = `{"name": "Yolish", "version": 1}`

-- File I/O (v1.2)
y.fs.write("log.txt", "started\n")
let content = y.fs.read("log.txt")
y.println(y.fs.exists("log.txt"))

-- JSON (v1.7)
let obj = y.json.parse(`{"lang": "yolish", "stable": true}`)
y.println(obj.lang)
y.println(y.json.stringify(obj))

-- Process & System (v1.3)
let out = process.spawn("uname -s")
y.println(sys.platform())

-- Time (v1.7)
let now = y.time.now()
y.println(y.time.format(now, "%Y-%m-%d %H:%M:%S"))

-- Module import (v1.6: relative path, cached)
import "./utils.y"

-- Error handling
try {
    throw "oops"
} catch(e) {
    y.println("caught: " + e)
}

-- Closures
let square = fn(x) { return x * x }

-- Capability annotations (Exploidus OS)
@cap(net.read, fs.write)
fn fetch_and_save(url, path) { ... }

Feature Table

Feature Status
Variables (let / var) Done
Functions + recursion Done
if / else if / else Done
while loop + break / continue Done
for i in lo..hi range loop Done
for item in array loop Done
for ch in string character loop Done
match expression + guards + binding Done
Enums (enum Direction { N S E W }) Done v2.2
Arrays (dynamic, max 1024 elements, O(1) amortized push) Done
Strings (dynamic heap-allocated, unlimited size) Done v2.4
Structs + impl methods + self Done
Method chaining Done
Closures / first-class functions Done
try / catch / throw Done
String interpolation "Hello {name}" Done
Backtick strings (raw, multiline) Done
Raw strings r"..." Done
y.map / y.filter / y.reduce / y.each Done
y.sort / y.zip / y.flatten / y.sum / y.range Done
y.math.*: sqrt, pow, sin, cos, pi, ... Done
y.string.*: upper, lower, split, join, trim, ... Done
y.input / y.input_int / y.input_float Done
Type system: y.typeof, y.is_*, conversions Done
Capability system @cap, @intent, @audit Done
Module / import system + relative paths + caching Done v1.6
Error objects y.error(msg, code) Done
Better errors: file:line:col + typo suggestion Done v1.4
REPL with colored banner Done
Float arithmetic (SSE2 native) Done v1.1
Arrays in native compiler Done v1.1
File I/O (y.fs.*, 10 functions) Done v1.2
Process & System (process.*, sys.*) Done v1.3
JSON (y.json.parse, y.json.stringify) Done v1.7
Time (y.time.now, sleep, format) Done v1.7
Path (y.path.join, basename, ext, ...) Done v1.7
Env (y.env.get, y.env.set) Done v1.7
Native x86-64 compiler Done v1.0
Native → Linux ELF64 Done
Native → Windows PE32+ (with icon) Done
Native → macOS Mach-O Done
Native → Exploidus Pending v1.8
Garbage Collector (mark-and-sweep, gc.collect, gc.stats) Done v1.5
Built-in test runner (ys test, test blocks, assert*) Done v2.1
Static checker (ys check, undefined vars, type hints) Done v2.1
Code formatter (ys fmt, prints formatted source) Done v2.1
Bytecode VM (ys vm, full language coverage) Done v2.6
Self-hosting (Yolish compiles Yolish) Pending

Platforms

Platform Interpreter Native Compiler Output
Linux Done ELF64 static binary
macOS Done Mach-O 64-bit
Windows Done PE32+ with icon
Exploidus OS Done coming v1.8

Standard Library Overview

Module Functions
I/O y.print, y.println, y.input, y.input_int, y.input_float
String y.len, y.upper, y.lower, y.trim, y.split, y.join, y.contains, y.replace, y.substr, y.reverse, y.repeat, y.starts_with, y.ends_with, y.index_of
Array y.push, y.pop, y.slice, y.len, y.reverse, y.sort, y.map, y.filter, y.reduce, y.each, y.zip, y.flatten, y.sum, y.range
Math y.math.sqrt, y.math.pow, y.math.abs, y.math.floor, y.math.ceil, y.math.round, y.math.min, y.math.max, y.math.pi, y.math.log, y.math.sin, y.math.cos, y.math.tan
File I/O y.fs.read, y.fs.write, y.fs.append, y.fs.exists, y.fs.list, y.fs.mkdir, y.fs.delete, y.fs.rename, y.fs.size, y.fs.is_dir
JSON y.json.parse(str), y.json.stringify(val)
Time y.time.now(), y.time.unix(), y.time.sleep(ms), y.time.format(ms, fmt)
Path y.path.join(...), y.path.basename(p), y.path.dirname(p), y.path.ext(p), y.path.stem(p), y.path.abs(p)
Env y.env.get(key), y.env.set(key, val), y.env.unset(key)
Process process.spawn(cmd), process.spawn_code(cmd), process.env(key), process.pid()
System sys.exit(code), sys.platform()
Type y.typeof, y.is_int, y.is_str, y.is_float, y.is_bool, y.is_array, y.is_nil, y.int, y.str, y.float, y.bool
Error y.error(msg, code)
Capability y.capabilities(), y.has_cap(caps, name)
GC gc.collect(), gc.stats()
Test assert(expr), assert_eq(a,b), assert_neq(a,b), assert_true(v), assert_false(v), assert_nil(v)

Documentation & Engineering Logs

  • DOCS.md: Full language specification, syntax guide, and standard library API reference.
  • BUILD.md: Cross-compilation instructions for Linux, Windows, and macOS.
  • CHANGELOG.md: Full release-by-release technical engineering history, networking milestones, and regression fixes.
  • ROADMAP.md: Architecture milestones, self-hosting progress, and upcoming engine targets.

Contributing

Pull requests and issues are welcome! Please ensure all regression tests pass before submitting changes:

make test

License

MIT

About

A lightweight interpreted programming language implemented from scratch in pure C, featuring a custom lexer, parser, and AST evaluation runtime.

Topics

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages