4 ms·
The register support you describe is an extension, not really part of C. Gcc has lots and lots of C extensions, but they don't make the language simple. D's in
by WalterBright 4y ago
The register support you describe is an extension, not really part of C. Gcc has lots and lots of C extensions, but they don't make the language simple.
D's inline assembler does register management for you, i.e. it tracks register usage through the instructions, so you don't have to say which registers are read or written to.
D does not support the "section" extension. I understand that certain gcc C extensions are needed for special purposes. Gcc may be the most suitable language if you need those extensions.
What I would do is use gcc for the parts of the code that need those extensions, and D for the rest (D code can directly interact with C code).
- sparkie 4y agoThanks. My root comment mentioned that it was not really the features of C that I depended on, but the GCC specific features. I'm interested in using D now as sibling comment mentions that I can use some of these features in gcd, but I'm not yet sure how much benefit I'd get over using C by using a subset of the D features which are compatible with the constraints of my VM.
- WalterBright 4y agoOne big feature is D has modules. There's no reason C can't have modules, but they don't. You don't need to code .h files anymore.
- mhh__ 4y agoLDC and GDC both have the section concept exposed as a UDA.
- WalterBright 4y agoGood!