Skip to content

8. Extensions

AsynchronousAI edited this page Sep 2, 2025 · 1 revision

Extensions can be used to provide more functions, usually found in standard C libraries.

Adding an extension.

In your program, attach bindings:

#include <math.h> /* provides much more functions like sin */
#include <stdlib.h> /* provides printf, which is in the default runtime */

int main(){
  printf("%.2f", sin(10));
}

Now when compiling use:

reasm main.s -o main.luau -Imath

and math functions will automatically be attached to the outputted file!

Extensions:

  • math (based on math.h)

Clone this wiki locally