-
-
Notifications
You must be signed in to change notification settings - Fork 1
2. Quick Start
AsynchronousAI edited this page Sep 1, 2025
·
3 revisions
Let us start by writing a simple "Hello, World!" in C!
int printf(const char *, ...);
int main(){
printf("Hello, World!");
return 0;
}Note
Only certain functions are built into the runtime (printf & malloc). Other functions (or custom ones 👀) will need a manual implementation and bindings.
We can then compile into an assembly file:
clang -S -march=rv32imfd -target riscv32-unknown-elf main.c -o main.sCertain parameters like -O3 can also be used to perform assembly level optimizations.
Important
The compiled code MUST be RV32IM which means RISC-V, 32bit, Integer, Multiplication, Floating, Double. In the future floating point & vectors could make an addition.
reasm main.s -o main.luauThese options also exists:
- --comments: This will annotate the generated code with the original ASM instructions.
- --trace: A much more extreme option which will log every update to the Program Counter.
You should now have a main.luau file which when ran successfully prints "Hello, World!"!
