Compile Time vs Run Time
Timon Gehr
timon.gehr at gmx.ch
Fri Jan 12 15:27:24 UTC 2024
On 1/12/24 07:06, Walter Bright wrote:
>
> The compile-time vs runtime issue is the only thing left standing where
> the advantage goes to DIP1036.
This is not true, DIP1027 also suffers from other drawbacks. For example:
- DIP1027 has already been rejected.
- Format string has to be passed as a runtime argument.
- Format string has to be parsed. (Whether at runtime or compile time.)
- Format string is not transparent to the library user, they have to
manually escape '%'.
- No simple way to detect the end of the part of the argument list that
is part of the istring.
- Cannot support nested istrings. (I guess the `enum Format: string;`
would mitigate this to some extent.)
DIP1027 has the following advantages:
- No interspersed runtime arguments not carrying any runtime data, this
is a bit easier to consume.
- Fewer template instantiations.
In any case, I think the compile-time vs runtime issue is the most
significant. I do not want a solution that does not integrate well with
metaprogramming, it's just not worth it.
More information about the Digitalmars-d
mailing list