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

Pointers and heap assignment (concept discussion) #148

Open
MattWindsor91 opened this issue Feb 22, 2017 · 5 comments
Open

Pointers and heap assignment (concept discussion) #148

MattWindsor91 opened this issue Feb 22, 2017 · 5 comments

Comments

@MattWindsor91
Copy link
Collaborator

Since GRASShopper is now an integral part of the Starling story, I feel like it's time to consider first-class support for pointers and heap assignment. This would allow us to:

  • more strongly check these operations in Starling to avoid errors propagating all the way to GRASShopper;
  • make it easier to re-use heap proofs with other backends in future;
  • make it easier to explain Starling's heap capabilities to other people, e.g. without having to talk about symbolics or GRASShopper in general.

I'll probably propose some syntax in a bit, but I thought I'd get the discussion open.

@MattWindsor91
Copy link
Collaborator Author

Quick syntax sketch for heap assignment:

<| *PVALUE = EXPR; |>
<| LVALUE = *PVALUE; |>

where PVALUE is an lvalue of pointer type. (We'd have to add pointer types to Starling, but can probably get away with treating them as a scalar type rather than a compound type for now.)

In this case, * would be part of the assignment operator, which is perhaps surprising. I'm not sure of a better way of marking this up though. One possibility that works for the first type is a new assignment operator <- or :=, but I'm not sure how you'd mark up the second type.

@septract
Copy link
Owner

septract commented Feb 23, 2017 via email

@MattWindsor91
Copy link
Collaborator Author

It's not a priority, though it's something I might be tempted to knock together over a few weekends.

The main advantages I can see are:

  • Tidier and easier to read proofs (fits with the idea of Starling being a model for 'developer-friendly' tools);
  • Not having to explain or skirt around symbols when explaining Starling to other people;
  • Having a stronger amount of syntax and semantic checking before handing to GRASShopper (ideally, there should never be any GRASShopper syntax errors);
  • Eventually, allowing more optimisations (symbols are a complete black hole when it comes to optimisations; there might be some things we can do with heap writes, but they'd probably be limited to eg. simplifying atomic actions).

On the other hand, doing this through symbols is a good demonstration of how flexible Starling is.

@septract
Copy link
Owner

septract commented Feb 24, 2017 via email

@MattWindsor91
Copy link
Collaborator Author

Adding noncritical as per Mike's assessment.

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

2 participants