Home /Modules/compiler/COMPILER-DEVELOPER-INTERFACE.md

COMPILER-DEVELOPER-INTERFACE.md

lib/compiler/COMPILER-DEVELOPER-INTERFACE.md · 51 line(s) · markdown

SLeeLa Compiler Developer Interface

Max Rupplin - MEARVK LLC - 2026

Purpose

/lib/compiler exposes a SLeeLa-level interface for writing and orchestrating compiler implementations, plus a defined boundary for generating C and C++ from verified SLeeLa compiler IR. Developers can implement compiler phases in .sleela, register language front ends, and select an explicitly configured native backend.

Source-level API

TypeResponsibility
SLCompilerWorkbenchRunnable-facing build coordinator and structured diagnostics
SLCompilerBuildRequestInput/output/target/toolchain request with fail-closed validation
SLCompilerBuildResultExplicit result and diagnostic envelope
SLCompilerDeveloperCLITerminal/IDE-facing prepare and build interface
SLCompilerNativeBackendSelects C/C++ only when the matching toolchain is configured
SLNativeSourceEmitterVerified-IR-to-native-source backend contract
SLCompilerToolchainExplicit C11/C++20 toolchain configuration and native-build authorization
SLLanguageCompilerBase class for language-specific compiler front ends
SLCompilerRegistryShared front-end catalog
SLCompilerPipelineCanonical compiler stages

Supported design paths

SLeeLa-runnable interface

A terminal, IDE, build file, or SLeeLa program uses SLCompilerDeveloperCLI or SLCompilerWorkbench to configure a request and retrieve diagnostics/results. The native bridge is responsible for actual file access, verified-IR emission, and toolchain invocation. These operations are not simulated by the SLeeLa wrapper.

SLeeLa source to native C/C++

The planned compiler pipeline is:

SLeeLa compiler source -> parser/semantics -> SLeeLa IR -> verified native emitter -> C or C++ source -> selected toolchain -> native executable/library

Generated native code is an output artifact, not an authorization to run it. It must be compiled with an explicitly selected toolchain and run only under the user's normal OS permissions and applicable SLeeLa security controls.

Fail-closed rules

Implementation status

These .sleela units establish the source-level interface and bridge contract. The sleela_compiler_emit_verified_ir native bridge is an integration point; it must be implemented and covered by end-to-end tests before C/C++ emission can be considered operational. The top-level /compiler C++20 prototype remains an experimental subset.