Skip to content

Compiler pipeline

CL++ is a source-to-source compiler. Pest parses .clpp / .clh / .clp. Analysis builds scopes and feeds the editor. Codegen writes Luau. There is no CL++ virtual machine, no opcode table, and no C++ embedding API — host tools call clpp compile or clpp api compile.

How this maps to the Luau repo: Luau engineering map.

flowchart TD
  src["Source .clpp / .clh / .clp"] --> pp["Preprocessor includes and pragma"]
  pp --> pest["Pest grammar"]
  pest --> ast["AST plus spans"]
  ast --> analysis["Analysis: check, symbols, complete_at"]
  analysis --> emit["Luau codegen"]
  emit --> out[".luau file"]
  analysis --> api["clpp api complete / hover / symbols"]
  api --> lsp["editors/vscode LSP"]
  out --> rojo["Rojo / Cluaupp"]
StageWhereOutput
Include / pragmasrc/preprocessOne translation unit; comments keep source lines
Parsesrc/parser/grammar.pestAST (recovery for the IDE after the first Pest error)
Analysissrc/analysis + src/semantic/check.rsDiagnostics, scopes, completions, hover, outline
Builtinssrc/builtinsOne table for emit, manifest, and IDE
Emitsrc/codegen/emitLuau (function Class:Method, self, game:GetService)
Editoreditors/vscodeLSP calls clpp api complete

Cluaupp (and anything else) should use:

Terminal window
clpp api compile # JSON stdin/stdout
clpp api complete # { source, fileName, line, column } 1-based
clpp api hover
clpp api symbols
clpp api definition
clpp manifest # extensions, tags, operators, builtins
clpp fmt # indent
clpp watch # recompile on change

See Cluaupp 0.7.0, Update Cluaupp, CL++ + luau-lsp, and Cluaupp support. Current compiler: 0.7.0.