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

add current-var-assign parameter #12

Merged
merged 2 commits into from
Jul 7, 2017
Merged

Conversation

AlexKnauth
Copy link
Collaborator

@AlexKnauth AlexKnauth commented Jun 12, 2017

This pull request would allow the Typed Rosette project to do the equivalent of #10 by configuring the current-var-assign parameter.

@AlexKnauth
Copy link
Collaborator Author

@stchang Right now I have my branch of Typed Rosette written so that it works with this pull request, and, this is the smallest and simplest change I could think of. Should I merge?

@stchang
Copy link
Owner

stchang commented Jun 13, 2017

Dont merge yet. Let's think about the overall design rather than patching for a single use case. In general, we are trying to extend the framework to support more flow-sensitive type systems like occurrence typing and linear types.

Any change should also support what @iitalics is working on, which is a linear calculus. And it would be nice to design some parameterization that allows somewhat-nice syntax at the Turnstile level.

@iitalics: how much work would it take to push a linear example to your branch in #11?

@AlexKnauth
Copy link
Collaborator Author

AlexKnauth commented Jun 13, 2017

The new Turnstile notation that @iitalics proposed could also be achieved by going through this interface, by putting a parameterize around the infer call that defines current-var-assign as

(lambda (x seps types)
  #`(SPECIAL #,x #,@(stx-append-map list seps types)))

Where SPECIAL is a macro like VAR or LINEAR.

@iitalics
Copy link
Collaborator

This is a much simpler solution, but it's not going to work correctly with my Turnstile syntax (this might not be bad thing!).
Specifically, individual variables decide their behavior:

  [[NORMAL x ≫ x-] [SPECIAL y ≫ y-] ......]

I'm not sure how useful this is in practice, although it unifies type variables and regular variables as the same syntax (A [x ≫ x- : A] == [TYVAR A ≫ _] [VAR x ≫ x- : A]).

I'd think that typically, languages which need custom variable behavior uses that behavior consistently throughout, so it will usually be sufficient to set the current-var-assign parameter globally.

(Based on @iitalics work in pull request 11)
@AlexKnauth
Copy link
Collaborator Author

@iitalics:
From iitalics@d5b2cf3 can I infer that it's possible to base your syntax on using the current-var-assign parameter just the same as you could with #11?

@AlexKnauth AlexKnauth merged commit 9d3c55d into master Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants