Ideal language syntax
Kragen Javier Sitaker, 2017-07-19
(1 minute)
What would make a language syntax ideal for my tastes?
- Short keywords.
my or = instead of var, to or underlines,
instead of function, for or a vertical line instead of while,
maybe even do instead of while or for.
- Little punctuation. Python-style
: instead of {}. . instead
of ->. : instead of =>.
- Punctuation and keywords that follow existing prose use;
-- is far
better for comments than ; or #, which mean something totally
different in everyday life.
- Not fucking monospace.
- Infix syntax with either traditional precedence or required full
parenthesization in cases where it would change the meaning.
Because I don’t want to puzzle over why
a + b * c is giving the
wrong answer, only to find that it means (a + b) * c.
- By the same token, operator overloading; I certainly don’t want to
have to write
a.plus(b.times(c)) as in JS.
- Some kind of aspect weaving so that a particular piece of code can
be focused on only the things that are relevant to a particular
task — for example, dataflow, types, proofs, resource limits,
escape-analysis annotations.
- Lightweight lambdas.
- Extensibility, because sometimes lightweight lambdas aren’t enough.
Of course there are other aspects of programming languages that are
more important than the syntax, but the syntax is important.