Replies: 7 comments 21 replies
-
I think this would lead to a very rigid syntax, which some people would like and some don't. As I wrote somewhere earlier, we could write automatic reformatters that adhere to only one specific form. For instance, we are doing exactly this in Scala. IMO it is too early to choose one form over another. Once we have a working plugin, we can conduct a user survey. The syntax is well-isolated in the parser. |
Beta Was this translation helpful? Give feedback.
-
My personal preference is towards (1) and (2), but neither globally. |
Beta Was this translation helpful? Give feedback.
-
Just on that point. Three forms are not hard to learn. We just have to explain them once. A large number of syntax forms a-la TLA+ are really hard to learn though. |
Beta Was this translation helpful? Give feedback.
-
I'm in favor of removing both (2) and (3), but feel more strongly about removing (3). If we want to prioritize flexibility of syntax in the direction of infix operators, I'd be in favor of us fully embracing that direction and going for mixfix notation via operator precedence grammars. Having this limited, special case treatment of each function as also an infix notation, with the (imo) very unusual trailing commas list doesn't make much sense to me. |
Beta Was this translation helpful? Give feedback.
-
The third form is probably the most obvious candidate for removal (except all math operators should be in this form). However, it may work for people who strongly dislike dots and parentheses, which is the direction of TLA+. Since we do not have the danger of Quint spreading in one day like JavaScript, we can afford a bit of experimentation. Removing things is easy. We see these three forms appearing in various languages, so I do not want people to reject the syntax for reasons like "it does look like Pascal or Python too much". Btw, the |
Beta Was this translation helpful? Give feedback.
-
Ah, that's a very good question. In TLA+, there is only one operator for them, which is called |
Beta Was this translation helpful? Give feedback.
-
In our discussion last week @konnov seemed to agree on dropping on the universal infix form of application. So this would leave us only with only applications form 1 and 2. This will also fix #79. |
Beta Was this translation helpful? Give feedback.
-
As stated in the language specification:
Three forms of operator applications
Quint is flexible with respect to operator applications. It mimics several call
styles that can be met in various languages. Given an operator called
f
andexpressions
e_1
, ...,e_n
, the operatorf
can be applied to theexpressions
e_1
, ...,e_n
as follows:f(e_1, ..., e_n)
.e_1.f(e_2, ..., e_n)
e_1 f e_2, ..., e_n
Although this allows more flexibility, it can also make the language harder to learn, examples more inconsistent, and overall bad to community interactions. We should probably choose one form and stick to it, as stated by @jtremback when he brought this to my attention.
What do folks think about sticking to the normal form and removing both UFCS and infix forms? @shonfeder @thpani @konnov @Kukovec @rodrigo7491
Beta Was this translation helpful? Give feedback.
All reactions