Added Compiler Initialization Code. #3
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant enhancements to the Delta programming language, including the addition of LLVM-based code generation, new example programs, and updates to the CLI interface. The most important changes focus on enabling compilation to LLVM IR, improving the interpreter, and expanding the language's functionality.
Compiler and Code Generation Enhancements:
inkwelllibrary, with support for compiling expressions, variable declarations, conditional statements, and basic arithmetic operations (src/codegen.rs).CodegenErrorstruct for error handling during code generation and implemented a method to save the generated LLVM IR to a file (src/codegen.rs).CLI Updates:
--compilefor generating LLVM IR and--interpretfor running the interpreter. Default behavior is set to--compile(src/main.rs). [1] [2]--debugmode to print tokens and the AST for debugging purposes (src/main.rs). [1] [2]Example Programs:
compile_test.deto demonstrate arithmetic operations andhello_compiled.deto showcase string output in compiled mode (examples/compile_test.de,examples/hello_compiled.de). [1] [2]Project Configuration:
Cargo.tomlto include theinkwelldependency for LLVM integration and defined the binary target for the Delta compiler (Cargo.toml).These changes lay the groundwork for further expanding Delta's capabilities, particularly in terms of compilation and execution efficiency.