Confusing "Hello, World!"

The very first example of Nim code looks like this:

proc hello*: string =
  "Goodbye, Mars!"

The syntax looked a bit strange, but it compiles and runs. The procedure takes no parameters, so it’s fine I suppose. However - it’s extremely hard to find an example of Nim code where a procedure is declared without parentheses. It’s not in the “5 minute tutorial”, not in the official tutorial, not in “Nim for Python programmers” and seemingly not in the official manual either. But if you look very closely, you will see it implied in a Manual code snippet illustrating multi-line comments.

I don’t feel good about using very obscure language features in the very first program. For complete newbies, every character matters. I tried adding empty parentheses manually, and I messed it up :-) . It turns out the asterisk * goes before the parentheses.

For what it’s worth, that pattern has explicitly been part of the exercise since it was first added per Feature: Add stub files · exercism/nim@f8a38bb · GitHub.

CC @ee7-1282 @ynfle

I’ve posted about this on the Nim discord, hopefully it will be more explicitly described in documentation. (Python doesn’t allow this and gives you a SyntaxError straight away)