SuperC: Parsing All of C by Taming the Preprocessor [pdf] (2012)
paulgazzillo.com
paulgazzillo.com
This is definitely a niche space but I see clear use for large, portable and configurable c codebases (e.g. Linux kernel, FreeRTOS) for providing better visibility into the configuration system.
https://dotat.at/prog/unifdef/
I used it once at work for a niche usecase. It’s main use case seems to be making it easier to simplify platform-specific code when you remove support from old platforms in legacy codebases.
1) Platform/Processor/OS configuration/build use-cases.
(and)
2) All other use-cases that are not directly related to #1.
In other words, if you're a future language designer and you design a macro system for your language, you might wish to distinguish between configuration/platform/build related macros -- and other macros not directly related to build and configuration...
Doing that would allow one set and/or the other set to be selectively and easily evaluated back into the non-macro source of the base language -- depending on what is desired by the language user...
Anyway, an excellent link!
static int mousedev_open(struct inode *inode, struct file *file)
{
int i;
#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
if (imajor(inode) == 10)
i = 31;
else
#endif
i = iminor(inode) - 32;
return 0;
}
(b) The preprocessed source preserving all configurations
and my experience with C is that there are untold number of "unbound" tokens that are designed to be injected in by -D or auto-generated config.h files, so presumably this works closer to the "ready for compilation" phase versus something one could use to make tree-sitter better (as an example)The point about the C used in the kernel drifting could be relevant, but with this sort of project I'm more concerned initially with reproducing results and then moving forward.
Why, because this goose is so thoroughly cooked that all that is left is optimizing for speed?
There is a lot of misplaced focus on performance in CS academia, and also in software.
Suppose we have some accurate tool that does something useful with a C program, but it takes 5 minutes to run instead of 5 seconds. So what? Someone still wants to use it. Suppose the program is used by millions of people, and that 5 minute run only has to be repeated half a dozen times during development.
Get it right, and get it in people's hands should be the priorities, and not necessarily in that order.