Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a8255f3
chore: updated the readmes
Zffu Apr 9, 2026
41264a0
feat: added use statement AST
Zffu Apr 9, 2026
7684b3c
feat: added use statement handling in parser context
Zffu Apr 9, 2026
d8a9e2d
feat: added basic handling for use statements
Zffu Apr 9, 2026
dbbd56a
feat: got use statements working
Zffu Apr 9, 2026
385f340
push
Zffu Apr 13, 2026
dfd421e
feat: made function work
Zffu Apr 13, 2026
a6a5aa6
feat: made using use functions easier with auto type importing
Zffu Apr 13, 2026
40482a6
feat: update workflow
Zffu Apr 13, 2026
5510645
feat: added llvm as an optional package
Zffu Apr 13, 2026
d83934e
chore: removed all of the warnings
Zffu Apr 13, 2026
1a96ccc
chore: updated the github workflow
Zffu Apr 13, 2026
477cf57
Merge pull request #85 from Quickfall/feat/use
Zffu Apr 13, 2026
47d3b9a
feat: added compiler_diagbacktraces feature to enable backtraces on d…
Zffu Apr 13, 2026
6804a21
feat: made diagbacktraces feature automatically enable rust backtrace…
Zffu Apr 13, 2026
b7a6e4f
feat: removed opÃerator parsing from lexer for more parsing freedom
Zffu Apr 13, 2026
fde3e02
feat: added AST side operator parsing
Zffu Apr 13, 2026
1beab3f
feat: fully migrated operators to AST
Zffu Apr 13, 2026
2561e9c
feat: added new MathOperator struct instead of two seperate fields
Zffu Apr 13, 2026
562b66f
feat: added tidle token
Zffu Apr 13, 2026
14963c8
feat: added fast parsing
Zffu Apr 13, 2026
b46a36c
feat: added shifting operators parsing
Zffu Apr 13, 2026
4cf4391
feat: added MIR bridge support
Zffu Apr 13, 2026
a9223e7
feat: added modulo operator
Zffu Apr 13, 2026
fcf5366
feat: added mod operator
Zffu Apr 13, 2026
2370907
feat: added mod operator in LLVM bridge
Zffu Apr 13, 2026
a820db9
feat: added fast math flags on MIR instructions
Zffu Apr 14, 2026
434c1bd
feat: added fast math to llvm bridge
Zffu Apr 14, 2026
a19bfd6
feat: added int fastmath
Zffu Apr 14, 2026
d47924a
Merge pull request #86 from Quickfall/chore/ast-operators
Zffu Apr 14, 2026
64b5052
Merge pull request #87 from Quickfall/chore/ast-operators
Zffu Apr 14, 2026
2a42255
feat: added field usage count tracking
Zffu Apr 14, 2026
37595c3
feat: added global scope storage
Zffu Apr 14, 2026
f6ddd98
feat: added Display to entries
Zffu Apr 15, 2026
239cae0
feat: added getters to the GlobalScopeStorage to enforce entry type
Zffu Apr 15, 2026
50217ba
feat: added new prelude crate
Zffu Apr 15, 2026
5faa326
feat: added prelude apply on HIR
Zffu Apr 15, 2026
aeafba1
feat: added sample types in prelude
Zffu Apr 19, 2026
73587f1
chore: added dummy origin for prelude applying
Zffu Apr 19, 2026
a1e27cf
chore: added global scope crate
Zffu Apr 20, 2026
7deb23c
feat: added global scope storage definition
Zffu Apr 20, 2026
2ae03b4
feat: added binding in compiler_typing
Zffu Apr 20, 2026
c9ecc43
feat: changed to use indexes for non type items
Zffu Apr 20, 2026
fb8bfdc
feat: added util conversion functions on GlobalStorageEntry
Zffu Apr 20, 2026
0e62c74
chore: formatted everything using rustfmt
Zffu Apr 20, 2026
c55ffad
fix: fixed HIR
Zffu Apr 20, 2026
fbbfd62
fix: fixed MIR
Zffu Apr 20, 2026
cdda6e6
fix: fixed up global scope to work
Zffu Apr 21, 2026
c61815f
feat: added global scope HIR version
Zffu Apr 21, 2026
fd4d5e8
feat: added HIR scope append functions
Zffu Apr 21, 2026
51e9199
feat: added getters
Zffu Apr 21, 2026
a3420cf
fix: fixed some errors
Zffu Apr 21, 2026
1022eb9
fix: fixed some errors
Zffu Apr 21, 2026
52e7053
feat: added branched contexts inside of HIR global scope
Zffu Apr 21, 2026
d1eb351
feat: cleaned HIR Context out of global scope contained elements
Zffu Apr 21, 2026
7276b82
feat: cleaned nodes to use global scope
Zffu Apr 21, 2026
005a2fc
feat: lowered HIR functions to global scope
Zffu Apr 21, 2026
586eab1
fix: fixed HIR lowering layer from errors
Zffu Apr 21, 2026
1a77fbc
fix: fixed MIR lowering layer
Zffu Apr 21, 2026
d4a54a0
feat: added getters for function ctx
Zffu Apr 21, 2026
7b5fa0b
feat: added append half function method
Zffu Apr 21, 2026
0cb18fb
fix: added fixes for global scope
Zffu Apr 21, 2026
0e92465
feat: prevented global scope -> local scope duplicate entries by chec…
Zffu Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Compile (No bridges)

