RUst way for Reuse Analysis.
Rura is a purely functional Rust dialect, optimized through reuse analysis and more.
- Seamless interpolation with Rust via code generation, while reusing other useful constructs like the trait system
- Rust-native reference counting for memory management
- Frame-limited reuse analysis, eliminating many of the allocations and other slow paths
- Uniqueness types (new!) could boost the performance by getting rid of unnecessary refcount
- More scalar types are available without any boxing
In Koka and Lean, reuse analysis is supported by a lightweight runtime with reference counting and type-erased objects. This project attempts to create a functional programming language that directly lowers into Rust. In this way, we can explore the possibility to embed reuse analysis into higher-level languages.
We implement the reuse analyzer based on:
Uniqueness type and its linearity checking from:
Additionally, the idea of reduce duplication and improve sharing has also been discussed in some other situations:
- Surface Syntax Specification (TODO)
- Types
- Ownership Model
- Linearity/Exclusivity
- Closures
- Lowering