News for hackers. Stuff that matters.
Re:An intro to Zig's integer casting for C programmers by tomp on Tuesday May 11, 2021 @02:10PM (#27121439)
juxtaposition (i.e. syntax that has meaning when two identifiers stand together separated only by whitespace) is generally a problem for parsing. Basically, it introduces all kinds of parsing ambiguities. Compare the following:

    a *b
    a * b
    a[n] x
    b [n]
    a<x> y
    a < x > 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.

Re:An intro to Zig's integer casting for C programmers by layer8 on Tuesday May 11, 2021 @03:54PM (#27122701)
> you can always also write the expected type, if you want.

But you have to read the code of people who didn‘t.

Re:An intro to Zig's integer casting for C programmers by scoutt on Wednesday May 12, 2021 @04:31AM (#27128067)
Exactly. Like when you see:

    var x = some_function();
What am I dealing with here? mmmmmm....

Ok... let's find some_function()... I hope my editor has "go to definition", otherwise "grep -r some_function ."...