3 ms·
Awesome, this is exactly how I wish all 'better C' languages would allow C interop instead of going through separate binding-generator tools. The C (not C++) la
by flohofwoe 9y ago
Awesome, this is exactly how I wish all 'better C' languages would allow C interop instead of going through separate binding-generator tools. The C (not C++) language itself is simple enough that at least a struct/function declarations parser shouldn't add too much code to any compiler (even if not using LLVM for this).
The best solution would be to also allow directly referencing .c implementation files from D source, for separate compilation and linking with the D program. Nim does allow something like this: https://github.com/floooh/sokol-nim/blob/master/sokol/gfx.nim#L10 https://github.com/floooh/sokol-nim/blob/master/sokol/gfx.ni..., but I guess since Nim compiles to C this is much easier to achieve :)
- atilaneves 9y agoThe language that is commonly known as C is simple. Real C isn't because of the preprocessor. There's no way to do it properly unless one uses an actual C compiler. Viva libclang!