Functional Curiosity

Mathy Compiler Demo

Posted on — Dec 7, 2020

Read more about the syntax and the expected output of the project here.

Note: The output will have additional functions that are useful to measure the time taken. The code for the equations/statements you specify will be put in a function called kernel which will be called from the main function.

The backend for this page is hosted on Heroku under a free tier so it’s put to sleep if it’s inactive for an extended duration. If you don’t get any output even after 30-35s, please refersh the page and try once again.

Useful symbols:
|

OpenMP output will appear here!

Examples:

(Paste these in the input box above and get the output)

Calculating mean:

mean = sigma (a[i]/100) | 0 <=i< 100

Matrix multiplication:

forall (i) | 0 <= i <= 600 {
  forall (j) | 0 <= j <= 800 {
      c[i][j] = sigma (a[i][k] * b[k][j]) | 0<= k <=200
    }
}

You can find more examples of some real equations here.

Please raise an issue on GitHub if you find any bugs.

Tags: