7 comments

  • pimterry 18 minutes ago
    Does anybody know if something similar exists for Node.js? I'd love to be able to integrate BPF into some of my Node projects with the same kind of approach.
  • farnulfo 44 minutes ago
    For java, Johannes Bechberger has made a lot of articles about writing eBPF in java : https://mostlynerdless.de/blog/2023/12/31/hello-ebpf-develop... https://mostlynerdless.de/blog/category/computer-science/ebp...
  • alexgartrell 1 hour ago
    I did something similar a long time ago https://github.com/facebookresearch/py2bpf

    It was definitely a toy, I transliterated from python bytecode (a stack based vm) into bpf. I also wrote the full code gen stack myself (bpf was simpler back then)

    But using llvm and not marrying things to cpython implementation makes this approach way better

  • the_duke 1 hour ago
    So this is a "inline" Python to eBPF transpiler/compiler.

    Which is cool!

    But the description could be a bit clearer.

  • indigo945 1 hour ago
    The "How it works under the hood" section raises more question than it answers. What is the difference between step 3 and step 4? As described, step 3 goes from LLVM IR to BPF (via llc), and step 4 - goes from LLVM IR to eBPF bytecode? That's nonsensical.
  • njharman 1 hour ago
    Putting tldr; at the bottom defeats purpose of tldr.

    Guessing this is BPF https://en.wikipedia.org/wiki/Berkeley_Packet_Filter But, reader shouldn't have to guess. That is the link that should be in your Introduction. Just after tldr;

    • indigo945 1 hour ago
      Not the original BPF, but its successor in the Linux kernel called eBPF [1]. eBPF's virtual machine has additional registers, and crucially, eBPF programs can make some syscalls, which BPF programs can't.

      [1]: https://lwn.net/Articles/740157/

  • atoav 2 hours ago
    Looks cool, I like the use of decorators as a means to use essentially turn python into some sort of DSL.

    One nitpick: Please include a paragraph/section/infobox explaining what eBPF is and what problems should be solved using it. I am a huge fan of making our tech world more accessible and as such we should think to some degree about people who don't know every acronym.