WeSearch

Show HN: Write your BPF programs in Go, not C

·6 min read · 0 reactions · 0 comments · 12 views
#programming#bpf#go#gobee#Aya#Rust#C#Linux
Show HN: Write your BPF programs in Go, not C
⚡ TL;DR · AI summary

Gobee is a tool that allows users to write BPF programs in Go instead of C. It transpiles a strict subset of Go into BPF C and generates typed Go bindings for userspace. This approach aims to simplify the development process for BPF programs by integrating both kernel and userspace components within a single Go module.

Key facts
Original article
GitHub
Read full at GitHub →
Opening excerpt (first ~120 words) tap to expand

gobee Write your BPF programs in Go, not C. gobee transpiles a strict subset of Go into BPF C, generates typed Go bindings for the userspace side, and gates loads against the running kernel. The Go ecosystem has solid userspace tooling for BPF. The kernel side has always ended with "now write your program in C." Aya brought eBPF to Rust by writing a new BPF backend in rustc. gobee gets there a different way: by transpiling to C and reusing clang's mature backend. A Go file in, a BPF program out A tracepoint that streams every execve to userspace via a ringbuf: Your input (Go) What gobee emits (BPF C) //go:build ignore package main import "github.com/boratanrikulu/gobee/bpf" //bpf:license GPL type Event struct { Pid uint32 Comm [16]byte } var Events = bpf.RingBuf[Event]{ MaxEntries: 4096,…

Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from GitHub