Skip to content

The MathLang Compiler is an end-to-end compiler designed for scientific computing, supporting features like matrix operations and optimized code generation. It includes advanced optimization techniques for efficient computation and provides a user-friendly interface for compiling mathematical programs.

License

Notifications You must be signed in to change notification settings

veydantkatyal/math-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathLang Compiler

Overview

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.

Features

  • 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.

Installation

Local Installation

  1. Clone the repository:
    git clone https://github.com/veydantkatyal/math-lang.git
  2. Install the dependencies(on Ubuntu):
    sudo apt-get install flex bison gcc make
  3. Build the project:
    make
  4. Run the compiler with an example:
    ./mathlang < tests/test_cases/test1.ml
    

Docker Installation

  1. Build the Docker image:
    docker build -t mathlang-compiler .
  2. Run the MathLang compiler in a Docker container:
    docker run -it mathlang-compiler
    

Running Tests

  1. Test cases can be found in the tests/test_cases/ directory. To run a test case:
    ./mathlang < tests/test_cases/test1.ml
    

LICENSE

This is project is licensed under MIT License, please go through it carefully, before using it.

About

The MathLang Compiler is an end-to-end compiler designed for scientific computing, supporting features like matrix operations and optimized code generation. It includes advanced optimization techniques for efficient computation and provides a user-friendly interface for compiling mathematical programs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published