p4lang / p4c

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

Make it possible to compile P4C without P4-14 support #4776

Open vlstill opened 3 weeks ago

vlstill commented 3 weeks ago

This would be useful for downstream projects that have no interest in P4-14. It would speed up compilation as well as any static analysis that uses compilation process as a source of what should be checked. This is somewhat related to #4674 as apparently the V1 converters take about 6 % of compilation time.

fruffy commented 3 weeks ago

Yes, very useful! Unfortunately, I do not have the cycles to push for this yet. This should be a CMake option with a define flag.

I wonder whether we should drop this code at some point, or keep maintaining it. There are the extreme approaches to maintenance: Microsoft-style (backwards compatible forever) or the Google-style (constant breaking changes).

ChrisDodd commented 3 weeks ago

I prefer Linux style (backwards compatible forever, but may require some extra shim work) as opposed to Microsoft (backwards compatible as long as it is conventient). Google style leads to dead projects quickly.