News for hackers. Stuff that matters.
Re:V Language Review by mawfig on Saturday June 18, 2022 @05:53PM (#31794162)
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.
Re:V Language Review by prirun on Saturday June 18, 2022 @06:39PM (#31794447)
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.

Re:V Language Review by dkjaudyeqooe on Saturday June 18, 2022 @06:40PM (#31794454)
I think people think that's "marketing".
Re:V Language Review by rurban on Sunday June 19, 2022 @04:14AM (#31797327)
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
Re:V Language Review by creata on Sunday June 19, 2022 @05:10AM (#31797615)
What lies did the Rust developers make?

(Also, "nowadays" must stretch out to many decades if you're including Java!)

Re:V Language Review by rurban on Sunday June 19, 2022 @08:38AM (#31798742)
The three securities they guarantee and cannot hold.

Fearless concurrency.

Java also promised memory safety. I still get Null pointer segfaults in Java code.

Re:V Language Review by agluszak on Sunday June 19, 2022 @09:17AM (#31799065)
> The three securities they guarantee and cannot hold. Could you elaborate?

> null pointer segfaults They are not segfaults and are not related to memory safety. Segfault stands for "segmentation fault", not "runtime exception". https://en.m.wikipedia.org/wiki/Segmentation_fault

Re:V Language Review by thayne on Sunday June 19, 2022 @03:31PM (#31802575)
If you know of a case where rust code violates memory safety without the use of an unsafe block, file a bug and it will probably be fixed within a release or two.

"Fearless concurrency" is more subjective, but rust code (again with the caveat that there isn't unsafe code, or unsafe cose upholds all unvariants) dows eliminate certain classes of concurrency bugs. Although, dreadlocks are definitely possible, and certain kinds of race conditions could potentially exist. But I don't know of any claims that concurrency bugs are impossible in rust.

Re:V Language Review by rurban on Monday June 20, 2022 @10:24AM (#31810697)
do you your self a favor and search their ticket system for stack overflow. the list gets longer, not smaller.

and looking at their compiler it's clear why. stack-allocation of vars is fine and dandy, but comparable to vlang's famous unbounded autofree system. alloca() is dangerous for a reason.

unsafe vec, really?? mutexes in threads, really?? concurrent blocking IO in this decade??

also read their docs about their unsafeties, and concurrency deficiencies. compare that to the docs of real safe languages. you won't find such chapters, because safe languages are safe, not just almost-safe.

Re:V Language Review by thayne on Friday June 24, 2022 @12:12AM (#31857728)
> do you your self a favor and search their ticket system for stack overflow

First of all, most of those erorors are about stack overflows in the compiler not the compiled program. And secondly, stack overflow isn't a memory safety issue like, say use-after-free, uninitialized variables, data races, etc. If you allow recursive function calls, you can't really prevent stack overflows.

> alloca() is dangerous for a reason

Rust doesn't have an equivalent of alloca.

> unsafe vec, really??

I'm not sure what you are referring to here.

> mutexes in threads, really??

What does this have to do with memory safety? The only language with threads I know of that doesn't have mutexes is Erlang. And rust Mutexes are better than mutexes in most other languages because you can't access the data protected by the mutex at all, unless you have a lock. And the lock is automatically freed when it goes out of scope.

> concurrent blocking IO in this decade??

Again, what does this have to do with memory safety? And for many applications blocking IO is fine. You don't always need the performance of async I/O which adds complexity. And if you do need async i/o, rust has options there too (just not in the standard library).

> also read their docs about their unsafeties, and concurrency deficiencies.

The Rust Programming Language book has one section of one chapter on "unsafety", and that is specifically on using the `unsafe` escape hatch. Yes, there is a separate book about how to write a `unsafe` code that maintains rust's safety garantees. but that is limited to `unsafe` blocks, which in many cases you can just avoid using. As compared to c or c++, where the entire language is full of potential safety problems.

> compare that to the docs of real safe languages. you won't find such chapters, because safe languages are safe, not just almost-safe.

What "real safe languages" would those be? Can they be used in all the same domains as rust?

Re:V Language Review by amedvednikov on Monday June 20, 2022 @05:28PM (#31816219)
3 issues mentioning stack overflow:

https://github.com/vlang/v/issues?q=is%3Aissue+is%3Aopen+sta...

I've never had one in 3 years.

edit: ah, you meant Rust

Re:V Language Review by seebs on Sunday June 19, 2022 @03:44PM (#31802677)
Someone pointed out an obvious one: You can open the file "/dev/mem" or equivalent on many Unix systems and break things horribly, and rust can't tell that you're doing it or stop you. Someone used this to write an unsafe-free transmute, which is probably at least two different war crimes.

I doubt the rust team will try to "fix" that.

Re:V Language Review by zaarn on Sunday June 19, 2022 @05:41PM (#31803818)
How would anyone go about preventing you from doing that?

Keep in mind /dev/mem is just a convention, I can just mknod it at any place in the filesystem I want. I can even put a FUSE overlay on it that would turn it into a regular file instead of a device node, so you wouldn't have any possible way of telling what you're about to do.

There is no "defense" against /dev/mem, that's just something you don't do as a sane programmer.

Re:V Language Review by creata on Sunday June 19, 2022 @03:55PM (#31802790)
But you can get away with that in most languages that are generally considered memory safe, so a sane interpretation of the term "memory safety" wouldn't care about that.
Re:V Language Review by rad_gruchalski on Sunday June 19, 2022 @06:48PM (#31804273)
You most likely get NPEs, not segfaults. I have never seen a segfault in Java and the first Java version I used was 1.5.
Re:V Language Review by davidkunz on Sunday June 19, 2022 @05:27AM (#31797718)
The marketing sentence "A language empowering everyone to build reliable and efficient software." is not true.
[dead]
Re:V Language Review by munificent on Saturday June 18, 2022 @09:23PM (#31795322)
> 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.

Re:V Language Review by mawfig on Saturday June 18, 2022 @06:59PM (#31794565)
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.

Re:V Language Review by Tozen on Saturday June 18, 2022 @07:09PM (#31794642)
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.
Re:V Language Review by xena on Saturday June 18, 2022 @07:22PM (#31794710)
Good news: I'm never going to write about V again: https://xeiaso.net/blog/against-toxicity-programming-languag...
Re:V Language Review by yjftsjthsd-h on Saturday June 18, 2022 @11:50PM (#31796004)
I don't see how that follows? That blog post basically says "don't be toxic about languages". Unless you're using a much broader definition of "toxic" than I'd expect, that doesn't mean you can't write about languages, including fair critiques and even comparisons. I mean, take... "old school" PHP. By all accounts, PHP used to have a lot of sharp edges (in the sense that it was easy to "cut yourself" on it and accidentally do something bad). This was a legitimate, valid problem. It didn't mean that PHP was irredeemably bad, it didn't mean that a dev was A Bad Programmer for writing PHP, but it was true. You can discuss languages, even comparing them to others and pointing out flaws where they exist, without being "toxic" about it.
Re:V Language Review by xena on Saturday June 18, 2022 @11:58PM (#31796035)
A lot of that post is actually me wanting to be sure that my legacy isn't one of perceived toxicity. When you are in as many minority groups as I am, then you end up becoming an unpaid existential ambassador and you need to be hyper careful to not look like an asshole or do things that could possibly make you look like an asshole because people will assume that being an asshole is a representative sample of those groups. It is not, but logic is not this species' strong suit.

Plus, writing about how V is outright lying in its documentation gets boring because it's too easy. There's no real nuance or the like to it. It's someone overpromising and underdelivering, and then you also get the V cult going after you and sending so much hatemail. It's not worth it.

Re:V Language Review by yjftsjthsd-h on Sunday June 19, 2022 @12:08AM (#31796082)
Okay, fair; those are good reasons. I don't think those fall under the "toxic" label, but they stand on their own regardless.

(Not meant as an attack. I suspect that I might be splitting hairs too finely here; I can be a little overenthusiastic about terminology. If so, sorry.)

Re:V Language Review by delian66 on Sunday June 19, 2022 @03:47AM (#31797177)
Hate mail? Really? Care to post an example?
Re:V Language Review by ghusbands on Sunday June 19, 2022 @11:12AM (#31800125)
Hate mail is fairly typical in these circumstances. So is people asking for evidence. The possible next stages are also predictable:

1. They don't post it, and get accused of lying.

2. They post one of the tamer examples, and get accused of overreacting to nothing.

3. They post a median example, and get told that people reacting with vigour is normal and it's not about them.

4. They post a very strong example, hurting some readers and get responses claiming that you clearly can't take threats at face value.

5. They get accused of making it up, anyway.

6. They don't include personal details, so you can't do anything, anyway.

7. They include personal details and get accused of doxxing or making it personal.

There's just no good outcome from your request.

Re:V Language Review by delian66 on Monday June 20, 2022 @01:59AM (#31806789)
Yes, there is a good possible outcome - they post it, we see it, and then, if possible, we take corrective actions.

Especially after writing "people will assume that being an asshole is a representative sample of those groups. It is not, but logic is not this species' strong suit."

=> xena does acknowledge, that most people will assume that the whole V community is hateful, and even then, used terms like "V cult" and "hatemail".

Accusing an entire community of people of hate, for the actions of a single one, is not nice at all, especially, when it is done without evidence, with just vague descriptions.

Have you considered, that in all these, it may be the V developers, that are in the minority???

[dead]
Re:V Language Review by creata on Sunday June 19, 2022 @02:15PM (#31801839)
How could you possibly know that‽
Re:V Language Review by xena on Sunday June 19, 2022 @01:27PM (#31801390)
Not from you, from the V community.
[dead]
Re:V Language Review by xena on Sunday June 19, 2022 @02:05PM (#31801757)
From members of the V community then. I really hate playing these semantics games.
Re:V Language Review by Ta2000 on Wednesday June 22, 2022 @08:38PM (#31843746)
Well if you really felt that way I think you'd take any toxic programming articles down. They are etched into your GitHub at this point, so people will still reference them if eager... But at least taking that action of pulling such posts off your website will speak volumes about your character and standing by your words. Otherwise it's just more lip-service; not much different than Alex's lip-service you draw attention to.
Re:V Language Review by pwdisswordfish9 on Sunday June 19, 2022 @03:13AM (#31796987)
Implying here that any post about V is necessarily going to be toxic, because there aren’t any nice things to be said about it?
Re:V Language Review by maleldil on Sunday June 19, 2022 @01:39PM (#31801520)
Any post criticising V is seen as toxic by their supporters, apparently. You can see many examples of this in this thread.
Re:V Language Review by theamk on Saturday June 18, 2022 @09:02PM (#31795225)
What do you mean "falsely accusing"? Looks like Xe's blog was correct, V was vaporware back than.

According to this post, it still kinda is.. At least the most interesting parts like unique memory management is 100% vaporware.

Re:V Language Review by amedvednikov on Sunday June 19, 2022 @01:11PM (#31801232)
It wasn't vaporware back then, it isn't now.

Here's a 1.5 year old demo of V's autofree working:

https://www.youtube.com/watch?v=gmB8ea8uLsM

Re:V Language Review by super_flanker on Sunday June 19, 2022 @02:00PM (#31801707)
Again!! Same video you've been throwing on whoever asks about "autofree", knowing very well that it doesn't work.

I asked this question before and was banned on discord, do you have control flow graph analysis anywhere in V? If not, how do you suppose your autofree engine would work flawlessly?

Re:V Language Review by amedvednikov on Sunday June 19, 2022 @04:07PM (#31802911)
Also, we now have an operating system Vinix, which uses autofree. Does that work as a proof for you or is that also not enough?
Re:V Language Review by super_flanker on Monday June 20, 2022 @01:47AM (#31806736)
And that's why vinix [1] is full of manual free calls? That tells how good autofree is, isn't it? Can you compile v compiler with autofree? Last time I checked, you can't.

[1] https://github.com/vlang/vinix/search?q=free&type=code

Re:V Language Review by amedvednikov on Monday June 20, 2022 @07:56AM (#31809213)
Because surprise it's 0.2, and autofree has bugs, can you imagine?
Re:V Language Review by super_flanker on Monday June 20, 2022 @01:31PM (#31813073)
Nowhere from homepage you get the clue that it's 0.2, do you?
Re:V Language Review by amedvednikov on Monday June 20, 2022 @05:29PM (#31816254)
It says 0.2 right there in the center of the home page, under the big "The V Programming Language"
Re:V Language Review by delian66 on Monday June 20, 2022 @10:58AM (#31811130)
You can actually compile the V compiler with -autofree.

The resulting executable however does segfault - try it with:

    ./v -autofree -o x cmd/v
    ./x version
You seem to talk a lot about things, that you are not well informed about.
Re:V Language Review by super_flanker on Monday June 20, 2022 @01:33PM (#31813100)
> The resulting executable however does segfault

Doesn't give lot of confidence that it works, does it?

> You seem to talk a lot about things, that you are not well informed about.

Unlucky for you, it's not discord, you can't ban me here. So freaking deal with it.

Re:V Language Review by delian66 on Tuesday June 21, 2022 @09:07AM (#31823448)
I have never banned people on any platform.

Letting them speak and reveal how vile they are is better in my experience.

Re:V Language Review by amedvednikov on Sunday June 19, 2022 @02:04PM (#31801741)
Nobody bans for questions.

And the video I posted proves that it works. Keeping saying "it doesn't work" is ridiculous.

Re:V Language Review by vlang1dot0 on Sunday June 19, 2022 @01:33PM (#31801471)
Your demo includes code that uses manual memory management because of autofree bugs.

https://github.com/vlang/ved/blob/9b85e6291c9fe9135db1e300de...

Re:V Language Review by super_flanker on Saturday June 18, 2022 @09:14PM (#31795283)
And how did you conclude that author is "falsely" making any accusation? Is it similar to your last claim (1) that V doesn't have "null" (which has been debunked)?

(1): https://news.ycombinator.com/item?id=31084446

Re:V Language Review by delian66 on Sunday June 19, 2022 @05:24AM (#31797693)
> Bounds checking

    fn main() {
        x := []&int { len: 10, cap: 0 }
        println(x[4])
    }
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?

Re:V Language Review by delian66 on Sunday June 19, 2022 @05:07AM (#31797595)
> 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.

Re:V Language Review by jacknews on Saturday June 18, 2022 @08:30PM (#31795068)
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.
Re:V Language Review by joshuamorton on Saturday June 18, 2022 @09:34PM (#31795357)
For what its worth, the zig site has what is functionally this blog post for its own language: https://ziglang.org/learn/overview/. There's maybe a few spots where I think they could be clearer about some tradeoffs, but overall its very explicit about what the language can and cannot do, and if I were using this post's style, we'd end up with lots of green checks and 1-2 yellow squares, but nothing red.

Which really is the issue here: v makes a big talk but doesn't do what it says on the tin, while other languages, generally speaking, do. There's a difference between goals and features, and Zig distinguishes those well.

Re:V Language Review by mawfig on Saturday June 18, 2022 @08:36PM (#31795097)
Sorry, not yet. New to blogging and this took quite a long time to complete to a level I was satisfied with so it will probably be a while before I complete another one.
Re:V Language Review by _dain_ on Sunday June 19, 2022 @10:35AM (#31799773)
It is a very good first blogpost! I look forward to reading more in this genre. I would particularly like to see similar reviews of the Nim, Odin, Zig, and Janet languages.
[dead]
Re:V Language Review by _dain_ on Saturday June 18, 2022 @09:54PM (#31795435)
Do you actually have a substantive rebuttal? "The first and only thing he criticized is V" means nothing at all. What a childish thing to say.
Re:V Language Review by delian66 on Monday June 20, 2022 @11:02AM (#31811176)
It is a statement of fact. Everyone is free to make their own conclusions from that fact.
Re:V Language Review by delian66 on Sunday June 19, 2022 @04:43AM (#31797483)
> 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:

    fn main() {
        a := []&int { len: 1 }
        println(a)
    }

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:

    fn main() {
        a := []int { len: 1 }
        println(a)
    }
the program (printing `[0]`) will have worked correctly.

Edit: I've filed this in https://github.com/vlang/v/issues/14786

Re:V Language Review by ptx on Sunday June 19, 2022 @07:24AM (#31798313)
Hmm. So the claim article was examining here was "no undefined values", and you point out that the value is actually initialized to 0 and is thus not undefined.

However, the vlang.io page also makes the separate claim (as mentioned in the article) of "no null". But you seem to be saying that the bug in this case was actually a null pointer?

Re:V Language Review by delian66 on Monday June 20, 2022 @02:22AM (#31806930)
Yes, it is a null pointer, produced by the initialization to 0, as you noticed.

That is the current state - V wants to prevent setting pointers to arbitrary values, including 0, outside of unsafe code, but not all cases are checked yet, and you can get one. For example, you can also still cast numbers to pointers without unsafe{}:

    x := voidptr(0)
    println(x)
... and that will compile without an error, and produce `0x0`.

You can also search the issues, and find other examples of code, that ultimately produced null pointers.

Re:V Language Review by Tozen on Monday June 20, 2022 @08:45AM (#31809669)
> ...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...

You would think that someone taking that long to do an evaluation of claims would reach out to the V developers in some way. Like via bug report, e-mail, discord, or discussion... If a person doesn't want to give the appearance of doing an attack or "hit piece", you would think they would at least create some plausible deniability for themselves, by taking in account the perspective or response of the language developers.

I'm glad you are taking the time to do counter points and add issues on GitHub (https://github.com/vlang/v/issues), as this situation can be turned to being helpful for V. Whatever is in the evaluation that has some validity, can then be corrected or V developers can point how the evaluation was in error or mistaken.

Re:V Language Review by delian66 on Sunday June 19, 2022 @04:47AM (#31797511)
> 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.

    struct Node {
        val   int
        left  &Node
        right &Node
    }

    fn main() {
        n := Node { 123, 0, 0 }
        println(n.left)
    }
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

Re:V Language Review by seebs on Saturday June 18, 2022 @11:41PM (#31795962)
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.

Re:V Language Review by amedvednikov on Sunday June 19, 2022 @02:06PM (#31801766)
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".

Re:V Language Review by super_flanker on Saturday June 18, 2022 @09:19PM (#31795307)
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.
Re:V Language Review by delian66 on Sunday June 19, 2022 @05:14AM (#31797636)
> I see though that V supports closures. What are the rules for shadowing variables in closures?

    fn main() {
        x := 1
        y := fn (x int) {
            println(x)
        }
        y(x)
        y(2)
    }

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://github.com/vlang/v/issues/14787

update: I've responded to the wrong comment, it should have been under https://news.ycombinator.com/item?id=31794565