Skip to content
yidika-labPublic

About

Yidika: a statically typed language with an interpreter and an LLVM native compiler, for servers and native desktop apps

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Yidika (yidi)

A modern systems programming language designed for hardware-aware computing - blending the safety and expressiveness of Rust with the ergonomics of modern scripting languages.

Status: MVP / Experimental - parsing, type checking, and an interpreter are functional.


Features

  • Mutable by default - variables are mutable unless declared const
  • Strong, static typing with type inference
  • Algebraic data types - structs, unions, type aliases, generics
  • Pattern matching (match) with guards
  • Async/await & spawn (parsed; synchronous runtime for now)
  • Module system with relative path imports
  • FFI - import C/C++/Rust symbols via use from "lang:path"
  • Built-in collections - lists, maps, sets (interpreter support in progress)
  • Rich type system - int, rint, real, bool, str, symbol, null, None, vectors, matrices

Quick Start

Install

Prebuilt binaries are published on GitHub Releases for every tagged version. The install scripts pick the right one for your machine, check its SHA-256 checksum and put yidi in ~/.yidi/bin. Nothing outside your home folder is changed and no admin rights are needed.

OS Architectures Requirements
Windows x86_64; ARM64 runs the x86_64 build through Windows 11 emulation Windows 10 or 11, PowerShell 5.1 or later
macOS Apple Silicon (arm64), Intel (x86_64) macOS 11 or later
Linux x86_64, aarch64 glibc 2.35 or later (Ubuntu 22.04, Debian 12, Fedora 36 and newer)

Linux and macOS

curl -fsSL https://raw.githubusercontent.com/yidika-lab/yidika/main/install.sh | sh

Windows (PowerShell, no administrator rights needed)

irm https://raw.githubusercontent.com/yidika-lab/yidika/main/install.ps1 | iex

That is the whole install. The script then:

  1. checks the download against its SHA-256 checksum;
  2. runs a test program with the installed yidi and prints self-test passed: Hello from Yidika!;
  3. adds ~/.yidi/bin to your PATH for future terminals: in ~/.zshrc, ~/.bashrc (plus ~/.bash_profile on macOS), fish's conf.d or ~/.profile depending on your shell, and in the user PATH on Windows;
  4. makes yidi usable right away. On Windows it works in the same PowerShell window. On Linux and macOS a script piped into sh cannot change the shell that started it, so the installer opens a new shell where yidi is ready; type exit to go back.

Then write your first program (on Windows, create hello.yk with any editor and run the second line):

printf 'fn main() {\n    print("Hello, Yidika!");\n}\n' > hello.yk
yidi hello.yk

Options, updates and removal

Task Linux and macOS Windows (PowerShell)
Install a specific version curl -fsSL .../install.sh | YIDI_VERSION=v0.1.0 sh $env:YIDI_VERSION='v0.1.0'; irm .../install.ps1 | iex
Leave my shell profile alone curl -fsSL .../install.sh | YIDI_NO_MODIFY_PATH=1 sh Not needed: only the user PATH is changed
Do not open a new shell at the end curl -fsSL .../install.sh | YIDI_NO_SHELL=1 sh Not applicable
Install somewhere else YIDI_HOME=/opt/yidi before sh $env:YIDI_HOME='D:\tools\yidi' before irm
Update yidi upgrade (or run the install command again) yidi upgrade (or run the install command again)
Check for an update yidi upgrade --check yidi upgrade --check
Uninstall rm -rf ~/.yidi, then delete the # yidi line and the line below it in your shell profile Remove-Item -Recurse $HOME\.yidi, then remove the entry from your user PATH

Prefer not to pipe a script into your shell? Download the archive for your platform from the latest release, check it against its .sha256 file (sha256sum -c, shasum -a 256 -c or Get-FileHash), extract it and put yidi (or yidi.exe with its yk_ffi_gui.dll) in a folder on your PATH.

What works on each platform

The interpreter (yidi run --interp) works on every platform above. Native compilation (yidi build, yidi run) needs clang++ on Linux and macOS (sudo apt install clang, xcode-select --install), and LLVM with the Visual Studio Build Tools on Windows.

yidi run compiles the program once, caches the binary in ~/.cache/yidi/run, and runs it at native speed: fib(35) takes 0.03 s, the same as rustc -O, against about 14 s in the interpreter. A program the compiler cannot build yet (closures, GUI, FFI), or a machine without a C++ compiler, uses the interpreter instead. yidi run --interp forces the interpreter.

Build from source

Requires Rust stable (via rustup) and a C toolchain: build-essential on Debian/Ubuntu, Xcode Command Line Tools (xcode-select --install) on macOS, Visual Studio Build Tools on Windows.

cargo install --git https://github.com/yidika-lab/yidika yidi

Or from a clone:

git clone https://github.com/yidika-lab/yidika.git
cd yidika
cargo build --release

Usage

# Run a .yk file (interpreter - quiet, just output)
yidi test.yk

