I agree with you but one benefit of `fun` is that it aligns better with multiples of two spaces. It's important when lists end up wrapping:
/* Nice multiple of two spaces */
fun myFun
xyz
abc => {
doSomeThings(xyz, abc);
};
/* yikes, only one horizontal space between
* doSomething and abc on the line above */
fn myFun
xyz
abc => {
doSomeThings(xyz, abc);
};
I'm obviously no stranger to bike-shedding!Jokes aside, what would your highlighting do in this case?
type -> typ
switch -> swi
if -> iff
else -> els
in -> inn
downto -> dow
module -> mod
Call you language 3-letter reason. You see how it ridiculous it gets? You can't make all keywords be 3-letter and if people care about alignment, they can further align, but most don't care as much as you think!In this case, you don't even need the "fun" keyword as syntax-wise, "=>" alone can be used like in other languages as (parameter1, parameter2) => parameter1 + parameter2, for example - it's obvious enough without having to prefix with anything!
Anyway, I see that you want to be "different" in hopes to be "better", but, indeed, you're just "weird", instead.
"+." for float addition, "^" for concatenation, etc.
"(" <val> ":" <type> ")" instead of the shorter and more readable <val> "as" <type>.
For example, why did you choose "mutable" and not "mut"? See, your language is full of inconsistencies, it's not well-thought, it's not intuitive! For example, you chose "rec", which usually means "record" for "recursive"! In your "for"-loop, you have just "to", not "upto", but then "downto"! A good choice borrowed by some old languages would be to use the optional "by" <step>, which defaults to +1, but in a case of a "downto", would be -1, and thus giving you a more powerful loop!
And there are in fact issues with using x => y syntax for lambdas without a leading fun/fn keyword:
let x = (this, is, a, really, long, thing ) => 10;
- In that example it's not possible to tell if the leading ( is the start of a pattern for the sake of lambda, or a tuple. This happens with ES6 today as well (destructured record argument). It's not just a matter of human readability, it's a matter of building an efficient parser.
- The (x : y) syntax for type annotations is not new or weird to many people. That's the syntax used by ML, OCaml, and JS (Flow).
- We're likely going to swap some operators for string concat, so that it would be the more common ++ operator.
- The rest of the observations are good and we should address them soon.
Regarding ":" to denote type - I like it and it's widely used across various language, but not enforced with parentheses for typecasting.