There is a new idea: execute code after compiling, before running, called pre-execution.
Then we have 3 stages to run code:
compile-time -> pre-execution -> runtime
Pre-execution can use the result of compile-time code, while compile-time code cannot use the former,
and runtime code is similar.
Follow this idea, it won't break the existing compile-time features, and we can slove the problem before, and it costs less time than the last.

Actually some projects and languages did it, such as Unreal Header Tool and build.rs of Rust.

Do you think it's feasible or not?

发件人: Std-Discussion <std-discussion-bounces@lists.isocpp.org> 代表 Thiago Macieira via Std-Discussion <std-discussion@lists.isocpp.org>
发送时间: 2025年7月14日 1:08
收件人: std-discussion@lists.isocpp.org <std-discussion@lists.isocpp.org>
抄送: Thiago Macieira <thiago@macieira.org>
主题: Re: [std-discussion] 回复: 回复: Compile-time Variables and Stateful Meta-programming / STMP
 
On Sunday, 13 July 2025 11:26:56 Central Daylight Time SD SH via Std-
Discussion wrote:
> If this option breaks the features above, we should give this idea up.

Ok, then it's settled.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering



--
Std-Discussion mailing list
Std-Discussion@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion