Skip to content

Conversation

@keikun555
Copy link

Brili doesn't set the return code of what the main function of bril returns. This fixes that.

@sampsyo
Copy link
Owner

sampsyo commented Oct 29, 2023

This is an interesting proposal! I'm certainly open to the overall idea. But if we do add it, there are a couple of things we'll need to do:

  1. Decide whether we want the return value to be optional or required. I think the only workable option is to allow @main to return either nothing or int, i.e., yes, it's optional (and returning nothing produces an exit status of 0).
  2. We'll want to extend various other parts of this repo to reflect the change:
    • Add a description of the functionality to the docs.
    • Add tests.
    • Add to the reference type checker and ensure that no existing tests/benchmark disobey the rules (i.e., @main returns anything other than int).
    • Probably make an issue about extending other implementations (other interpreters and compilers) with the new feature.

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.

2 participants