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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file obsidian_lang-0.0.2.tar.gz.
File metadata
- Download URL: obsidian_lang-0.0.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f40e10a33aa741f3c1f5ef94ff0e27b73e0769127491568e1ab72916a7dc165
|
|
| MD5 |
38a9357aef4bfabdbff8eae4408d8202
|
|
| BLAKE2b-256 |
eb8685bb9571b4d25fcb3b672a35ceb8a37a2c0deeaebf383f5922b027e826d6
|
File details
Details for the file obsidian_lang-0.0.2-py3-none-any.whl.
File metadata
- Download URL: obsidian_lang-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1efb5b7f5ea73682f32191ae7f98419db2123e47594ff87c07c9af0e6e86a35d
|
|
| MD5 |
6bb0576ccc4c21909630afaae70f141c
|
|
| BLAKE2b-256 |
94bbdff60189db69adcd5bcf9ca266a88200e4fead638c08c3e7e914b2698d5f
|