HooDA is a statically typed programming language designed for efficient execution on a custom stack-based Virtual Machine with JIT compilation and Garbage Collection support.
- Syntax: Classic C/Java-style syntax with standard control structures (
if,while,for,return). - Type System: Strongly typed. Supports
int(signed 64-bit),bool, and reference-based arrays (int[],bool[]). - Memory Management: Automatic memory management via a Mark-and-Sweep Garbage Collector. Arrays are allocated on the heap.
- Virtual Machine: Stack-based architecture using Tagged Pointers to distinguish between primitives (Tag=0) and references (Tag=1).
- Performance:
- AOT approach: Provides up to 20x performance improvement.
- JIT compilation: Provides ~3x average performance improvement for hot paths.
- Built-ins (Intrinsics):
print(val): Output value to stdout.len(arr): Get the length of an array.sqrt_upper(val): Calculate ceiling square root.rand(min, max): Generate a random integer in the range[min, max].
cmake -B build && cmake --build buildBinaries comp-hooda and vm-hooda are created in the project root:
-
Compilation:
./comp-hooda <path/to/program.txt> [path/to/result.bin]
Example:
./comp-hooda programs/task1.txt
Creates
programs/task1.binnext to the source file. -
Execution:
./vm-hooda <path/to/program.bin> [--no-jit]
Example:
./vm-hooda programs/task1.bin
Runs
programs/task1.binwith JIT optimizations enabled.
ctest --test-dir build