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

Uploaded Python 3

File details

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

File metadata

  • Download URL: obsidian_lang-0.0.3b0.tar.gz
  • Upload date:
  • Size: 8.6 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.3b0.tar.gz
Algorithm Hash digest
SHA256 271838508616a3be95f0eafcdc5d9998a882a84b5b0bb3b2120a281943bf75a3
MD5 7df9a2751fc5a7bdf50c6fcbc955fb2f
BLAKE2b-256 7b48d7be4c688419a9dfedf9e31248541e467b2310675f0d393e83d512ebc807

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for obsidian_lang-0.0.3b0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d71209589d21f2b922566ca8b1fb9f01907bc0db29f18e684b4a9a357093f64
MD5 f8d2deeab9244602ee208c2b8c3745e8
BLAKE2b-256 6e655f9eef7a63785b23380f541f55dde49cc7e7c7971dbd0e9faf447d3892cc

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