lpp (lowlevelplusplus)
A small, memory-safe systems language and web framework for Linux, built so that software stops wasting memory and CPU.
- No libc, no runtime, no allocator, no GC. Programs are static ELF binaries that call the kernel directly.
- Memory safe. Every index and slice is bounds-checked, memory starts zeroed, and slices cannot outlive the stack frame that owns them. The only unchecked code is about 20 lines of syscall wrappers in
std/sys.lpp. - Runs like Python. Run
lpp app.lppwith no separate build step. It compiles in milliseconds and caches the result.
$ lpp examples/web.lpp
listening on http://127.0.0.1:8001
$ curl localhost:8001/hello/world
Hello, world!
The example web app is a 17 KB binary. With four workers the whole server uses 80 KB of memory (PSS, measured with make bench).
Quick start
make # build the compiler (needs cargo)
make test # 54 checks: examples, traps, rejected programs, HTTP edge cases
make bench # record size, memory and throughput baselines
make web # serve examples/web.lpp on :8001
make install # optional: lpp -> ~/.local/bin, std -> ~/.local/share/lpp
CLI
| Command | What it does |
|---|---|
lpp app.lpp / lpp run app.lpp | compile and run |
lpp build app.lpp [-o out] | write a static binary |
lpp check app.lpp | type-check every function, write nothing |
lpp version | print the version |
A web app
use io;
use http;
fn handle(conn: int, method: str, path: str) -> int {
if str_eq(path, "/") { return http_respond(conn, 200, "text/plain", "Hello!\n"); }
return http_respond(conn, 404, "text/plain", "not found\n");
}
fn main() -> int { return http_serve(8001); }
Layout
compiler/ the lpp compiler and CLI (Rust, no dependencies)
std/ standard library: sys (trusted), io, net, http
examples/ exit, hello, bounds (safety demo), web
tests/ run.sh: run/, reject/, web.sh
bench/ bench.py and recorded results
site/ lpp.olibuijr.com: server.lpp and the docs builder
docs/ language reference, design and roadmap
Docs and progress: https://lpp.olibuijr.com. See docs/language.md, docs/design.md and docs/roadmap.md, docs/progress.md and docs/deploy.md.
Status: 0.2.0. HTTP only for now; HTTPS (TLS 1.3 written in lpp) is on the roadmap.