Re:C Isn't a Programming Language Anymore
by choeger on Monday November 07, 2022 @01:39PM
(#33510140)
Hmm, I know that C is not parseable, but couldn't one define a parseable subset that is still meaningful? That would then pass the burden to the developers that want to bind to a specific library and hopefully these developers have a clue on how that library builds, works, and what functions are needed. In the long run, if a popular language (say rust) strictly insists on that subset being used, I could imagine that upstream libraries would start shipping such headers, say openssl would not come with a rust interface but a "machine-readable" C interface.
[ Parent
| on HN ]
Re:C Isn't a Programming Language Anymore
by wvenable on Monday November 07, 2022 @01:52PM
(#33510368)
This is the solution. It doesn't even need to be parseable subset of C -- it could be anything. It just needs to be able to describe an ABI. And from that, you generate C headers or bindings for other languages.
I don't think this idea is in any way controversial -- it would just be a lot of work to do across a large number of systems.