From ff1da716e93c7d55f28ed86da545b70bd7ca9d12 Mon Sep 17 00:00:00 2001 From: sofia Date: Tue, 29 Jul 2025 16:08:54 +0300 Subject: [PATCH] Update README.md --- README.md | 9 ++------- reid/src/lib.rs | 35 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 93b53f0..eac9612 100644 --- a/README.md +++ b/README.md @@ -157,10 +157,6 @@ cmake llvm -B build -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_ASSERTIONS=ON -D ninja -j23 ``` -*Also Note:* Building LLVM with `Ninja` was not successful for me, but this -method was. Ninja may be successful with you, to try it, add `-G Ninja` to the -`cmake`-command, and instead of `make` run `ninja install`. - ### Building this crate itself Assuming `llvm-project` from the previous step was at @@ -170,6 +166,5 @@ Assuming `llvm-project` from the previous step was at LLVM_SYS_201_PREFIX=/path/llvm-project/build cargo build ``` -## In conclusion -Good luck! It took me a good 10 hours to figure this out for myself, I sure hope -these instructions help both myself and someone else in the future! \ No newline at end of file +Alternatively assuming you have LLVM 20.1 or newer installed you may use omit +the environment variable entirely and use dynamic linking instead \ No newline at end of file diff --git a/reid/src/lib.rs b/reid/src/lib.rs index fd19912..8acf343 100644 --- a/reid/src/lib.rs +++ b/reid/src/lib.rs @@ -8,22 +8,36 @@ //! Much of the syntax in Reid is directly inspired by rust, but mostly it is //! driven by simplicity. //! +//! Specifications and a bunch of [documentation for the language can be found +//! here](./documentation/). +//! +//! An example of a real whole program (a CPU pathtracer) can be found [in +//! examples/cpu_raytracer.reid](./examples/cpu_raytracer.reid), go have a look! +//! //! Reid is currently able to (non-exhaustively): -//! - Do basic algebra (e.g. Add, Sub, Mult) +//! - Do basic algebra binary and unary-operations (e.g. Add, Sub, Div, Mult, +//! And, Not) //! - Resolve complex one-liners correctly using PEDMAS (e.g. `5 + 2 * 5 - 5 * //! 5` is calculated correctly) +//! - Handle borrows/derefs, pointers. //! - Declare and call functions with varying parameters and return types //! - Perform type-checking and type-inference such that return-types and //! parameter types must always match. //! - Do simple logic-operations (e.g. If/And/Or) +//! - Handle, access, define and initialize structs and arrays. +//! - Define and execute For/While loops +//! - Output detailed debug information +//! - Define extern functions that can be linked to outside modules such as +//! `libc`. +//! - Define custom binary operations for any two types that hasn't been defined +//! previously (such as `u16 + u32`). //! -//! An example program of Reid, that calculates the 5th fibonacci number (and -//! uses Rust for highlighting) is: +//! +//! An example program of Reid, that calculates the 5th fibonacci number: //! ```reid //! fn main() -> u16 { //! return fibonacci(5); //! } -//! //! fn fibonacci(n: u16) -> u16 { //! if n <= 2 { //! return 1; @@ -32,16 +46,13 @@ //! } //! ``` //! -//! Currently missing relevant features (TODOs) are: -//! - ~~Arrays~~ (DONE) -//! - Structs (and custom types as such) -//! - ~~Extern functions~~ (DONE) -//! - ~~Strings~~ (DONE) -//! - Loops -//! - Debug Symbols +//! TODOs still (see README.md for more) +//! - Error handling +//! - Lexing & parsing of whitespace and comments as well +//! - LSP implementation //! ``` -use std::{collections::HashMap, path::PathBuf, thread, time::Duration}; +use std::{collections::HashMap, path::PathBuf}; use ast::{ lexer::{self, FullToken, Token},