2 ms·
“Compiling to C” is an established strategy; for instance, GHC used to compile to C--, a subset of C. This doesn’t seem wrong to me; after all, assembly is alr
by thewakalix 5y ago
“Compiling to C” is an established strategy; for instance, GHC used to compile to C--, a subset of C.
This doesn’t seem wrong to me; after all, assembly is already an abstraction layer over machine code, and outputting assembly would hardly be “uncompilerish” behavior. I suppose it depends on whether you view C as a low-level language.
- anonymfus 5y ago> GHC used to compile to C--, a subset of C. C-- is not a subset of C.
- wccrawford 5y agohttps://en.wikipedia.org/wiki/C-- https://en.wikipedia.org/wiki/C-- > The name of the language is an in-joke, indicating that C-- is a reduced form of C, in the same way that C++ is basically an expanded form of C. ("--" and "++" mean "decrement" and "increment".)
- BenjiWiebe 5y agoQ&A #5 of https://www.cs.tufts.edu/~nr/c--/faq.html https://www.cs.tufts.edu/~nr/c--/faq.html explains why C-- is not a subset of C.
- DonHopkins 5y ago“C++++-= is the new language that is a little more than C++ and a lot less.” -Bill Joy Bill Joy’s Law: 2^(Year-1984) Million Instructions per Second https://donhopkins.medium.com/bill-joys-law-2-year-1984-million-instructions-per-second-3a8c92165cfe https://donhopkins.medium.com/bill-joys-law-2-year-1984-mill...
- thewakalix 5y agoYou’re right, and as it happens, GHC compiles first to Cmm and then (as one half-deprecated option) to C.
- DonHopkins 5y agoC combines the power of assembly language with the readability and maintainability of assembly language.