{"id":29224704,"url":"https://github.com/adharshkamath/mathy-compiler","last_synced_at":"2025-07-03T06:07:37.080Z","repository":{"id":56425097,"uuid":"271946455","full_name":"adharshkamath/Mathy-Compiler","owner":"adharshkamath","description":"A compiler to generate OpenMP programs for equations involving constructs like Forall, Summation, etc., frequently used in the scientific domain","archived":false,"fork":false,"pushed_at":"2021-05-14T20:10:31.000Z","size":1323,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-06T01:18:56.563Z","etag":null,"topics":["bison","c","compiler","compiler-construction","cpp","equation","flex","lex","mathematical-equation","mathematical-notations","omp-parallel","openmp","openmp-programs","parallelization","transpiler","yacc"],"latest_commit_sha":null,"homepage":"https://adharshkamath.github.io/posts/mathy-compiler-demo/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adharshkamath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-13T05:26:21.000Z","updated_at":"2023-01-31T01:09:47.000Z","dependencies_parsed_at":"2022-08-15T18:30:46.471Z","dependency_job_id":null,"html_url":"https://github.com/adharshkamath/Mathy-Compiler","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/adharshkamath/Mathy-Compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adharshkamath%2FMathy-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adharshkamath%2FMathy-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adharshkamath%2FMathy-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adharshkamath%2FMathy-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adharshkamath","download_url":"https://codeload.github.com/adharshkamath/Mathy-Compiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adharshkamath%2FMathy-Compiler/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263271499,"owners_count":23440396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bison","c","compiler","compiler-construction","cpp","equation","flex","lex","mathematical-equation","mathematical-notations","omp-parallel","openmp","openmp-programs","parallelization","transpiler","yacc"],"created_at":"2025-07-03T06:07:34.477Z","updated_at":"2025-07-03T06:07:37.071Z","avatar_url":"https://github.com/adharshkamath.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mathy Compiler\n\nThis is a compiler to generate OpenMP programs for equations involving constructs like _Forall_, _Summation_ etc., frequently used in the scientific domain.\n\nThis project is written in C++ using Bison and Flex. \n\nFeel free to make a PR or raise an issue if you find any bugs, or if you're interested in making improvements.\n\n## How to use\n\nCompile this project:\n```\ncd source\nmake install\n```\n\nOpen a file and write an equation like this:\n\n```\nmean = sigma(a[i]/100) where 0\u003c=i\u003c=100\n```\n\nOr if you like Unicode characters, \n```\nmean = Σ(a[i]/100) | 0\u003c=i\u003c=100\n```\nThe above equation, when compiled using the above mentioned compiler, will output an OpenMP program that will \n\n- Declare an array `a` of 101 floats\n- Calculate the mean of those 101 elements and store it in the variable `mean`\n- Calculate the time taken to do the above work, including the time for function call\n\nTo generate OpenMP program for the equation:\n```\n./test filename [-o output_filename] [-t data type for variables]\n```\n\nThe equations in [benchmark/source](./benchmark/source) are implementations of programs from [PolyBench/C](https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/).\n\nThe OpenMP outputs for these equations can be found in [benchmark/output](benchmark/output).\n\nTo compile all the source files in [benchmark](./benchmark/), from the root directory, run\n```\npython3 benchmark.py\n```\n\nPlease refer to the [wiki](https://github.com/adharshkamath/Mathy-Compiler/wiki) for the Grammar, Syntax and currently supported features of the project.\n\nThis project was done under the guidance of [Dr. Rupesh Nasre](https://www.cse.iitm.ac.in/~rupesh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadharshkamath%2Fmathy-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadharshkamath%2Fmathy-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadharshkamath%2Fmathy-compiler/lists"}