Verifier-Safe eBPF Compiler for High-Assurance Linux Kernel Programs
A modern domain-specific language and compiler that generates safe, predictable eBPF C backend code.
Solnix is a high-level domain-specific language designed for writing Linux eBPF programs safely and concisely.
The Solnix Compiler translates .snx source files into
verifier-compliant C backend code, enabling predictable compilation into
eBPF object files suitable for:
- Kernel tracing
- Security enforcement
- Observability pipelines
- Networking (XDP)
- LSM hooks
- System instrumentation
Solnix eliminates common verifier errors by enforcing safety rules at compile time.
- Verifier-aware static validation
- High-level DSL syntax
- Structured map definitions
- Built-in eBPF event modeling
- Safe register handling
- Deterministic C backend generation
- Minimal runtime overhead
- Rust-implemented compiler core
Solnix follows a structured compilation pipeline:
Solnix Source (.snx)
↓
Lexer + Parser
↓
AST Builder
↓
Semantic & Verifier Validator
↓
Intermediate Representation (IR)
↓
C Backend Code Generator
↓
eBPF Object (via clang)
Instead, it generates structured C code tailored for eBPF compilation.
Download the latest release:
https://github.com/solnix-lang/solnix-compiler/releases
Then:
chmod +x solnixc
sudo mv solnixc /usr/local/bin/Verify:
solnixc --versionRequirements:
- Rust (stable)
- Cargo
- clang (for eBPF backend compilation)
git clone https://github.com/solnix-lang/solnix-compiler.git
cd solnix-compiler
cargo build --releaseBinary will be located at:
target/release/solnixc
map events {
type: .ringbuf,
max: 1 << 24
}
event exec_event {
pid: u32,
filename: bytes[256]
}
unit trace_exec_filename {
section "tracepoint/syscalls/sys_enter_execve"
license "GPL"
reg pid_tgid = ctx.get_pid_tgid()
reg pid = pid_tgid
}
Compile:
solnixc compile execve_monitor.snx execve_monitor.o solnix-compiler/
│
├── src/
│ ├── lexer/
│ ├── parser/
│ ├── ast/
│ ├── semantic/
│ ├── ir/
│ ├── codegen/
│ └── cli/
│
├── tests/
├── examples/
├── Cargo.toml
└── README.md
- IR optimization passes
- LSP (Language Server Protocol)
- Advanced static analysis
- Cross-architecture support
- Package registry for Solnix libraries
- Formal verification layer
We welcome contributions.
- Fork the repository
- Create a feature branch
- Submit a Pull Request
Please read CONTRIBUTING.md before submitting changes.
Licensed under the Apache License 2.0.
See LICENSE file for details.
Solnix is under active development and considered experimental.