Skip to content
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

Model Variadic Elements with an Ion List #76

Open
dlurton opened this issue Jun 7, 2021 · 0 comments
Open

Model Variadic Elements with an Ion List #76

dlurton opened this issue Jun 7, 2021 · 0 comments

Comments

@dlurton
Copy link
Member

dlurton commented Jun 7, 2021

The Current State

Currently, the values of variadic elements are added to the end of a product definition. For example, given the definition:

(product nary op::operator args::expr)

The values of the variadic element appear at the end. The following nary instance has 3 values of the args element (denoted with a ^).

(nary (plus) (lit 1) (lit 2) (lit 2))
//           ^       ^       ^

The reason for modeling variadic elements in this fashion is that it helped adoption by one of our customers who were heavily reliant on the PartiQL V0 AST, which modeled its variadic elements in this fashion, however, that customer as since moved on from the V0 AST and this is no longer a consideration.

The primary disadvantage of this approach is that PIG product types are limited to only one variadic element, and that element must be the last element of the product.

The Proposed State

We should consider modeling variadic elements as lists instead:

(nary (plus) [(lit 1), (lit 2), (lit 2)])

This would allow PIG's product to contain more than one variadic element in any position.

Backward Compatibility

This would be a backward-incompatible change. Data persisted with older versions of PIG will not be easily readable by the newer versions. Consumers of the s-expression form of the AST will need to be updated to account for the new way variadic elements are modeled. Before this can be implemented, we will need to determine a strategy for dealing with the downstream impacts of this change.

@dlurton dlurton changed the title Model Variadic Elemnts with an Ion List Model Variadic Elements with an Ion List Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant