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…
> What's wrong with "u8 x = 5;"? I believe it makes the parser marginally more complicated. Let's say you had a non-builtin type, "foo". The var trigger immediately declares what's going on. For "foo x = 5;" the parser must either 1) have contextual information that foo is a declared type or 2) wait to notice that there are two identifiers side-by-side and then resolve that this means "it must be a variable declarati…
This would mean that the "peace of mind" of the Zig compiler developer has priority over my own "peace of mind". That's not ok.
Is the compile developer reasoning "I don't care if the syntax is verbose, messy (or whatever), it just makes my job easier"?
> Honestly, C and C++ are very much in the minority for choosing this syntax
Java, C#, Objective-C....