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

Modal harmony #148

Merged
merged 45 commits into from
Apr 19, 2022
Merged

Modal harmony #148

merged 45 commits into from
Apr 19, 2022

Conversation

nikomatsakis
Copy link
Member

@nikomatsakis nikomatsakis commented Mar 3, 2022

This branch implements #143. It's not quite where I want it to be yet, but close enough I figured I'd open it up so that there's a preview + playground etc.

Here is a list of things I have done and have yet to do (will update as I go, this is off the top of my head):

  • Add specifiers my, our, etc
  • Change leasing an our value to yield another our value, instead of our leased (preserves all invariants, more convenient overall)
  • Check that values assigned to a my etc location meet the requirements
  • Change the default specifier from any to our leased
  • Ensure that when unique things are stored in shared locations, they are shared (example where it goes wrong today)

@netlify
Copy link

netlify bot commented Mar 3, 2022

Deploy Preview for dada-lang ready!

Name Link
🔨 Latest commit 44adcbd
🔍 Latest deploy log https://app.netlify.com/sites/dada-lang/deploys/625e8227057b540008fb4786
😎 Deploy Preview https://deploy-preview-148--dada-lang.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@nikomatsakis nikomatsakis mentioned this pull request Apr 18, 2022
4 tasks
This check happens now more as an artifact of
creating a temporary, but it's useful.
The idea is that if you have something typed as
`my String`, you cannot necessarily convert it to `our String`
in place and remain well typed, but you can consume it and produce
an `our String`.
This is the general pattern I want to move towards.
Egregious oversight in the permisions logic!
messier commit than I would like but oh well.
(they seem to be working as I expect)
the output the test isn't, I think, what we want, but before
this change the test was failing with a dramatic runtime error
Previously we were using reservations for this,
but that created a kind of confusion... does

    x := p.reserve

confirm the reservation or just store it? What about

    x.f := p.reserve

This is precisely why AssignFromPlace and friends were
added.
to allow specifiers to work, we need to introduce temporaries
This means that `our leased` is a very general
default that works well whenever you are reading
things. Basically "our leased" means "something I can
read for as long as this place is alive".

This helps to align the left-to-right evaluation
semantics in tricky situations, as well, since reserving
a location that is shared can always just clone it.
`AssignFromPlace` should be used for user-defined variables,
since that affords the opportunity to apply the user's specifier
@nikomatsakis
Copy link
Member Author

bors r+

I'm going to go ahead and land this -- further progress in this direction is tracked by #159

@bors
Copy link
Contributor

bors bot commented Apr 19, 2022

@bors bors bot merged commit f572cbe into dada-lang:main Apr 19, 2022
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.

1 participant