You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by human154 August 17, 2021
The suggestion is to replace this syntax (with the pub keyword):
pub fn someFunc(x, y) {
todo
}
pub type SomeType {
todo
}
with this (using a leading dash instead):
-fn someFunc(x, y) {
todo
}
-type SomeType {
todo
}
The obvious disadvantage of this is that the dash is less intuitively meaningful, however, it is easy to learn and we only need to learn it once.
Once it's meaning is understood, the dash syntax would be less noisy and easier to read. The 'pub' keyword is important but shouldn't be the central focus and currently it takes up slightly more mindshare than it deserves.
This would make it faster for humans and the compiler to parse the code and also easier to write and later modify.
The text was updated successfully, but these errors were encountered:
Gleam tries to avoid operators in favour of words because newcomers cannot google operator names, so this change will not be accepted I'm afraid. I also have concerns that this - would be unfamiliar to most and as such off-putting. We've tried to make the syntax as generally appoachable as possible (which is why we no longer have Haskell like syntax).
Ok, I wanted it but didn't expect it. :)
Your points are valid. I was willing to sacrifice other people's happiness for my own. :)
I thought I would give it a shot anyway.
I appreciate all your work and your responding so quickly!
I will close the issue.
Discussed in #1249
Originally posted by human154 August 17, 2021
The suggestion is to replace this syntax (with the pub keyword):
with this (using a leading dash instead):
The obvious disadvantage of this is that the dash is less intuitively meaningful, however, it is easy to learn and we only need to learn it once.
Once it's meaning is understood, the dash syntax would be less noisy and easier to read. The 'pub' keyword is important but shouldn't be the central focus and currently it takes up slightly more mindshare than it deserves.
This would make it faster for humans and the compiler to parse the code and also easier to write and later modify.
The text was updated successfully, but these errors were encountered: