ion-docs
ion-docs copied to clipboard
Ion 1.1 spec needs to be updated to reflect changes in macro signatures and grouped parameters
trafficstars
- In a macro signature, macro parameters are contained in a s-expression rather than a list
- ~~Cardinality of parameters is no longer supported~~
- Parameter types are no longer grouped in a s-expression (e.g.:
(foo int))—the type is annotated on the parameter name (e.g.int::foo) (:),(:void), and(:values)macros are superseded by the stream syntax[:...]- A grouped parameter is indicated by putting
[]around the variable name (e.g.[foo]). When the variable has a type annotation, the type annotation stays with the variable name (e.g.[int::foo]). - The binary encoding uses presence bits for encoding macro arguments
- Presence bits are required in the binary encoding if and only if there are 3 or more parameters
- For a non-grouped parameter, a
1indicates the parameter is present, and0indicates argument is not present. - For a grouped parameter,
1indicates a present expression group, and0indicates no expression group for that parameter. - The text encoding no longer requires delimiting containers around the arguments for a grouped parameter. Instead, the arguments should be enclosed in the stream syntax.
I'm wary of several of these proposals. It's going to be hard to discuss with all of this under one issue.
- We agreed to delay implementation of parameter cardinality, not eliminate it. (As I work on the denotational semantic model, I'm becoming more convinced that we need more strong typing, not less.)
- Removing the S-expression from parameter type declarations eliminates a critical extension point. As an annotation, there's no good way to do anything but a type-name.
- I'm not immediately in favor of the stream syntax and would like to understand its rationale.
- Even given that, we still need void/values as system-defined macros for use in the template language.
- We should still have both
voidandvalues. I want to allow the former to accept and ignoreany*and thus act as an easy, structure-aware mechanism to discard a chuck of data. I find myself needing this almost daily when working with Ion-based DSLs.
We agreed to delay implementation of parameter cardinality, not eliminate it. (As I work on the denotational semantic model, I'm becoming more convinced that we need more strong typing, not less.)
That's my mistake.
I've created the following issues to handle these discussions independently from each other.
- #289
- #290
- #291