HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
17.21k stars 426 forks source link

Improvement in fun syntax #641

Open Satheeshsk369 opened 1 month ago

Satheeshsk369 commented 1 month ago

Is your feature request related to a problem? Please describe. I like that, bend support both haskell and python like syntax. But when i am writing in fun syntax in bend, i need to always put the code inside parentheses. I feel that, it is more convenient to write function without it. Then the code will more readable and more haskell like..

main = (fact 10)

fact 0 = 1
fact n = (* n (fact (- n 1)))

Describe the solution you'd like Is any possible to write the function (in fun syntax) without parentheses? like below..

main = fact 10

fact 0 = 1
fact n = n * fact (n - 1)

Describe alternatives you've considered None

Additional context None

developedby commented 1 month ago

The syntax was deliberately chosen to require parentheses in every application and not have infixes since it's simpler and the meaning is always clear.

Not that I'm straight up denying your suggestion, but it requires a lot of thought on how it fits with the overall goal and design of the language