on:
pull_request:
Expand All @@ -15,4 +15,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
run: cargo build -p compiler_main
4 changes: 2 additions & 2 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ git clone https://github.com/Quickfall/quickfall
```

You will need the following installed in order to compile & use Quickfall:
- Rust 1.91.1
- LLVM 21.1
- Rust 1.94.1
- LLVM 22.1

You can then build the project by using the `cargo` Rust tool.
26 changes: 25 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[workspace]
members = ["compiler/ast", "compiler/ast_parser", "compiler/astoir", "compiler/astoir_hir", "compiler/astoir_hir_lowering", "compiler/astoir_mir", "compiler/compiler_typing", "compiler/astoir_mir_lowering", "compiler/compiler_main", "compiler/compiler_utils", "compiler/llvm_ir_bridge", "compiler/diagnostics"]
members = ["compiler/ast", "compiler/ast_parser", "compiler/astoir", "compiler/astoir_hir", "compiler/astoir_hir_lowering", "compiler/astoir_mir", "compiler/compiler_typing", "compiler/astoir_mir_lowering", "compiler/compiler_main", "compiler/compiler_utils", "compiler/llvm_ir_bridge", "compiler/diagnostics", "compiler/prelude", "compiler/compiler_global_scope"]
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Quickfall is a programming language focusing on allowing everyone to build fast
Quickfall aims to give the performance of extremely fast languages like C while giving the safety of Rust and also being reliable.

What Quickfall focuses on:
- **Speed**: Quickfall focuses on runtime speed which means that every single compile time safety check can be simply disabled either globally or for a single element. On recent benchmarks, Quickfall has surpassed C in terms of runtime speed by up to 25%!
- **Speed**: Quickfall focuses on runtime speed which means that every single compile time safety check can be simply disabled either globally or for a single element.
- **Feature filled**: Quickfall gives multiple useful features to build reliable software such as enums or arbitrary size types
- **Strict syntax**: Quickfall enforces a strict syntax to avoid mistakes or error prone code
- **Safety**: Quickfall enforces strict safety features on compile time and optional ones on runtime that can be easily disabled to allow for the highest safety or speed depending on the build
- **Thread safety**: Quickfall gives tools to enforce thread safety mostly on compile time such as the *thread markers* to identify and restrict variables to only certain threads
- **Mutlipurpose**: Quickfall can both be used to build low level and high level software with different level of tools.
36 changes: 20 additions & 16 deletions compiler/ast/src/ctx.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
use std::{collections::HashMap};
use std::collections::HashMap;

use crate::tree::ASTTreeNode;

#[derive(Debug)]
pub struct ParserCtx {
pub map: HashMap<String, Box<ASTTreeNode>>,
pub iter_order: Vec<String>
pub map: HashMap<String, Box<ASTTreeNode>>,
pub uses: Vec<Box<ASTTreeNode>>,
pub iter_order: Vec<String>,
}

impl ParserCtx {
pub fn new() -> Self {
return ParserCtx { map: HashMap::new(), iter_order: Vec::new() }
}
pub fn new() -> Self {
return ParserCtx {
map: HashMap::new(),
iter_order: Vec::new(),
uses: vec![],
};
}

pub fn insert(&mut self, name: String, node: Box<ASTTreeNode>) -> bool {
if !node.kind.is_tree_permissible() {
return false;
}
pub fn insert(&mut self, name: String, node: Box<ASTTreeNode>) -> bool {
if !node.kind.is_tree_permissible() {
return false;
}

self.iter_order.push(name.clone());
self.iter_order.push(name.clone());

self.map.insert(name, node);
return true;
}

}
self.map.insert(name, node);
return true;
}
}
5 changes: 3 additions & 2 deletions compiler/ast/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//!
//! The AST module of Quickfall. Contains all of the AST code required for the Quickfall language.
//!
//!

pub mod tree;
pub mod ctx;
pub mod operators;
pub mod tree;
pub mod types;
110 changes: 110 additions & 0 deletions compiler/ast/src/operators.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
//! Operator related utils

use compiler_utils::operators::{ComparingOperator, MathOperator, MathOperatorType};
use diagnostics::{DiagnosticResult, builders::make_unexpected_simple_error};
use lexer::token::{LexerToken, LexerTokenType};

pub fn parse_math_operator(
tokens: &Vec<LexerToken>,
ind: &mut usize,
) -> DiagnosticResult<MathOperator> {
let op = match tokens[*ind].tok_type {
LexerTokenType::Plus => MathOperatorType::Add,
LexerTokenType::PercentSign => MathOperatorType::Modulo,
LexerTokenType::Minus => MathOperatorType::Subtract,
LexerTokenType::Asterisk => {
if tokens[*ind + 1].tok_type == LexerTokenType::Asterisk {
*ind += 1;

MathOperatorType::ShiftLeft
} else {
MathOperatorType::Multiply
}
}
LexerTokenType::Divide => {
if tokens[*ind + 1].tok_type == LexerTokenType::Divide {
*ind += 1;

MathOperatorType::ShiftRight
} else {
MathOperatorType::Divide
}
}

_ => {
return Err(make_unexpected_simple_error(&tokens[*ind], &tokens[*ind].tok_type).into());
}
};

*ind += 1;

let assigns = match tokens[*ind].tok_type {
LexerTokenType::EqualSign => true,
_ => false,
};

if assigns {
*ind += 1;
}

let fast = match tokens[*ind].tok_type {
LexerTokenType::Tidle => true,
_ => false,
};

if fast {
*ind += 1;
}

return Ok(MathOperator {
operator: op,
assigns,
fast,
});
}

pub fn parse_compare_operator(
tokens: &Vec<LexerToken>,
ind: &mut usize,
) -> DiagnosticResult<ComparingOperator> {
let eq = match tokens[*ind + 1].tok_type {
LexerTokenType::EqualSign => true,
_ => false,
};

let op = match tokens[*ind].tok_type {
LexerTokenType::EqualSign => {
tokens[*ind + 1].expects(LexerTokenType::EqualSign)?;

ComparingOperator::Equal
}

LexerTokenType::ExclamationMark => {
tokens[*ind + 1].expects(LexerTokenType::EqualSign)?;

ComparingOperator::NotEqual
}

LexerTokenType::AngelBracketOpen => {
if eq {
ComparingOperator::LowerEqual
} else {
ComparingOperator::Lower
}
}

LexerTokenType::AngelBracketClose => {
if eq {
ComparingOperator::HigherEqual
} else {
ComparingOperator::Higher
}
}

_ => {
return Err(make_unexpected_simple_error(&tokens[*ind], &tokens[*ind].tok_type).into());
}
};

return Ok(op);
}
Loading
Loading