Skip to content

Code Generation

JAFF can turn any loaded network into ready-to-compile/run source files in C, C++, Fortran, Python, Rust, Julia, or R. The generation pipeline is template-driven: you write ordinary source files that contain special JAFF directives, and JAFF expands them into network-specific code.

  • Template Syntax


    Learn the $JAFF directive language: SUB, REPEAT, REDUCE, GET, HAS, END, and the optional REPLACE modifier.

    Template Syntax

  • Configuration File


    Configure jaffgen runs declaratively with a jaff.toml file: set network paths, template names, output directories, radiation bands, and data-table conversions.

    Configuration File

  • jaffgen CLI


    Run the code-generation pipeline from the command line. Combine predefined templates, custom input directories, and individual files in a single invocation.

    jaffgen CLI

  • Table Interpolation


    Use precomputed lookup tables in rates and cooling: how interp functions in .jfunc are preserved through codegen, how their Jacobian derivatives become _partial_N calls, and how [[table]] emits the data.

    Table Interpolation