Update README.md

This commit is contained in:
Sofia 2025-07-29 16:08:54 +03:00
parent 7c6d634287
commit ff1da716e9
2 changed files with 25 additions and 19 deletions

View File

@ -157,10 +157,6 @@ cmake llvm -B build -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_ASSERTIONS=ON -D
ninja -j23 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 ### Building this crate itself
Assuming `llvm-project` from the previous step was at 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 LLVM_SYS_201_PREFIX=/path/llvm-project/build cargo build
``` ```
## In conclusion Alternatively assuming you have LLVM 20.1 or newer installed you may use omit
Good luck! It took me a good 10 hours to figure this out for myself, I sure hope the environment variable entirely and use dynamic linking instead
these instructions help both myself and someone else in the future!

View File

@ -8,22 +8,36 @@
//! Much of the syntax in Reid is directly inspired by rust, but mostly it is //! Much of the syntax in Reid is directly inspired by rust, but mostly it is
//! driven by simplicity. //! 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): //! 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 * //! - Resolve complex one-liners correctly using PEDMAS (e.g. `5 + 2 * 5 - 5 *
//! 5` is calculated correctly) //! 5` is calculated correctly)
//! - Handle borrows/derefs, pointers.
//! - Declare and call functions with varying parameters and return types //! - Declare and call functions with varying parameters and return types
//! - Perform type-checking and type-inference such that return-types and //! - Perform type-checking and type-inference such that return-types and
//! parameter types must always match. //! parameter types must always match.
//! - Do simple logic-operations (e.g. If/And/Or) //! - 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 //! ```reid
//! fn main() -> u16 { //! fn main() -> u16 {
//! return fibonacci(5); //! return fibonacci(5);
//! } //! }
//!
//! fn fibonacci(n: u16) -> u16 { //! fn fibonacci(n: u16) -> u16 {
//! if n <= 2 { //! if n <= 2 {
//! return 1; //! return 1;
@ -32,16 +46,13 @@
//! } //! }
//! ``` //! ```
//! //!
//! Currently missing relevant features (TODOs) are: //! TODOs still (see README.md for more)
//! - ~~Arrays~~ (DONE) //! - Error handling
//! - Structs (and custom types as such) //! - Lexing & parsing of whitespace and comments as well
//! - ~~Extern functions~~ (DONE) //! - LSP implementation
//! - ~~Strings~~ (DONE)
//! - Loops
//! - Debug Symbols
//! ``` //! ```
use std::{collections::HashMap, path::PathBuf, thread, time::Duration}; use std::{collections::HashMap, path::PathBuf};
use ast::{ use ast::{
lexer::{self, FullToken, Token}, lexer::{self, FullToken, Token},