Summary is that boost is problematic by itself and replacing boost::format is one of the critical steps to getting rid of it. One possibility would be to use fmt and later std::format.
The biggest problem with this is that other formatter will likely use a different syntax for placeholders, which would require all diagnostics (including in downstream projects) to be rewritten and this change would be quite hard to check as mistakes in placeholders would lead to runtime failures.
This was discussed in https://github.com/p4lang/p4c/pull/4347#issuecomment-2207101317.
Summary is that boost is problematic by itself and replacing boost::format is one of the critical steps to getting rid of it. One possibility would be to use fmt and later
std::format
.The biggest problem with this is that other formatter will likely use a different syntax for placeholders, which would require all diagnostics (including in downstream projects) to be rewritten and this change would be quite hard to check as mistakes in placeholders would lead to runtime failures.