Re:Moonbit: The fast, compact and user friendly language for...
by darkest_ruby on Saturday August 19, 2023 @09:07AM
(#37188385)
I would strongly recommend to only go with one syntax, and not differentiate between regular functions and lambda statement
[ Parent
| on HN ]
Re:Moonbit: The fast, compact and user friendly language for...
by ledauphin on Saturday August 19, 2023 @04:21PM
(#37192756)
I disagree - allowing for type inference on the closures will make for a much more pleasant language, whereas requiring type annotations on top level functions makes sense for lots of reasons.
Re:Moonbit: The fast, compact and user friendly language for...
by troupo on Saturday August 19, 2023 @04:39PM
(#37192931)
> allowing for type inference on the closures
You can still have your type inference without forcing the unnecessary requirement that local functions be `fn` while top functions be `func`.
Re:Moonbit: The fast, compact and user friendly language for...
by ledauphin on Saturday August 19, 2023 @07:31PM
(#37194406)
agreed, but there's still differentiation in syntax, and I was responding to someone asking for no differentiation.
Re:Moonbit: The fast, compact and user friendly language for...
by andrewcobby on Saturday August 19, 2023 @09:04PM
(#37194986)
I agree with this, I'm designing a similar language and have gone with this approach. Same syntax for all functions, but top-level functions require explicit type annotations (purely for documentation/sanity more so than a technical requirement).