Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>The language used on the main vlang site also seems calm, clear and unsensational (at least to me).

It wasn't always like this. Back in 2019, its website looked like this:

https://web.archive.org/web/20190303184805/https://vlang.io/

As you can see the website claimed that its compiler is "200x faster" than C compilers, while neglecting to mention that it merely translates V code to C, so you still have to run a C compiler.

"400 KB compiler with zero dependencies" (apart from a C compiler and libc).

"As fast as C" - a lie.

Apart from deceptive marketing, there were serious issues with the code quality of the compiler:

https://github.com/vlang/v/blob/d32e538073e55c603992b5b65ebc...



"As fast as C" is not a lie. It literally translates to C.

The 200x compile speed up referred to C++ compilers, this was vague and hard to measure, since the languages are so different, and was removed.

The code may not have been perfect at the time of the 0.0.1 release, but it worked. V could compile itself.

Now it's much better and more organized.


>"As fast as C" is not a lie. It literally translates to C.

No, just because it outputs C it doesn't mean it's as fast as hand-written C. Using that logic, every language that outputs machine code is as fast as assembly, which is obviously not true.


If you look at the C that's generated using -keepc flag, I think you will be hard pressed to find any glaring inefficiencies to "hand coded C"; especially none of which GCC optimization wouldn't handle with -prod compiler flag. Even if there were, for the very large majority of users who are not highly proficient in C (which is becoming more and more common these days - Grey beards are rare), the V way is going to outperform novice to intermediate-skilled C programmers hands down.


I don't see how that really follows. V heap allocates any value which is address taken. You don't need to be an advanced C programmer to use pointers.


But it is true. V doesn't add any overhead. You can verify with `v -o file.c file.v`.

As long as you use the same data structures and algos, you'll get the same perf.

There's stuff like bounds checking, but it can be disabled, and it adds like 5%.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: