From 9f6fe4ad5509a0a998a971a9a46cfd104684b9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lenkefi=20P=C3=A9ter?= Date: Thu, 11 Aug 2022 12:23:19 +0200 Subject: [PATCH] Create EntryPoint.md --- Specification/EntryPoint.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Specification/EntryPoint.md diff --git a/Specification/EntryPoint.md b/Specification/EntryPoint.md new file mode 100644 index 0000000..064eb39 --- /dev/null +++ b/Specification/EntryPoint.md @@ -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.