Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Including tail-callability in signatures #1

@sunfishcode

Description

@sunfishcode

An open question in the design space is whether to include tail-callability in function signatures. This would provide greater consumer flexibility for functions that are not tail-called. For example, non-tail-callable functions wouldn't be restricted to callee-pop calling conventions (on platforms where that applies).

This would also provide a tidy answer to the open question about tail calls to host functions: each host function would indicate its tail-callability in its signature.

Performing a tail call to a non-tail-callable function, or importing a non-tail-callable export as tail-callable, would have the same behavior as a type signature mismatch.

Performing a non-tail call to a tail-callable function, or importing a tail-callable export as non-tail-callable, could either:

  • behave as a type signature mismatch (simpler for spec and consumers, less flexible for producers), or
  • succeed (modest subtyping, more flexible for producers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions