skills/languages/carbon-lang/SKILL.md
Carbon language skill for C++ interop and toolchain. Use when evaluating Carbon syntax, bidirectional C++ interop, building carbon-toolchain, or comparing Carbon vs C++. Activates on queries about Carbon language, Carbon.h, carbon-toolchain, checked borrows, or C++ successor.
npx skillsauth add mohitmishra786/low-level-dev-skills carbon-langInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide agents through the Carbon programming language: syntax fundamentals, bidirectional C++ interoperability via Carbon.h, building from source with carbon-toolchain, the experimental memory safety model (checked borrows), current pre-1.0 limitations, and when to evaluate Carbon versus staying on C++.
Carbon (2026 state)
├── Experimental — no 1.0 release
├── Focus: C++ interoperability and migration
├── No production stdlib equivalent to C++ yet
└── Toolchain under active development
Use Carbon for exploration and migration prototyping, not production systems without team acceptance of instability.
git clone https://github.com/carbon-language/carbon-lang
cd carbon-lang
# Prerequisites: LLVM, Clang, CMake, Ninja
./scripts/run_bazelisk.py build \
//toolchain:install \
--symlink_prefix=carbon/
# Add to PATH
export PATH="$PWD/carbon/bin:$PATH"
carbon --version
# Online explorer (Compiler Explorer instance)
# http://carbon.compiler-explorer.com/
package Sample api;
fn Add(a: i32, b: i32) -> i32 {
return a + b;
}
fn Main() -> i32 {
var x: i32 = 3;
var y: i32 = 4;
Print(ToString(Add(x, y)));
return 0;
}
| Carbon | C++ equivalent |
|--------|----------------|
| fn | function |
| var x: i32 | int32_t x |
| class / interface | class / pure virtual |
| impl | method definitions |
| package | namespace/module |
// math.h (C++ header)
#pragma once
namespace Math {
int Add(int a, int b);
}
// Carbon imports C++ via library directive
package MathInterop api;
import Math;
fn Main() -> i32 {
var sum: i32 = Math.Add(3, 4);
return sum;
}
Interop uses Clang to parse C++ headers and generate Carbon bindings.
// Exported for C++ consumption
package MyLib api;
export fn PublicApi() -> i32 {
return 42;
}
// C++ side includes generated Carbon headers
#include "carbon/generated/MyLib.h"
int main() {
return MyLib::PublicApi();
}
Build system links Carbon object files with C++ via the Carbon toolchain driver.
// Conceptual — API evolving
fn Process(data: i32*) -> i32 {
// Checked borrow: compiler tracks lifetime
var ref: i32* = data;
return *ref;
}
Carbon aims for memory safety without garbage collection — checked pointers and ownership semantics. Feature maturity varies; check latest design docs.
<vector>, <thread>, etc.Choose Carbon exploration when
├── Large C++ codebase to gradually migrate
├── Team wants improved syntax with C++ interop
└── Can tolerate toolchain churn
Stay on C++ when
├── Production stability required now
├── Need full stdlib, Boost, mature tooling
├── Heavy template metaprogramming investment
└── Platform support beyond Carbon targets
# Compile and link (toolchain evolving — check docs)
carbon compile sample.carbon --output=sample.o
carbon link sample.o --output=sample
# Typecheck only
carbon compile --phase=check sample.carbon
# Or build from source with Bazel in carbon-lang repo
./scripts/run_bazelisk.py build //toolchain:install --symlink_prefix=carbon/
| Symptom | Cause | Fix | |---------|-------|-----| | Build fails missing LLVM | Wrong LLVM version | Match carbon-lang README LLVM pin | | C++ import errors | Unsupported C++ features | Simplify header; wrap in C API | | Syntax changed since tutorial | Pre-1.0 churn | Check latest carbon-lang docs | | No stdlib for task | Not implemented | Bridge to C++ library temporarily | | Explorer differs from CLI | Different versions | Use same commit for both | | Link error with C++ | ABI mismatch | Use Carbon toolchain link driver |
skills/compilers/cpp-templates — C++ being migrated fromskills/compilers/cpp-modules — C++20 modules comparisonskills/compiler-internals/compiler-frontend — Carbon compiler architectureskills/languages/hare-lang — alternative systems languageskills/compilers/clang — Clang backend for Carbonskills/compilers/llvm — LLVM IR pipelinedevelopment
QEMU/KVM skill for virtualization and kernel development. Use when running qemu-system-x86_64 with KVM, configuring virtio devices, VFIO passthrough, QMP monitor, libvirt, or booting custom kernels. Activates on queries about QEMU, KVM, virtio, VFIO, virsh, virt-install, or -kernel -append.
development
Hardware virtualization internals skill for Intel VT-x and AMD-V. Use when studying VMCS/VMCB, EPT/NPT page tables, VMEXIT handling, APIC virtualization, or building minimal hypervisors. Activates on queries about VMX, SVM, VMCS, EPT, NPT, VMEXIT, or type-1 hypervisor.
testing
Linux containers internals skill for namespaces, cgroups, and OCI. Use when understanding clone/unshare namespaces, cgroups v2 limits, overlayfs, runc, seccomp profiles, capabilities, or escape mitigations. Activates on queries about namespaces, cgroups, overlayfs, runc, seccomp-bpf, OCI spec, or container escape.
tools
Reverse engineering skill for binary analysis. Use when decompiling with Ghidra, analyzing with radare2, scripting RE tools, triaging with strings/file/xxd, or diffing binaries. Activates on queries about Ghidra, radare2, r2, decompiler, Binary Ninja, Diaphora, or stripped binary analysis.