Settings

Theme

Adding Reflection to C

davidpriver.com

15 points by telotortium 21 days ago · 5 comments

Reader

uecker 21 days ago

Here is my proposal with a lot of similarities: https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3212.pdf

cozzyd 20 days ago

BTF or DWARF info in principle contain the information needed, though working with them is cumbersome...

tliltocatl 21 days ago

Been there… Pendantic nitpick: it's more akin to introspection, reflection would be self-modifying code.

teo_zero 20 days ago

Nice. But you've just invented Zig!

  • accelbred 20 days ago

    C with Zig's comptime is compelling though. Zig doesnt allow you to access all the features your C compiler does, and puts you in the LLVM ecosystem. I've been working on something similar; extending C with both Zig/C++ inspired reflection and linear types, with a compiler that compiles to a subset of C to allow you to leverage GCC and all its extenstions.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection