In particular, many people close to the language make great-sounding claims, which are simply not true.
An example: if you go to https://vlang.io/, right there in "Safety" section, it mentions "No undefined values" and "No null (allowed in unsafe code)"
So you might think: great! This sounds like Rust but without all the tedious errors, I hate null pointer exceptions! But turns out this is pretty much a lie, there may be no "null" keyword, but it's not that hard to get it. Go to https://play.vlang.io/, enter the program and press "run":
x := []&int { len: 10, cap: 0 }
println(x[4])
flush_stdout()
println(*x[4])
I just this run this and got the response: &nil
/box/code.v:4: at main__main: RUNTIME ERROR: invalid memory access
/tmp/v_60000/code.01JVGJG6KBEYKWAMZZR4YPHR0S.tmp.c:10807: by main
Exited with error status 255
that sure looks like a null to me (except spelled "nil").. and behaves as it was a null too. And no "unsafe" in sight!Would you trust the language which outright lies about the basic features on its own front page? I certainly would not recommend so.
(Alternative interpretation is that this was not an intentional lie, but rather that language designers never thought how "no null" and "can create array of pointers without unsafe" rules would interact together.. That's even worse IMHO)
valunord•2h ago
Not a trustworthy article.