4 ms·
The dmd D compiler now has an embedded C compiler, written in D. The purpose is so D code can read C declarations. It doesn't use clang.
by WalterBright 5y ago
The dmd D compiler now has an embedded C compiler, written in D. The purpose is so D code can read C declarations. It doesn't use clang.
- fayten 5y agoDoes this mean you can directly import C headers in D?
- WalterBright 5y agoyes
- oshiar53-0 5y agoHow about static inline functions?
- WalterBright 5y agoyes
- fayten 5y agoWell well well, I guess it's time to brush off the ol' dmd.
- MaxBarraclough 5y agoFor contrast, gforth (a prominent Forth interpreter, by Forth standards) generates+compiles+links binding code in C, at runtime, using the ordinary C toolchain. [0][1][2] A bit 'out there' you may say, but on the plus side this approach enables handling header files and tidily expressing bindings without the need to implement their own C parser. [2] [0] GitHub mirror: https://github.com/forthy42/gforth/blob/dda77d851ddeb80ca849ee554b29ac68fb680a87/libcc.fs#L22 https://github.com/forthy42/gforth/blob/dda77d851ddeb80ca849... [1] The official host: https://git.savannah.gnu.org/cgit/gforth.git/tree/libcc.fs https://git.savannah.gnu.org/cgit/gforth.git/tree/libcc.fs [2] https://rosettacode.org/wiki/Call_a_foreign-language_function#Forth https://rosettacode.org/wiki/Call_a_foreign-language_functio...