Skip to main content

Obsidian is a compiled programming language that combines memory safety, zero-cost abstractions, and minimalist syntax. Built for developers who want the speed of Rust without the boilerplate.

Project description

Obsidian Language v0.0.2

Obsidian is a compiled programming language that combines memory safety, zero-cost abstractions, and minimalist syntax. Built for developers who want the speed of Rust without the boilerplate.

This is a toy implementation (v0.0.1) written in Python. It features a lexer, parser, AST, and a transpiler to Python (which simulates "compilation" by generating and executing equivalent Python code). Published on PyPI as obsidian-lang.

Features (v0.0.2)

  • Minimalist syntax inspired by Rust
  • Variables with let (optional type hints, e.g. let x: int = 5;)
  • Functions with fn
  • Basic expressions + comparison operators (< > <= >= == !=)
  • Control flow with if / else
  • Control flow with while
  • Function calls (including built-in println)
  • Optional semicolons (statements can omit ; at end of line)

v0.0.2 update: Added support for while loops (building directly on v0.0.2a state with optional type hints on let, optional semicolons via _maybe_semi(), and all prior features).

Installation

pip install obsidian-lang

Usage

# After pip install obsidian-lang
obsidian examples/hello.obs --show-code

# Or from source (development)
PYTHONPATH=. python -m obsidian.main examples/hello.obs --show-code

Example (hello.obs)

fn main() {
    let x = 5;
    let y = x + 3;
    println(y);
    println("Hello from Obsidian!");
}

Example (while.obs)

fn main() {
    let i: int = 0
    while i < 3 {
        println(i)
        let i = i + 1
    }
    println("while loop done")
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidian_lang-0.0.3a0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obsidian_lang-0.0.3a0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file obsidian_lang-0.0.3a0.tar.gz.

File metadata

  • Download URL: obsidian_lang-0.0.3a0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for obsidian_lang-0.0.3a0.tar.gz
Algorithm Hash digest
SHA256 a9e700e1fd0b47d388a1eafb71217bf3fd11eff31ea7e3978106f01c68f8c40f
MD5 53c5917a06c092ad60d5dab3be1b9671
BLAKE2b-256 1d491cc24b1bfd8d3b6b952981247f0942c1186fe6e7d46a048ee62b5136547c

See more details on using hashes here.

File details

Details for the file obsidian_lang-0.0.3a0-py3-none-any.whl.

File metadata

File hashes

Hashes for obsidian_lang-0.0.3a0-py3-none-any.whl
Algorithm Hash digest
SHA256 594b27e7f0af8014906a1606946515e80390db17ed9f4f16f683cc40536d8965
MD5 b8d3520bd408d04ac662cc2f874ccb2f
BLAKE2b-256 ebbd4725b71b4aa0363340e7b3c0b62f99b54f8ced320eca02ff9a4ac8f2de94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page