Skip to content

Repository files navigation

Rustic++

A programming language where C, C++, and Rust libraries are first-class citizens.

The Big Idea

Rustic++ automatically generates bindings for C, C++, and Rust libraries, allowing you to import and use them as if they were native code:

import "raylib.h" as raylib;
fn main() -> Int {
raylib.init_window(800, 600, "Hello");
return 0;
}

No hand-written #[extern "C"] glue. No manual binding code. Just import and use.

Status

Phase 1: Lexer, Parser, AST ✅ Complete

The foundation is built:

  • Hand-written lexer with full token support
  • Recursive descent parser with operator precedence
  • AST representation for all language constructs
  • 20+ example programs parsing successfully

Project Structure

rustic-plusplus/
├── compiler/ # lexer, parser, type checker, IR
├── interp/ # tree-walking interpreter (Phase 2)
├── codegen/ # native x86-64 backend (Phase 5)
├── runtime/ # GC, FFI bridge, dynamic loader
├── bindgen-c/ # C header → bindings (Phase 4)
├── bindgen-cpp/ # C++ class → shim generator (Phase 6)
├── bindgen-rust/ # Rust source → extern "C" wrapper (Phase 7)
├── stdlib/ # standard library
├── examples/ # one example program per phase
└── docs/ # documentation

Building

cargo build --package rustic-compiler
./target/debug/rcpp examples/phase1/basic_math.rcpp

Roadmap

PhaseDescriptionStatus
0Proof of concept (trilang-poc)
1Lexer, Parser, AST
2Tree-walking interpreter🔄
3Type system & semantic analysis
4C interop
5Native codegen
6C++ interop
7Rust interop
8Garbage collector & memory model
9Tooling & build system
10Flagship demo & v1.0

License

MIT

About

Rustic++ - A programming language where C, C++, and Rust libraries are first-class citizens with automatic binding generation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages