Skip to content

Remove shebang support #2165

@hryx

Description

@hryx

Related:


Currently the tokenizer allows and skips over a shebang (e.g. #!/usr/bin/env zig) at the start of a source file. This feature is not documented nor is it part of the grammar.

I think the language should either explicitly support this feature or not support it at all. Right now it's kind of in a hazy middle ground.

Pros:

  • Removes logic from tokenizer, formatter, and any syntax highlighters
  • Acting sooner means nobody will come to depend on the feature

Cons:

  • There may be a legitimate use case for the feature — I'd love to get some input from others on this

Counterarguments:

  • It could be argued that this is a feature of the compiler implementation and not the language itself. But if the language docs specify source file encoding then I'm inclined to believe this is in scope as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions