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

Uploaded Python 3

File details

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

File metadata

  • Download URL: obsidian_lang-0.0.3rc0.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.3rc0.tar.gz
Algorithm Hash digest
SHA256 eee5c50a70ab1323b0e4ab00fc47976e954b42e0e03503bbe7897ad57c1faffd
MD5 a8914a5e8a988513a5ed3e837e94c8e6
BLAKE2b-256 cbebbb155acacdc650657cc376f487c0c69f1a2b374c7b17d087341d290f2579

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for obsidian_lang-0.0.3rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 557825010eda2686bc407d23122532fe6bc98c1c95ee8e63f2aa6d77fedbf359
MD5 5a93c0eca0778241a974d6acd73a4b7d
BLAKE2b-256 7504e1476459440483c6e6ba5f02b9b8def2a2e5d21a87c0fd41c94e32352441

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