Skip to content

Conversation

@PranavVerma-droid
Copy link
Member

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:

  • Introduced LLVM-based code generation using the inkwell library, with support for compiling expressions, variable declarations, conditional statements, and basic arithmetic operations (src/codegen.rs).
  • Added a CodegenError struct for error handling during code generation and implemented a method to save the generated LLVM IR to a file (src/codegen.rs).

CLI Updates:

  • Enhanced the CLI to support two modes: --compile for generating LLVM IR and --interpret for running the interpreter. Default behavior is set to --compile (src/main.rs). [1] [2]
  • Added a --debug mode to print tokens and the AST for debugging purposes (src/main.rs). [1] [2]

Example Programs:

  • Added two example programs: compile_test.de to demonstrate arithmetic operations and hello_compiled.de to showcase string output in compiled mode (examples/compile_test.de, examples/hello_compiled.de). [1] [2]

Project Configuration:

  • Updated Cargo.toml to include the inkwell dependency 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.

@PranavVerma-droid PranavVerma-droid merged commit 97692bd into master Aug 2, 2025
0 of 4 checks passed
@PranavVerma-droid PranavVerma-droid deleted the compiler-init branch August 2, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants