Show HN: DotnetEbpf - Write Linux eBPF kernel applications in C#

4 KallDrexx 0 6/30/2025, 12:48:40 PM github.com ↗
I've been working for a good 9 months now writing a .net to C transpiler (https://github.com/KallDrexx/dntc) as a "I wonder if I can" type of project (with the intention of eventually being able to do embedded development in C# instead of C).

Along the way I was trying to find good milestones to test the transpiler with. As I learned about Linux eBPF I realized that ended up being an interesting use case and created the DotnetEbpf prototype.

It allows you to write Linux kernel side eBPF applications fully in C#. While with some of the limitations it may seem like it's limiting the usefulness of C#, it does allow for better syntax than C and as well as unit testing capabilities (since each native eBPF function can be populated with C# native code that is ignored when transpiled, in addition to generic capabilities).

In the future I'd like to flesh out the ability for correct wiring up of data structures between both the C# kernel side and a C# user space side (and the ability to install an eBPF kernel application from a C# user space application), which would enable writing full stack eBPF security software fully in C#.

Comments (0)

No comments yet