Skip to content

LLM Explainer v1.9.0

Latest

Choose a tag to compare

@pgarba pgarba released this 21 Jul 08:59

Builds on the C export added in v1.8.0: the generated code is now checked by a real compiler, and can be opened straight in Compiler Explorer.

Features

  • Compiler-verified export — after each answer the generated files are syntax-checked with a real compiler. If it fails, the diagnostics go straight back to the model with an instruction to fix them and re-emit the files, for a configurable number of automatic rounds (default 2) — so a missed intrinsic or an undeclared helper is corrected before you ever see it.
    • What gets compiled is the current tab contents, not the raw reply, so the compiler judges exactly what you can see and save — and the feedback turn restates those files, so your hand-edits aren't silently discarded.
    • Verify Now re-checks the tabs without spending a fix round, for validating your own edits.
    • Finds clang on PATH or in the usual places per platform: the copy Visual Studio bundles and C:\Program Files\LLVM on Windows, Xcode / the command line tools / Homebrew LLVM on macOS, /usr/lib/llvm-* and versioned clang-NN on Linux — then a system gcc/cc. Versioned installs are compared numerically, so clang-14 beats clang-9.
    • Syntax-only by construction: -fsyntax-only is forced on and -c/-S/-emit-llvm stripped even from flags you edit, so LLM-written code is parsed and type-checked but never assembled, linked or executed.
  • Open in Compiler Explorer — folds the .h/.c into one translation unit (each local #include replaced by that file's contents, once, cycle-safe) and opens it on godbolt.org with your compiler and flags preselected, to try other toolchains and read the generated assembly. Small sessions ride inside the URL; larger ones use the shortener.
    • This is the only feature that sends anything off your machine. It is button-only, always confirms first, names the destination, and says whether the code merely rides in the link or gets uploaded to a public, permanent short link. Point Compiler Explorer URL at a self-hosted instance to keep it internal.

Settings

Verify exported C with a compiler (on), C compiler path (blank = auto-detect), Compile check flags (-fsyntax-only -std=c11 -Wall), Max compile fix rounds (2), Compiler Explorer URL / compiler / flags (https://godbolt.org, cclang2010, -std=c11 -Wall).

Notes

Verified against the real things rather than assumed: clang and MSVC compile the prescribed output clean, the compile-check path was exercised with actual clang runs (valid code, broken code, header-only replies, missing compiler, forced flags), platform detection was tested against simulated Windows/macOS/Linux layouts, and a URL built by this code loads as a working Compiler Explorer session.