Hacker News new | ask | show | jobs
by gridlocdev 1199 days ago
I’m pretty optimistic about V, it so far has great language ergonomics, solid performance, and memory safety through its “autofree” memory feature flag. https://vlang.io/
2 comments

V is progressing well, but in beta. It has to maintain its momentum and focus, without getting derailed, and deliver a polished useable 1.0 release.

> ...memory safety through its “autofree” memory feature

V has different memory management options, which can be turned off and the libraries don't depend on them. GC (default and optional), autofree, arena allocator (prealloc), or manual. This is mentioned in the documentation (https://github.com/vlang/v/blob/master/doc/docs.md). It has numerous safety features, as part of its design, and coupled with the GC (default) or autofree, would provide significant memory safety.

how does the scoping works? From the homepage:

    import os

    text := os.read_file('app.log') or {
        eprintln('failed to read the file: ${err}')
        return
    }

    lines := text.split_into_lines()
    for line in lines {
        if line.starts_with('DEBUG:') {
            println(line)
        }
    }
Is lines empty or program exited after the error at `app.log`
If there's an error at reading app.log, the error is printed, and the function is returned.

Code after that won't run at all.