Open Gouwi opened 3 years ago
Both syntax are fine, and have pro and cons. One issue I see is that it will remove the one line function return, requiring an explicit return.
Appart from that, I don't think it will be accepted in main branch because some of the pros of the current syntax makes it more interesting than the comma separated expression syntax.
But if you are really motivated, make your own branch, converting the compiler should be quite trivial and straight forward, since it means mostly replacing checks for blanks/new line by ignoring blanks/expecting ';', with some corner cases. If you want to support both syntax, I think the main corner cases is the one line return function I pointed out earlier.
Wren is great : not only the language is well designed, but the implementation is concise and efficient.
It brings me joy.
However, i cannot stand the newline syntax as described here. So i started digging the code to research a way to implement an alternate (compatible ?) syntax which would allow to write Wren code on one line with, say, semicolons.
I created this thread for two reasons :
First, i would like to gather feedback from the community for such endeavour. I understand very well that newlines syntax is a major part of the language design decisions, but maybe there are others like me who prefer NOT to use Gravity as a workaround and stick to Wren.
Second, changing the syntax will require to rewrite parts of the Wren parser. I am not yet familiar with the implementation and I would like to know if someone with more experience can give me some pointers to analyze the code the right way.