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

Infer closure phase #3755

Open
MarkMcCulloh opened this issue Aug 9, 2023 · 5 comments
Open

Infer closure phase #3755

MarkMcCulloh opened this issue Aug 9, 2023 · 5 comments
Labels
🛠️ compiler Compiler ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl

Comments

@MarkMcCulloh
Copy link
Contributor

Feature Spec

When creating a closure, the phase is inferred by what is needed for the current situation if unambiguous:

bring cloud;

let bucket = new cloud.Bucket();
let queue = new cloud.Queue();

queue.setConsumer((message: str) => {
  // This is an inflight closure
  bucket.put("wing.txt", "Hello, ${message}");
});

() => {
 // this is still a preflight closure
}

Use Cases

less typing

Implementation Notes

I'm actually not sure I love this, but curious about other's thoughts

Component

Language Design, Compiler

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@MarkMcCulloh MarkMcCulloh added ✨ enhancement New feature or request 🛠️ compiler Compiler labels Aug 9, 2023
@eladb
Copy link
Contributor

eladb commented Aug 9, 2023

I think this is something we should introduce but at a later stage. Since preflight/inflight is such a novel concept, there's value in requiring more explicitness. But as the language and community matures, I think this is something we should introduce.

@Chriscbr
Copy link
Contributor

Chriscbr commented Aug 9, 2023

I'm curious if having phase independent functions (#435) would affect how inference is performed / when it's valid etc.

@staycoolcall911 staycoolcall911 added the needs-discussion Further discussion is needed prior to impl label Oct 4, 2023
Copy link

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!

Copy link

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!

Copy link

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ compiler Compiler ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl
Projects
Status: 🤝 Backlog - handoff to owners
Development

No branches or pull requests

4 participants