Comment by mawfig
3 years ago
Thanks for linking Xe's blog here! It's a few years old and I've seen a lot of comments on HN that suggest V has improved significantly since 2019 so I thought it might be worth looking into for myself and writing down a review of what I found.
I'm always interested in new languages and loved your write-up & evaluation of V.
I really don't get the purpose of someone exaggerating the capabilities of their language, to the point of outright lies.
I think people think that's "marketing".
Unfortunately that's needed nowadays to succeed. Java, Rust and many other would not be successful without standing on the shoulders of its big lies
What lies did the Rust developers make?
(Also, "nowadays" must stretch out to many decades if you're including Java!)
14 replies →
> Remember, the competition between various younger languages has become a bit fierce and dirty.
As someone who works full time on one relatively young language, has created a couple more, and knows people working on many others, this is 100% wrong in my personal experience.
Most young language teams work very hard to communicate accurately and to set appropriate expectations because they know that user trust is a hard requirement for adoption.
V is the outlier here.
Every evaluation in my blog is fully reproducible from the version of V I linked to and I've included all the source code used as well. My post stands on it's own.
Instead of insinuating I'm some kind of competitor or have a personal agenda, I would encourage you to respond to the actual points raised in my post.
That's interesting or telling, because if you read what I posted carefully, I was not insinuating anything about your evaluation. Instead, the point was being made that you probably don't want to be associated with an old evaluation from 3 years ago, which is falsely accusing V of being vaporware, and where the author and the developer of V clearly have beefs with each other.
31 replies →
> Bounds checking
Again, a bug caused by the auto generated string conversion method for arrays of pointers, that does not check for nil pointers. Once https://github.com/vlang/v/issues/14786 is fixed, that will work too.
It has nothing to do with bounds checking, as you can see if you just use `x := []int { len: 10, cap: 0 }` instead.
> Allowing the user to control the len property is a really bad idea.
Can you clarify what you mean by that?
> No undefined behavior
You do have a point here, and we should update the site and the documentation. The current state of V, is that most of the undefined behaviors of C for numbers are also undefined in V too.
Are there any other language evaluations in your blog, or a plan for any, etc? I'd like to read other reviews, but I only see this one post.
6 replies →
> I would encourage you to respond to the actual points raised in my post.
ok, here is the first thing that I noticed, reading your blog post/review.
> No undefined values ... > C allows you to use an uninitialized variable which can result in Undefined Behavior. I’ll assume that’s what this means. ... > Typically, uninitialized values come from a memory allocation that hasn’t been written to. ... > Let’s see if we can get the V compiler to allocate memory for us without writing to it:
That program segfaulted in the automatically generated string conversion method for the println() call (you created a 1 element array of pointers, and since each of the elements is initialized to 0, you got a 0 pointer, then println tried to show that, but the automatically generated string conversion method did not check for 0 pointers -> the segfault).
TLDR: the autogenerated string conversion method has a bug, that will be fixed soon.
Ironically, the cause is the opposite of what you intended to show - the memory for the new array was initialized to 0.
I would have appreciated a bug report in https://github.com/vlang/v/issues , that could be properly tracked till resolution, but apparently people these days have an entire month to dedicate on writing a "review" with a "Rules of engagement" section, but do not have 5 minutes to submit a github issue ¯\_(ツ)_/¯ ...
btw, if you instead of the above did:
the program (printing `[0]`) will have worked correctly.
Edit: I've filed this in https://github.com/vlang/v/issues/14786
3 replies →
> No null > The V docs indicate V has references and “in general, V’s references are similar to Go pointers and C++ references”.
The V documentation also has this: https://github.com/vlang/v/blob/master/doc/docs.md#structs-w...
> Structs with references require explicitly setting the initial value to a reference value unless the struct already defines its own initial value.
> Zero-value references, or nil pointers, will NOT be supported in the future, for now data structures such as Linked Lists or Binary Trees that rely on reference fields that can use the value 0, understanding that it is unsafe, and that it can cause a panic.
This is also another example of a program, that would have been perfect as a bug/issue report, so thanks for that I guess.
Edit: filed under https://github.com/vlang/v/issues/14785
You say it "comes off as part of an effort ... to mount another attack". Maybe it does to you, but I don't know why. I've never heard of this "fierce and dirty" competition between young languages. I've never seen anything even a bit like that. I've only seen fierce fighting between advocates of large well-established languages.
Xe's post struck me as accurate at the time, and having that context to compare with makes V look a little better now, because it at least establishes that progress is being made towards those claims.
I don't know where you're getting the idea that this is based on some kind of sinister "personal agenda" other than "this thing sounds interesting, I investigated it, it seems less cool now", which is a pretty defensible position for someone to reach.
It's not accurate. For example, measuring the performance of a debug build, with slow backend, without vlib cached, and with vfmt on.
You can see that V is actually as fast as is claimed on the website:
https://www.youtube.com/watch?v=pvP6wmcl_Sc
Same with other points from the author that publicly claimed that "V has to die".
You are not doing yourself any favor by harassing people, if anything it makes you look like a fan-boy. Do yourself a favor, read the article then present a constructive criticism, if any.
> I see though that V supports closures. What are the rules for shadowing variables in closures?
I am not sure I follow - the `x` parameter for the anonymous function, is entirely different, than the `x` in the main function. For me, there is no way for it to be confused with the `x` inside main.
... y := fn [x] (x int) { println(x) } ...
> Well, that seems like it should be disallowed. It makes sense that x can be captured but to then shadow the argument with the same name without error or warning doesn’t seem inline with the rest of V’s behavior.
I see what you mean now, yes, that does seem like another good issue candidate. Filed in https://news.ycombinator.com/item?id=31794565