I am curious to know the reasons behind the @as() syntax. What's wrong with "i32 y = (i32) x;"? I look with interest to new languages but after so many years dealing with C, my parser crashes when I see the type after the variable name and at the end of functions declarations. var x : u8 = 5; What's wrong with "u8 x = 5;"? And I don't really like type inference very much (or when it's abused or cannot be avoided). Wh…
a *b
a * b
a[n] x
b [n]
a y
a y
e(1) f
e (1)f
Even for C/C++ this is complicated (you need the symbol table when parsing, to know if an identifier is a type or not), but for more advanced languages, it's even worse (e.g. if you support pattern matching / destructuring assignment).Declaring variables with var let's you also write let or const instead, giving the programmer more options (and making those options obvious as well).
You might not "like" type inference, but it really is superior to no-type-inference - you can always also write the expected type, if you want.