Hi,
John Levine wrote:
Take a look at PL/I. Its preprocessor lets you use a
large subset of
PL/I including if, goto, and do loops and most of the string and
arithmetic operators to write functions that run at compile time and
put their results into the source file.
Another approach is for the language to offer evaluation at compile
time.
- FORTH had COMPILE and IMMEDIATE to switch modes; there's POSTPONE as
well now.
- Zig has comptime.
https://ziglang.org/documentation/master/#comptime
https://ziglang.org/documentation/master/#Case-Study-print-in-Zig
--
Cheers, Ralph.