一键导入
compiler-bindings
How Compiler Bindings work in Chemical, How compiler APIs are exposed for (build system, compilation and lsp)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How Compiler Bindings work in Chemical, How compiler APIs are exposed for (build system, compilation and lsp)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Comprehensive guide to the Chemical compiler test infrastructure — how tests are organized, written, and executed. Covers the test framework, @test annotation dispatch, test_env and test libraries, and how compiler plugins get tested via lang/tests/build.lab.
Comprehensive deep-dive into the Chemical build pipeline — how chemical.mod is converted to build.lab, how build scripts are JIT-compiled via TinyCC, how jobs are created and executed, and how ASTProcessor orchestrates the parallel compilation passes.
All documentation related to building and running Project or Tests
Comprehensive guide to the Chemical Compiler Binding Interface (CBI) — how compiler plugins are built, registered, and integrated into the compilation pipeline.
Documentation of Syntax and APIs for Chemical Programming Language, A must read before implementing something in chemical programming language.s
Comprehensive guide to Chemical's compiler intrinsic functions and reflection APIs — how GlobalFunctions.cpp provides interpreter-friendly implementations, compile-time reflection, and metadata access.
| name | Compiler Bindings |
| description | How Compiler Bindings work in Chemical, How compiler APIs are exposed for (build system, compilation and lsp) |
By binding means compiler API exposed into Chemical source code, We don't mean intrinsic functions, chemical has those too, Those get called and interpreted, but bindings mean real functions in the compiler executable called from actual chemical source code, We do not use libffi for this, We instead use Tiny CC. All chemical targets (Compiler, TCCCompiler, ChemicalLSP) contain libtcc as a dependency.
tcc_add_symbolbuild.lab or chemical.mod into C, then we JIT compile it using Tiny CCbuild.lab, which user uses to explain his dependencies and so on...build.lab, User can advertise plugins to the compiler, which can be used during the compilation processThese files contain the heart of how bindings interact, inside the Compiler
LabBuildCompiler::link_cbi_job (the function that links a compiler plugin)This lifecycle takes into account all the processes mentioned above. This is very simplified and does not cover all the details.
build.lab to C and then JIT compiles it and expose a build API to itbuild.lab uses the build API to explain dependencies, module graph and jobsbuild.lab uses the compiler API to advertise plugins as well.agents/skills/cbi_plugin_api/SKILL.md) — How to develop compiler plugins: ASTBuilder API, macro registration, plugin structure, debugging.agents/skills/build_system/SKILL.md) — How plugins are compiled and loaded during the build process.agents/skills/performance/SKILL.md) — Optimization patterns, parallel compilation of pluginsIn the Future, We may use LLVM ORC JIT instead of Tiny CC, but the binding system will remain the same.