Clarity on syntax especially as regards to line endings #824
the-erin-collective
started this conversation in
Language design
Replies: 1 comment
-
We've based our syntax on Swift, which made the same choice. In general, starting from an existing language gives us confidence in specific design choices that have been shown to work. The fact that Javascript, Typescript, and Kotlin (to cite a few) have gone the same road is just further evidence that we're not making a mistake. Semicolons add unnecessary noise in most cases because of the natural way statements read. There might be useful sometimes, which is why we can add them optionally. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Regarding the fact that Val doesn't use line endings, apart from Js/Ts the semicolon is usually required when there are also braces {}, I guess I'm used to being able to ignore whitespace mentally via explicit endings of blocks and lines, not just blocks. It looks like Val has gone with mapping the new line character to line endings, if I'm not mistaken, which means we do need to care about whitespace using it?
I'm interested in the reasoning behind this design choice and how it aligns with the rest of Val's syntax. Hopefully getting an understanding of the thought process would be beneficial for others too.
Beta Was this translation helpful? Give feedback.
All reactions