by alexgartrell
1 subcomments
- 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
- 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...
by indigo945
1 subcomments
- 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.
by bieganski
1 subcomments
- that's really cool. to gain traction i would start with reimplementing all the tools from https://github.com/iovisor/bcc/tree/master/libbpf-tools in PythonBPF.
- I had similar idea ! Loved seeing it here.
We thought about doing it with ChocoPy to make the types more consistent.
- So this is a "inline" Python to eBPF transpiler/compiler.
Which is cool!
But the description could be a bit clearer.
- 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.
by drivenextfunc
4 subcomments
- Writing C for eBPF is cumbersome and you'd like to avoid it. Okay, that's reasonable. But I don't think it would be a good idea to write a compiler that emits eBPF binary from (a tiny subset of) Python. Why not just write code in pseudo-Python (or whatever language you're comfortable with) and have it translated by an LLM, and paste it in the source code? That would be much better because there would be fewer layers and a significant reduction in runtime cost.
- 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;
by robertlagrant
0 subcomment
- Step 1: import numpy
by grantseltzer
1 subcomments
- bcc hasn't been relevant for years.
- 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.