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

Reimplement the hyperbracketed operations to avoid hypernests #6

Open
rocketnia opened this issue Mar 1, 2022 · 0 comments
Open

Reimplement the hyperbracketed operations to avoid hypernests #6

rocketnia opened this issue Mar 1, 2022 · 0 comments

Comments

@rocketnia
Copy link
Collaborator

The data structures Punctaffy defines for hypersnippets may be algebraically interesting, but they're difficult to make safe and efficient. We could try to push more of the costs for verifying that a hypernest or hypertee is internally consistent to construction time, but even then, our ADT-like constructor operations pose costs for constructing hypersnippets that are likely quadratic or worse, due to each constructor call having to traverse its input to verify that its hypersnippet shapes match up.

We don't have to use hypernests in the implementations of operations like list-taffy-map and taffy-quote. We can probably just use hyperstacks, which would impose a cost that's likely superlinear (due to certain popping operations having to check the given dimension against the dimensions of multiple candidate hyperstack frames) but typically linear in practice (since the number of dimensions we're actually dealing with only exceeds 3 or 4 if we're doing something really wild).

Where these operations need data structures, we'll likely be able to reuse punctaffy/syntax-object/token-of-syntax.

When we're revising things like list-taffy-map, list-taffy-bind, and list-taffy-let, we should basically embrace that they're quoting operations. Some call sites may need to use escape sequences to express certain code, particularly if that code somehow shadows the meaning of hyperbracket notations or defines local ones. A language that's based on hypersnippets from the very start of its formalism may constrain how hyperbracket notations can be shadowed or defined, and in so doing, it can remove the need for list-taffy-map to use escape sequences. We should keep on allowing list-taffy-map to be used in ways that resemble the more proper form it would take in those languages, but whenever we introduce escape sequence taffy-notation?, we should feel free to add support for it to list-taffy-map and friends.

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