|
|
|
|
|
by exceptione
171 days ago
|
|
In a Hindley-Milner (or deriative) type system, types doesn't have to be explicit, making the number of arguments ambiguous here: fn fib(n i32) i32 {}
But even if they need to be written explicitly, type applications like `List a` would require syntax to disambiguate them.Personally, I would like a language that pushes the programmer to write the types as part of a doc comment. Also think about returning lambda's. Should it look like this? fn foo(n i32) (i32 i32) {}
Of course the IDE could help by showing the typographic arrows and other delineations, but as plaintext this is completely unreadable. > And semicolons are an ancient relic that has been passed on to new languages for 80 fucking years without any good reason.
You still have to think about stuff like currying. You either delimit the line, or you use significant white space. |
|
It should be
It will also allow future implementation of named returns, like in Go: As for semicolon, that is needed only if you have inline expression: Or inline block, like in Go: