The MathLang Compiler is an end-to-end compiler designed for scientific computing. It supports matrix operations, loops, arithmetic expressions, and optimizations like loop unrolling and constant folding. This compiler translates mathematical programs written in MathLang into optimized machine code, targeting performance for scientific applications.
- Matrix Operations: Efficient support for matrix multiplication and inversion.
- Optimizations: Loop unrolling, constant folding, dead code elimination.
- Cross-Platform: Supports Linux and can be run in Docker.
- Error Handling: Provides detailed error messages for syntax and semantic errors.
- Clone the repository:
git clone https://github.com/veydantkatyal/math-lang.git
- Install the dependencies(on Ubuntu):
sudo apt-get install flex bison gcc make
- Build the project:
make
- Run the compiler with an example:
./mathlang < tests/test_cases/test1.ml
- Build the Docker image:
docker build -t mathlang-compiler .
- Run the MathLang compiler in a Docker container:
docker run -it mathlang-compiler
- Test cases can be found in the tests/test_cases/ directory. To run a test case:
./mathlang < tests/test_cases/test1.ml
This is project is licensed under MIT License, please go through it carefully, before using it.