-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Remove the subsumption inference used for label polymorphism #4776
Conversation
Trying to think of a solution without involving sub typing. I am thinking we compile the standard library with label polymorphism everywhere (so there is no alternate signatures to deal with). When checking queries outside of the standard library we do an extra pass before typechecking that checks walks the semantic graph and detects when a builtin using labels is accessed. For these cases, if we can statically infer that a builtin is called with string literals we use the type signature with labels, if we are unable to determine that a string literal is used we translate the type signature with labels to one without.
The cases where we can statically know that a string literal is used is simply
This should give label inference for most cases, except when users implement their own functions that takes a label as argument.
|
The documentation implies that these fields are mandatory to call this function and looking at the implementation it will indeed error if they are missing. Changing this is still technically a breaking change so maybe we want some caution before merging this? (#4773 could perhaps be used to allow an incremental rollout, or I could run this through the query log analyzer I made for #4776)
The documentation implies that these fields are mandatory to call this function and looking at the implementation it will indeed error if they are missing. Changing this is still technically a breaking change so maybe we want some caution before merging this? (#4773 could perhaps be used to allow an incremental rollout, or I could run this through the query log analyzer I made for #4776)
The documentation implies that these fields are mandatory to call this function and looking at the implementation it will indeed error if they are missing. Changing this is still technically a breaking change so maybe we want some caution before merging this? (#4773 could perhaps be used to allow an incremental rollout, or I could run this through the query log analyzer I made for #4776)
f944ea6
to
e8648d7
Compare
So I think the most reasonable plan to move forward here is to not have any sort of subtyping between labels and strings. To make use of labels we add a new syntax (I propose An option comes with the disadvantage that it is easy for people to just not use it so we will want to enable it by default on any new scripts that are created. (Potentially we could also check if old scripts work with label polymorphism and enable the option if they work). |
... and standard library. Extracted from #4776. Currently this supports consuming either an sqlite database or a csv file which are the two sources of scripts I am aware of at the moment. ```bash cargo run --release --bin analyze_query_log --all-features -- "../../../Downloads/2022-06-28_18 30_influxdb_data.csv" --new-features unusedSymbolWarnings ```
... and standard library. Extracted from #4776. Currently this supports consuming either an sqlite database or a csv file which are the two sources of scripts I am aware of at the moment. ```bash cargo run --release --bin analyze_query_log --all-features -- "../../../Downloads/2022-06-28_18 30_influxdb_data.csv" --new-features unusedSymbolWarnings ```
…4938) * chore: Add a tool to analyze the impact of changes to the typesystem ... and standard library. Extracted from #4776. Currently this supports consuming either an sqlite database or a csv file which are the two sources of scripts I am aware of at the moment. ```bash cargo run --release --bin analyze_query_log --all-features -- "../../../Downloads/2022-06-28_18 30_influxdb_data.csv" --new-features unusedSymbolWarnings ``` * chore: make generate
c8ba754
to
817c60d
Compare
Instead we ensure that every override are directly after the original.
Remove tests that checked subtyping
These alternative signatures are in the normal universe.flux now
The documentation already exists for the main signature
Just used for label polymorphism temporarily
Removes the old subsumption (subtyping) based label polymorphism in preparation of #4927, #4928 and #4929 . Tests that fail are ignored or removed if they assumed subtyping.
I also added the updated type signatures which are hidden by
@feature
usage so they do not appear in the current standard library.