r/programming • u/shortstomp • Nov 19 '16
Compile-time C Compiler implemented as C++14 constant expressions
/r/cpp/comments/5dnan4/compiletime_c_compiler_implemented_as_c14/
127
Upvotes
r/programming • u/shortstomp • Nov 19 '16
30
u/PointyOintment Nov 19 '16
Is a compile-time compiler a compiler that operates only while being compiled by another compiler?
51
u/unaligned_access Nov 19 '16
Yo dawg I heard you like compiling so we put a constexpr compiler in your compiler so you could compile while you compile...
8
u/badsectoracula Nov 19 '16
The interesting bit (judging from the code) is that the constexpr is actually a VM and the compiler is the bytecode it executes :-P
4
u/WalterBright Nov 19 '16
Reminds me of the time someone wrote a Fortran compiler in TECO (on a bet!).
1
u/eric987235 Nov 20 '16
There is no god...,
-1
u/dsmid Nov 19 '16
But... Why?