Golang is case-sensitive, with “main” as the entry point. Main would be an invalid entry point. The official Golang compiler will fail the following code, however, Elements Gold compiler just passes without any complaints.
A complete program is created by linking a single, unimported package called the main package with all the packages it imports, transitively. The main package must have package name main and declare a function main that takes no arguments and returns no value.>
func main() { … }
Program execution begins by initializing the main package and then invoking the function main . When that function invocation returns, the program exits. It does not wait for other (non-main) goroutines to complete.
@mh you are right “Main” works too. I am just being paranoid for Gold not being “canonical” …
I guess - since Gold will extend Golang anyway, accepting “Main” is really not a problem, or we can treat it as just part of the extension.
Anecdotally, this reminds me of Microsoft’s C++/CLI and all its extensions (bad or good) to ISO C++ to fit in .NET . Some really like it, and some not.
Yeah, our main goal is that all Go code will compile in Gold (mainly to be used from the four other languages, as Go and Gold are severely limited e.g. by lack of classes, for use as main language for most project types), not necessarily that all code you wrote in Gold will back-port to standard Go.