https://github.com/solnix-lang/solnix-compiler
A secure, verifier-aware eBPF compiler for writing high-level kernel-safe programs.
https://github.com/solnix-lang/solnix-compiler
compiler ebpf kernel linux rust security
Last synced: 2 months ago
JSON representation
A secure, verifier-aware eBPF compiler for writing high-level kernel-safe programs.
- Host: GitHub
- URL: https://github.com/solnix-lang/solnix-compiler
- Owner: solnix-lang
- License: apache-2.0
- Created: 2025-12-02T16:20:03.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-03-08T07:51:04.000Z (3 months ago)
- Last Synced: 2026-03-08T10:30:31.544Z (3 months ago)
- Topics: compiler, ebpf, kernel, linux, rust, security
- Language: Rust
- Homepage: https://www.solnix-lang.org
- Size: 2.96 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Solnix Compiler
**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.
------------------------------------------------------------------------
## Overview
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.
------------------------------------------------------------------------
## Key Features
- 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
------------------------------------------------------------------------
## Architecture
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.
------------------------------------------------------------------------
## Installation
### Prebuilt Binary
Download the latest release:
https://github.com/solnix-lang/solnix-compiler/releases
Then:
``` bash
chmod +x solnixc
sudo mv solnixc /usr/local/bin/
```
Verify:
``` bash
solnixc --version
```
------------------------------------------------------------------------
### Build From Source
Requirements:
- Rust (stable)
- Cargo
- clang (for eBPF backend compilation)
``` bash
git clone https://github.com/solnix-lang/solnix-compiler.git
cd solnix-compiler
cargo build --release
```
Binary will be located at:
target/release/solnixc
------------------------------------------------------------------------
## Quick Example
### Solnix Source (`execve_monitor.snx`)
``` snx
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:
``` bash
solnixc compile execve_monitor.snx execve_monitor.o
```
------------------------------------------------------------------------
## Project Structure
solnix-compiler/
│
├── src/
│ ├── lexer/
│ ├── parser/
│ ├── ast/
│ ├── semantic/
│ ├── ir/
│ ├── codegen/
│ └── cli/
│
├── tests/
├── examples/
├── Cargo.toml
└── README.md
------------------------------------------------------------------------
## Roadmap
- [ ] IR optimization passes
- [ ] LSP (Language Server Protocol)
- [ ] Advanced static analysis
- [ ] Cross-architecture support
- [ ] Package registry for Solnix libraries
- [ ] Formal verification layer
------------------------------------------------------------------------
## Contributing
We welcome contributions.
1. Fork the repository
2. Create a feature branch
3. Submit a Pull Request
Please read CONTRIBUTING.md before submitting changes.
------------------------------------------------------------------------
## License
Licensed under the Apache License 2.0.
See LICENSE file for details.
------------------------------------------------------------------------
## Status
Solnix is under active development and considered experimental.