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

Asynchronous env.exit() is undesirable!? #22

Closed
plajjan opened this issue Jul 20, 2021 · 1 comment
Closed

Asynchronous env.exit() is undesirable!? #22

plajjan opened this issue Jul 20, 2021 · 1 comment
Labels
question Further information is requested syntax Related to the Acton language syntax / design

Comments

@plajjan
Copy link
Contributor

plajjan commented Jul 20, 2021

Hmm, so I was a little perplexed over how my program apparently did things after I called env.exit(0), which I suppose must be because it will run async since there is no assignment happening. Changing to

foo = env.exit(0)

fixes it by exiting immediately as I expected.

Is this good? We've talked about async before, what to do implicitly and what to do explicitly (i.e. require keywords). Not sure if there is something new to be said. Maybe just complete our documentation and move on ;)

@plajjan
Copy link
Contributor Author

plajjan commented Jul 22, 2021

@nordlander and I discussed this. It is likely that the wanted behavior here is to run env.exit() synchronously but making exceptions in the compiler is bad. One idea would be for env to not act as an actor but an object or methods on the own actor? Special but still sort of fits in the overall model.

I think this is mostly about the learning curve and I still think too much in Python and get surprised over the sync/async behaviour.

The idiomatic way to fix this is doing await async env.exit(0). I'll close this for now and maybe we'll revisit in the future... or maybe not ;)

@plajjan plajjan closed this as completed Jul 22, 2021
@plajjan plajjan added question Further information is requested syntax Related to the Acton language syntax / design labels Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested syntax Related to the Acton language syntax / design
Projects
None yet
Development

No branches or pull requests

1 participant