Comment by ptx

3 years ago

> Variables aren’t immutable in any significant way because you can trivially turn an immutable reference into a mutable one.

To be fair, they didn't claim that the values were immutable, only the variables. Isn't the example in the article basically the same as Java's final variables, i.e. immutable references to mutable values?

> No global variables [...] Evaluation: V does not prevent you from creating and mutating globally shared state in any meaningful way.

Although I agree with the evaluation, the claim of "no global variables" might still hold, assuming it refers to mutable global variables. The global constant holds an immutable reference to a mutable value, just like how in Java a singleton object (or a class with mutable static fields) can be used to simulate global variables.

It's just a one line bug in the checker, which can be reported via github, but it wouldn't be as dramatic.

  • Maybe I misunderstood then. I was saying that it seems to behave basically like Java. Is that a bug?

    • V has global consts, they are immutable, but can be initialized with complex expressions, for example

      `const x = foo()`

      There's a bug that allows to trick the compiler and modify the const via another variable, it's a one line fix, and will be fixed today.

      Global mutable variables are only allowed with `-enable-globals` and are supposed to be used only in low level code, like drivers and kernels.

      6 replies →

  • This is absurd. It is now a V team's job to continue with, not the other way around. In fact, this kind of outsider perspective is very valuable to growing language communities because it's plain impossible to attain by themselves. As long as the article is not written in a derogatory tone (and I believe not) the OP's job is done by now.