Skip to content

← All updates

session

Update 8: C codegen backend

  • New portable backend: SSA IR → C99 source, compilable with MSVC, GCC, or Clang.
  • Automatic MSVC discovery and environment setup on Windows (find_cl, vcvarsall.bat).
  • Polymorphic print dispatch, struct typedefs, and basic-block goto control flow.
  • Careful renaming to dodge C macro conflicts: main → main_entry, plus #undef guards for MSVC’s max/min/abs.

The C backend doubles as a verification tool: output parity across the interpreter, C, and native backends catches codegen bugs early.