Skip to content

Luau engineering map

CL++ copies layering from Luau, not the virtual machine. IntelliSense comes from analysis of the CL++ AST, the same idea as Luau Analysis/ feeding luau-lsp.

flowchart LR
  subgraph luau [Luau repo]
    Lex[Lexer]
    AstL[Ast]
    Comp[Compiler plus Builtins]
    VM[VM]
    AnL[Analysis]
    Lex --> AstL --> Comp --> VM
    AstL --> AnL
  end
  subgraph clpp [CL++ 0.4]
    PP[preprocess]
    Parse[parser]
    AstC[ast plus spans]
    AnC[analysis]
    Builtins[builtins registry]
    Emit[codegen emit]
    API[api compile complete hover symbols]
    PP --> Parse --> AstC --> AnC
    AnC --> Builtins --> Emit
    AstC --> API
    AnC --> API
  end
  Emit --> LuauOut[.luau]
  LuauOut -. optional .-> LuauLSP[luau-lsp]
LuauPurposeCL++
Ast/Nodes, visitors, namessrc/ast/ — spans + visitor
Compiler/ + Builtins.cppLowering + builtin tablesrc/builtins/ + src/codegen/emit/
Analysis/Types, lints, IDE datasrc/analysis/complete_at, hover, symbols
Config/.luaurc.clpprc (optional) + #pragma
Require/Module pathssrc/preprocess.rs
CLI/luau, luau-analyzeclpp compile, clpp api compile, clpp api complete, clpp api hover, clpp api symbols, clpp fmt, clpp watch
VM/, CodeGen/Native runtimeOut of scope. Luau runs the emitted .luau

Luau-lsp does not regex the buffer for locals. CL++ 0.4 matches that contract:

  1. Editor sends { source, fileName, line, column } (1-based).
  2. clpp api complete (or hover / symbols / definition) parses the buffer, walks scopes, returns JSON.
  3. The VS Code / Cursor pack is a thin LSP: it does not re-implement the type checker in JavaScript.

Roblox class dumps stay Cluaupp headers + completions.json catalog. The language server for emitted Luau remains luau-lsp plus a Rojo sourcemap — complementary, not a substitute.

Luau resolves math.abs only when math is still the default global. CL++ uses one registry (src/builtins):

  • postprint
  • reporterror
  • to_stringtostring
  • to_numbertonumber
  • to_boolnot not
  • GetService, ~>Connect, observables

The same table feeds clpp api manifest, codegen, and completions. Locals that shadow a builtin are not rewritten.

  • A CL++ bytecode VM or opcode table
  • Fastcall lowering (LBF_* IDs) — those belong to Luau’s compiler
  • Replacing luau-lsp for .luau files

See the compiler pipeline.