Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
#%deforestable
to the de-expander
A couple of things to note: 1. This de-expansion relies on the presence of the _name_ of the original form in the syntax of `#%deforestable`. But we have already discussed (meeting notes: "Playing Like a Grandmaster") that this is only a temporary feature of its syntax and we would like to remove it, as the compile-time metadata carried by the syntax (i.e., `info`) should contain all relevant semantics. In particular, the deforestation pass is intended to only operate in terms of stream primitives such as "transformers" and "consumers" to which all surface deforestable operations (such as `map` and `filter`) would translate. And if the form is undeforested, code generation at the last stage of compilation will use whatever implementation was provided by the user. In either case, a literal name is not needed. But if we remove it, how will we continue to "de-expand" this to provide a good error message? 2. The grammar of `#%deforestable` is slightly nontrivial and is another reminder that we are in actuality encoding a duplicate grammar here separately from the one already notated in Syntax Spec, and this could be prone to bugs.
- Loading branch information