Live data from Hacker News

The V Programming Language

vlang.io

231–240 of 308 posts

Re: The V Programming Language

#231
post #154
post #150

Earlier quoted context omitted.

> No GC How does that improve upon Go? Memory safety is much harder without a GC

Isn't it usually game programmers who advise against GC because you can't predict when it will run and the performance impact it will have.

Game programmers and also people who seem to think that Garbage Collection involves burning babies and the hundreds of academics and engineers working on it are somehow doing it out of spite.

There are reasons not to use a Garbage Collector but 99% of the time they are absolutely fine if you understand what your particular GC does and does not do

Re: The V Programming Language

#232

After going through the source code, I can tell for sure that it's an insecure C transpiler. - Most things call just out to C. - A lot of examples don't even compile. - Some things use CLI curl or mkdir, this is /INCREDIBLY/ insecure. - Many things are unimplemented. - Dev banned me off org when I opened issues about these and deleted issues. I was unnecessarily rude on some which I apologize for, but deleting them a…

>I was unnecessarily rude on some which I apologize for, but deleting them and calling me a troll was uncalled for.

I wouldn't say troll, but you still come out as rude-ish in this comment.

"- Some things use CLI curl or mkdir, this is /INCREDIBLY/ insecure."

Not anymore than tons of established projects that use the same...

Re: The V Programming Language

#233
post #156
post #150

Earlier quoted context omitted.

> No GC How does that improve upon Go? Memory safety is much harder without a GC

It is not in my opinion. With modern development tools/frameworks providing memory leaks detection I have completely forgotten when was the last time that my programs leaked memory. And I write complex high performance game servers that run for months non stop. You just have to acquire certain culture/behavior when writing code.

All the code I write at the moment is GC-free (By circumstance), but it's clear that not using a garbage collector is a tradeoff between runtime nondeterminism and the complexity of the code (How many of Herb Sutter's talks on smart pointers could have been eliminated if C++ had a garbage collector available, for example) or compiler/language complexity

Re: The V Programming Language

#234

Hello, Developer here. The release was messed up by me having serious git troubles. I had to destroy the repository twice, as the result and old README file with the wrong instructions resulted in everyone having segfaults. Everything will work as expected in a couple of days. Launching such a big project for hundreds (thousands?) of testers is not easy.

So, what are the correct instructions?

I followed the instructions on the GitHub and yes, I'm getting segfaults.

Re: The V Programming Language

#235
post #156
post #150

Earlier quoted context omitted.

> No GC How does that improve upon Go? Memory safety is much harder without a GC

It is not in my opinion. With modern development tools/frameworks providing memory leaks detection I have completely forgotten when was the last time that my programs leaked memory. And I write complex high performance game servers that run for months non stop. You just have to acquire certain culture/behavior when writing code.

Also, Garbage Collection can be extremely fast when done properly: The Decision to use a garbage collector could be done on performance grounds as well but Garbage Collectors are generally harder to tune than reference counting.

Re: The V Programming Language

#236
post #150

Earlier quoted context omitted.

> No GC How does that improve upon Go? Memory safety is much harder without a GC

GCs are good for some things and bad for others. I wouldn’t want to write an OS with a GC but I also wouldn’t want to write a web server where I have to manually allocate and free memory. It’s all a trade off.

You shouldn't be manually allocating memory anywhere if you malloc and free. I feel quite strongly about the use of C in modern systems code: The "C" way of doing things can often be very unsafe or at least prone to being unsafe (No fault of the programmer, but if you don't provide RAII and things like that by default it becomes too easy to double free or leave bounds unchecked)

A kernel doesn't really need a garbage collector, but keep in mind that some modern GCs can literally be tuned to have ms pause times on absolutely enormous heaps which given that reference counting can have unbounded pause times too can make them an enticing option.

The real reason to avoid garbage collection is typically memory usage in my experience

Re: The V Programming Language

#237
post #169
post #156

Earlier quoted context omitted.

It is not in my opinion. With modern development tools/frameworks providing memory leaks detection I have completely forgotten when was the last time that my programs leaked memory. And I write complex high performance game servers that run for months non stop. You just have to acquire certain culture/behavior when writing code.

What tools for memory leaks detection you can suggest?

Valgrind (Which also has a bunch of other stuff like cachegrind, which can be a godsend if you are getting telltale cache/branch prediction issues but you can't find where etc.).

Clang/GCC both have suites of sanitizers which are usually excellent and easy to grok, these are also available in many language frontends based on LLVM (and maybe GCC?)

You can just throw every tool you can find at your CI if you're paranoid, too.

Re: The V Programming Language

#238

Earlier quoted context omitted.

Global state is a feature, not a bug. It's absolutely necessary for a number of application domains and disallowing it by design makes the V language totally unsuited for them

Eh, not a big deal. Just move "global" (aka: main() ) up 1 function. And then, run everything in that function. Hell, it could be a try-catch loop equivalent.

That kind of assumes you have a main() function.

Re: The V Programming Language

#239

Despite the immense neophobia of Hacker News, I'll jump forward and say I think there's a lot to love around vlang. Go is an amazing language and my go-to language for most backend tasks these days, but often when jumping back from Python, it feels needlessly cumbersome. Now don't get me wrong, I'm not talking about any "magic", Go is exactly as great as it is, because it's so simple and barebones. I'm talking about…

"neophobia" on HN? That's hilarious.

Re: The V Programming Language

#240
post #142

Hm I looked around the repo, and there doesn't seem to be much there. $ find . -name '*.v'|xargs wc -l|sort -n ... 314 ./glm/glm.v 330 ./time/time.v 338 ./builtin/utf8.v 339 ./examples/tetris/tetris.v 490 ./os/os.v 630 ./compiler/scanner.v 644 ./compiler/table.v 712 ./gg/gg.v 814 ./builtin/string.v 845 ./compiler/main.v 848 ./compiler/fn.v 3216 ./compiler/parser.v 12573 total I'm a big fan of compact code, i.e. doing…

Where did you find `v.c`?

Is this v.c file not versioned in the GitHub repository?
Post reply on HN