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.
Re:V 0.3
by vlang1dot0 on Friday July 01, 2022 @07:35PM
(#31954432)
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.
Re:V 0.3
by amedvednikov on Friday July 01, 2022 @12:20PM
(#31948707)
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%.
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.