# Restart on every save of test.yk or a module it imports (about 0.2 s on Linux)
yidi test.yk --watch

# Build for production
yidi build test.yk

# Projects and packages
yidi init my-app             # new project in ./my-app
yidi init                    # asks for the name; "." means the current folder
yidi add greet               # from the registry, recorded as greet = "^x.y.z"
yidi add greet@^1.2
yidi add github:user/greet   # straight from a git repository
yidi sync                    # install exactly what yidi.lock records
yidi update [greet]          # move to the newest versions the ranges allow
yidi remove greet            # also drops what only greet needed

A package is a git repository whose releases are tags such as v1.2.0 (a repository without tags follows its default branch). Its own project.toml lists its dependencies, which are installed too.

yidi.lock records the exact commit and a SHA-256 of every package; commit it. Downloads go to one cache shared by all projects (~/.cache/yidi/packages on Linux), checked against the lock, and @yidi/<name>/ is made of hard links into it, so a second project or a fresh checkout installs without the network. GitHub packages come as one HTTPS archive instead of a git clone. On Linux, with the cache warm, reinstalling from scratch took 1 ms and a yidi sync with nothing to do 0 ms. yidi init adds @yidi/ to .gitignore.

Publishing

yidi publish --dry-run       # check everything, print the registry entry
yidi publish                 # tag v<version>, push it, open the registry pull request

The registry is the git repository yidika-lab/registry: one small file per package, packages/<name>.toml, with the source repository and, for each release, its commit and SHA-256. yidi add greet reads that one file over HTTPS instead of listing the repository's tags, and refuses a download whose hash differs from the registry. yidi publish needs a [package] section with name and version, a clean working tree, an https (or GitHub SSH) origin, and a <name>.yk or main.yk that type-checks; with the GitHub CLI (gh) logged in it opens the pull request itself, otherwise it prints a link that pre-fills it. Set YIDI_REGISTRY to another URL or to a local folder to use a mirror or a private registry.

Import by package name, as with Node or Python:

use {hello} from "greet";        // @yidi/greet/greet.yk, or @yidi/greet/main.yk
use upper from "greet/text";     // @yidi/greet/text.yk

The search starts in the importing file's folder and walks up to the first @yidi/greet/, so files in subfolders and inside packages resolve the same way. A package only exposes what it declares with export fn. Package names may not be std module names (math, io, ...).

Hello World

Create hello.yk:

fn main() {
    print("Hello, Yidika!");
}

Run it:

yidi hello.yk

More examples

Variables and mutability:

fn main() {
    x: int = 10;      // mutable by default
    x = 6;            // OK

    name: const = "Alice";  // immutable
    // name = "Bob";        // ERROR
}

Functions and control flow:

fn factorial(n: int) -> int {
    if (n <= 1) { return 1; }
    return n * factorial(n - 1);
}

fn main() {
    result: int = factorial(5);
    print(result);  // 120

    for (i in 0..5) {
        print(i);
    }
}

Structs:

struct Person {
    name: str;
    age: int;
}

fn main() {
    p: auto = Person { name: "Alice", age: 30 };
    print(p.name);
}

Project Structure

src/
├── cli/           # CLI argument parsing & command execution
├── diagnostics/   # Error types & source-span tracking
├── interpret/     # Tree-walking interpreter
├── module/        # Module loader (resolve imports, detect cycles)
├── semantic/      # Type checker & environment
│   ├── env.rs     # Symbol table (types & function signatures)
│   └── typeck.rs  # Type inference & checking
└── syntax/        # Lexer, parser, AST, tokens
    ├── ast.rs     # AST node definitions
    ├── lexer.rs   # Tokenizer
    ├── parser.rs  # Recursive-descent Pratt parser
    └── token.rs   # Token enum

Language Specification

Detailed specs are in docs/dev/:

Comparisons with other languages:


Testing

cargo test                    # Run all tests
cargo test --lib              # Unit tests only
cargo check --tests           # Verify tests compile (no linker needed)
cargo clippy                  # Lint checks
cargo run -- test.yk          # Run a .yk file
cargo run -- build test.yk    # Build a .yk file
cargo run -- test.yk --watch  # Watch mode

Roadmap

  • Lexer & Pratt parser
  • AST with span tracking
  • Type checker (env + type inference)
  • Module loader (import resolution, cycle detection)
  • Tree-walking interpreter
  • Code generation (MLIR dialect -> LLVM IR)
  • Full async runtime
  • GPU/NPU backend
  • Package manager
  • Language server (LSP)

Contributing

See CONTRIBUTING.md for guidelines.


License

MIT - see LICENSE.

Copyright (c) 2022 Espoir LOEMBA

yidika dans a été designer et crée dans ses première version en 2022 par Espoir LOEMBA

dont la première version était écrit en Clang comme MVP et écrit totalement en Rust en 2026

About

Yidika: a statically typed language with an interpreter and an LLVM native compiler, for servers and native desktop apps

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages