Skip to content

allow multiple kinds of return types from main #535

@andrewrk

Description

@andrewrk

Currently, this is the main entry point function:

pub fn main() -> %void {

}

The bootstrap code runs it, checks the return value, and makes the exit/ExitProcess syscall.

If a zig user wants to do their own process exiting, however, they should be able to make the return type noreturn, and then the bootstrap code does not need to handle cleanup.

This shaves off a couple of bytes of bloat for some of our more hardcore users such as demoscene programmers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.enhancementSolving this issue will likely involve adding new logic or components to the codebase.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