fir-lang / fir

MIT License
23 stars 3 forks source link

Drop the `fn` keyword for function declarations? #6

Open osa1 opened 2 months ago

osa1 commented 2 months ago

Dropping the fn keyword causes no ambiguities in the grammar. It's easy to parse (both for humans and the compiler) because all the other declarations start with a keyword (currently: type, trait).

Adding constant declarations should also not be a problem, we can decide whether we're parsing a function or a constant based on the left paren.

The fn keyword would still be used for lambdas.