Skip to content

Deprecate the SAWScript main feature #2560

Description

@sauclovian-g

SAWScript has a feature where after loading and executing a file, if it finds something called main in the global environment it then executes that.

This feature is not widely known, not widely used, and does not serve any real purpose.

Handling the panic in #2556 (in which this would try to execute anything, whether or not it was executable) also revealed that it's almost entirely undocumented. Furthermore, the checks require to avoid the panic while not also making the identifier main effectively reserved are annoying, complicated, and probably not very robust.

Rather than wasting energy documenting it, it seems like it might be a better idea to just deprecate the feature.

It's not a builtin but we can use the same process: initially if we find an executable main warn and execute it, later if we find an executable main fail, then delete the code entirely.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    subsystem: saw-scriptIssues related to the SAWScript language and/or its interpretation and executiontech debtIssues that document or involve technical debttype: enhancementIssues describing an improvement to an existing feature or capability

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions