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.3

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.3)

  • 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
  • Boolean literals (true/false) and logical operators (and, or, not)
  • Line comments (# ... to end of line)
  • Function calls (including built-in println)
  • Optional semicolons (statements can omit ; at end of line)

v0.0.3 update: Added support for line comments (# ...). Added boolean literals (true/false) and logical operators (and/or/not).

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")
}
# top level comment
fn main() {
    let x = 42  # trailig comment
    # comment inside function
    println(x)  # should print 42
    let y = true  # bool with comment
    if y {
        println("ok")  # if comment
    }
}

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.3.tar.gz (8.7 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.3-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: obsidian_lang-0.0.3.tar.gz
  • Upload date:
  • Size: 8.7 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.3.tar.gz
Algorithm Hash digest
SHA256 09e65522ebbea55d93a5993a7beeddfb2d2967732a803b8e7682a35d0dceb103
MD5 0b62b498417c5d86926227b56feb0ee1
BLAKE2b-256 29626a4037bb1ca1b741ed09b4d1ac6d8114483bd974b0e32e6da4e0d91f00ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: obsidian_lang-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for obsidian_lang-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5aa86d65ac79d1a4f5a0fd481a5d858367a2dbca8c0dcc74423aa84c2cf7ecea
MD5 6ae3d67e31533cf360701769e90a7112
BLAKE2b-256 e31c3d40dfeb309e215dae5c097447d5630f66bd17fd6e903ceba797030ad50e

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