diff --git a/reid/src/lib.rs b/reid/src/lib.rs index 8dd6b3c..fd648a4 100644 --- a/reid/src/lib.rs +++ b/reid/src/lib.rs @@ -1,3 +1,35 @@ +//! Reid is a toy-language compiler I'm working on to learn LLVM (and compiler +//! development). +//! +//! Reid only uses [llvm-sys](https://gitlab.com/taricorp/llvm-sys.rs), which +//! provide very minimal bindings from the LLVM C-API to Rust. `reid_llvm`-crate +//! contains the relevant abstraction to produce a more Rust'y API from that. +//! +//! Much of the syntax in Reid is directly inspired by rust, but mostly it is +//! driven by simplicity. +//! +//! Currently missing relevant features (TODOs) are: +//! - Arrays +//! - Structs (and custom types as such) +//! - Extern functions +//! - Strings +//! - Loops +//! +//! An example program of Reid, that calculates the 5th fibonacci number (and +//! uses Rust for highlighting) is: +//! ```rust +//! fn main() -> u16 { +//! return fibonacci(5); +//! } +//! +//! fn fibonacci(n: u16) -> u16 { +//! if n <= 2 { +//! return 1; +//! } +//! return fibonacci(n-1) + fibonacci(n-2); +//! } +//! ``` + use mir::typecheck::TypeCheck; use reid_lib::Context; @@ -11,13 +43,6 @@ mod pad_adapter; mod token_stream; mod util; -// TODO (Missing Relevant Features): -// - Arrays -// - Structs (and custom types as such) -// - Extern functions -// - Strings -// - Loops - #[derive(thiserror::Error, Debug)] pub enum ReidError { #[error(transparent)]