I just write C programs that spit out C programs. My compilation is
always two-phase: first it builds a C program, then runs it, then it
compiles the output.
This was a little bit too broad for me but I didn't want to bother him again, I am sure he has more important things to do.
But maybe some of you guys know what he means?
I am already aware of macros and the preprocessor and I think there are now variadic macros in c11? So I am sure that one could use those to create some sort of metaprorgramming framework but I think Casey is doing it a little bit different.
In my head it looks like this:
1 2 | std::string foo_class = "class Foo { int bar, int baz};" writeTofile("Foo.h",foo_class"); |
But working with string seems a little bit cumbersome. How do you do metaprogramming in C? I couldn't find many resources on this topic.