A Partial Evaluator for C
62 points by measurablefunc 5 hours ago | 8 comments
MiroslavPokorny 48 minutes ago
> The Tempo specializer has been made publicly available under a licence in April 1998. At of March 99, it was being used by about thirty people around the world. The binary version of Tempo has just (July 2000) been made available without any restrictions, and we expect a full unrestricted source release under GPL to follow soon.
replyRossBencina 3 hours ago
While unsuccessfully searching for the Tempo source code I found LLPE, a partial evaluator for LLVM bitcode: https://www.llpe.org/
replyrramadass 42 minutes ago
Partial Evaluation - https://en.wikipedia.org/wiki/Partial_evaluation
replyPartial Evaluation and Automatic Program Generation by Neil Jones et al. - https://web.archive.org/web/20071012081310/http://www.itu.dk...
dmitrygr 2 hours ago
GCC does quite a bit of this nowadays. It is quite impressive to see when you disassemble its output.
replyrramadass 34 minutes ago
AFAIK, GCC toolchain does not have a separate partial evaluator, so how do you do it?
replypjmlp 24 minutes ago
GDB, calling C code from the interactive prompt?
replyEven though it is its own project, most folks use it alongside GCC.
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Calli...
In your example, "%" would cause switch ('\0') which would fall in the default case.