Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RFC0004 - Entry point #78

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Specification/EntryPoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Application entry point

This RFC describes the entry point of application-style projects. Note, that the specification leaves out some details that will be filled in by other RFCs.

## Possible signatures

The entry point has to be a free-function named `main` (case-sensitive). The allowed parameterization/return types:
* `func main(): unit`
* `func main(): int32`, where the returned value is the exit code of the application

A future RFC will add the possibility to take a string array as a parameter for the CLI arguments. This has to wait until the array type syntax is specified.

## Placement in the project

The exact details will have to wait for the module system specification, but the entry point will likely have to be placed in the main, top-level module file.

The rationale behind this is to introduce a convention to easily navigate to the true entry point of the application. Many C# projects already used `Program.cs` for this as a soft convention.