jafingerhut / p4-namespaces

A public repo for discussion of adding namespaces to the P4 programming language
Apache License 2.0
5 stars 0 forks source link

Should there be a way to import all names from a namespace like `from my_namespace import *` ? #4

Open jafingerhut opened 2 years ago

jafingerhut commented 2 years ago

I would propose "please, no". Allowing P4 developers to write this seems to undermine the very reason for introducing namespaces to the language, i.e. allowing namespace authors to add new names later without fear of colliding with names used by P4 developers.

See the section "Should it be possible to import all names without enumerating them?" in the Google doc: https://docs.google.com/document/d/1NNC4t5NjAhzOhiC_DauiYrw80h1cXjZhshdRTuAPSnc/edit#heading=h.k0cwjwkry2ps

See the section "Suggested replacements for current standard include files" in the Google doc: https://docs.google.com/document/d/1NNC4t5NjAhzOhiC_DauiYrw80h1cXjZhshdRTuAPSnc/edit#heading=h.wbcucnck8ut7

for proposed replacements for files like core.p4, v1model.p4, psa.p4, tna.p4, etc. that still make it convenient for P4 developers NOT to have to write prefixes on all of the top level names defined in those files.