This project contains the custom Flint Compiler built in C++. The Compiler is not (yet) ready to be made public. Currently, the Tokenizer (Lexer) and AST Generation (Parser) are working.
- Tokenizer (Lexer)
- AST Generation (Parser)
- IR Generation (Generator)
- Comprehensive Compile Error output (Error)
- Semantics Checking Stage (Checker / Linter)
- Linking of IR Files (Linker)
- Fetching libraries from FlintHub (Fetcher)
- Creation and Management of dependencies (Resolver)
- Compilation of IR code to a binary (Compiler)
Currently, only the most basic features are working:
- Declaring functions (main and custom ones)
- Calling functions (n arguments, currently only 1 return value)
- Catching errors of functions (
catch
keyword) if
chains (if
,else if
,else
)while
loopsfor
loops- The builtin
print
function, with overloaded variants to printi32
,flint
,str
andbool
variables or literals - safe
i32
,i64
,u32
,u64
,f32
andf64
variables, addition, substraction and multiplication - implicit primitive type conversions
- explicit primitive type conversions (
i32(f32(5))
) str
variables, alltough currently not able to be changedbool
variables
- Calling functions as expressions (as the condition of the while loop, or in binary operations), but when the function is the only thing on the RHS of an assignment or declaration, it works fine!
flint
variables dont behave as expected and are always wrong- enhanced
for
loops (because arrays dont exist yet, because DIMA doesnt exist yet) - Arrays
[]
- The optional type
- Custom
error
sets enum
typevariant
type- Unary operators such as
++
or--
- The pow operator
**
- Everything about DIMA (
str
manipulation,data
saving, memory management overall) - Everything about DOCP (
data
,func
,entity
,link
) - etc.
You need nkx
installed on your machine (https://nix.dev/install-nix.html).
The build process then is easy. Just clone the flintc
repository and execute
nix-shell
in the base directory (if you have nix installed). This will result in the correct packages and dependencies being fetched. When inside the nix-shell, execute
./scripts/build.sh
to build the project. You can optionally add the debug
option when calling the build script, it then will create a debug build.
You could also, alternatively, ensure manually that all dependencies are installed and just call the build script without nix
.
To get correct highlighting and code completion of llvm-stuff, look at this Readme!