News for hackers. Stuff that matters.
Re:Show HN: Write your BPF programs in Go, not C by 7373737373 on Tuesday May 26, 2026 @06:06AM (#48277520)
Noob question: why did they not choose to use WebAssembly in the kernel instead?
Re:Show HN: Write your BPF programs in Go, not C by dwattttt on Tuesday May 26, 2026 @09:11AM (#48279354)
eBPF predates WebAssembly by a few years. I'm also not sure Linux would've wanted to integrate and rely so heavily on a standard they aren't in control of the design of.
Re:Show HN: Write your BPF programs in Go, not C by tptacek on Tuesday May 26, 2026 @09:32AM (#48279655)
eBPF has much stronger constraints than WebAssembly.
Re:Show HN: Write your BPF programs in Go, not C by paul_knox on Tuesday May 26, 2026 @10:27AM (#48280311)
if you crash in wasm, your tab dies. if you crash in ebpf, your server dies. different stakes.
Re:Show HN: Write your BPF programs in Go, not C by danudey on Tuesday May 26, 2026 @01:07PM (#48282578)
eBPF has a lot more checks in the verifier, which you could read about here if you're interested in learning more: https://docs.kernel.org/bpf/verifier.html

Since you don't want to handle any kind of crash, out of bounds exception, etc., the eBPF verifier does a ton of impressively paranoid stuff. It ensures that the program doesn't loop (or if it loops that the loop is provably bounded and cannot be infinite), it guarantees that you don't read from a register that might not have been written to, etc.

Basically, it needs to be able to mathematically prove without a doubt that the program behaves as it's supposed to or the verifier refuses to load it at all. WASM doesn't do that, since WASM is a general-purpose 'machine' and WASM programs could theoretically just run forever in entirely reasonable cases.