Date: Mon, 14 Jul 2025 13:26:07 -0700
On Monday, 14 July 2025 01:14:00 Pacific Daylight Time SD SH via Std-Discussion
wrote:
> 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?
You need to describe more what you want and how it would work, somewhat. The
above is too vague a description.
For example, how is this different from code that gets run at load-time, before
main()?
I suppose you want it to mutate the executable file, so some constants would be
written to it. How would that be accomplished? How does one find the necessary
information in the binary to update? Don't answer debug information, because a
production-release build may not include it.
wrote:
> 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?
You need to describe more what you want and how it would work, somewhat. The
above is too vague a description.
For example, how is this different from code that gets run at load-time, before
main()?
I suppose you want it to mutate the executable file, so some constants would be
written to it. How would that be accomplished? How does one find the necessary
information in the binary to update? Don't answer debug information, because a
production-release build may not include it.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Platform & System Engineering
Received on 2025-07-14 20:26:15