p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
670 stars 441 forks source link

Investigate replacements for boost Format for diagnostics #4784

Open vlstill opened 3 months ago

vlstill commented 3 months ago

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.

fruffy commented 3 months ago

Related: https://github.com/p4lang/p4c/issues/3898