A step-by-step tutorial demonstrating how to use Java's Foreign Function & Memory (FFM) API to call the LLVM C API, generate LLVM intermediate representation (IR) for a "Hello, World!" program, and execute it via JIT compilation. The guide covers installing LLVM, using jextract to generate Java bindings, working with memory segments and arenas, creating modules and functions, building instructions, and ultimately compiling and executing native code directly from Java.

Table of contents
What is LLVM?Installing LLVMLLVM IRWhat is the Java FFM API?Getting startedCreating LLVM bindingsMemory SegmentsCreating an LLVM moduleAdding a main functionAdding an entry basic blockBuilding instructionsGlobal variablesCalling functionsJust-in-time (JIT) CompilationNext stepsSort: