Oxur
Oxur: A Lisp dialect that treats Rust as its compilation target and runtime
This is the umbrella crate for the Oxur project, providing convenient access to all major components of the Oxur ecosystem.
Overview
Oxur is a Lisp dialect designed to leverage Rust's type system, ownership model, and ecosystem while providing Lisp's expressiveness and metaprogramming capabilities.
Key Philosophy: Write Rust code using Lisp syntax with 100% bidirectional interoperability.
Architecture
The Oxur compilation pipeline consists of five stages:
┌─────────────────────────────────────────────────────────────────┐
│ OXUR COMPILATION PIPELINE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Oxur Source (Lisp) │
│ ↓ │
│ ┌──────────────────┐ │
│ │ oxur-lang │ Stage 1: Parse → Surface Forms │
│ │ (Lisp Compiler) │ Stage 2: Expand → Core Forms (IR) │
│ └──────────────────┘ │
│ ↓ │
│ Core Forms (Canonical S-expressions) │
│ ↓ │
│ ┌──────────────────┐ │
│ │ oxur-comp │ Stage 3: Lower → Rust AST │
│ │ (Backend) │ Stage 4: Codegen → Rust Source │
│ └──────────────────┘ Stage 5: Compile → Binary (via rustc) │
│ ↓ │
│ Rust Binary │
│ │
│ ┌──────────────────┐ │
│ │ oxur-ast │ Supporting: Bidirectional Rust AST ↔ │
│ │ (AST Library) │ S-expression conversion │
│ └──────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Components
This umbrella crate re-exports the following components:
- oxur-lang: The Oxur Lisp compiler (stages 1-2)
- oxur-comp: The backend compiler (stages 3-5)
- oxur-ast: Bidirectional Rust AST ↔ S-expression conversion
- oxur-repl: Interactive REPL server/client
- oxur-cli: Common CLI utilities and infrastructure
- oxur-pretty: Pretty printing for code and data structures
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Usage
use *;
// API examples will be added as the project matures
Design Principles
- 100% Rust Interoperability - Can call any Rust code, Rust can call any Oxur code
- Rust Semantics, Lisp Syntax - Not Lisp semantics adapted to Rust
- Canonical S-expressions - Single authoritative format for AST representation
- Round-trip Preservation - X → transform → X must preserve meaning
- Type-First Design - Leverage Rust's type system fully
Project Status
Oxur is in active development. Different components are at various stages:
- oxur-ast: ~80% complete, functional conversion
- oxur-lang: Planning stage
- oxur-comp: Planning stage
- oxur-repl: Planning stage
- oxur-cli: Early stage, utilities available
Resources
- Repository: github.com/oxur/oxur
- Documentation: docs.rs/oxur
- Design Documents: Design Docs
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.