The VikiD Truth

Knowledge base / Computing

Read This! | | Quick Links | Algorithms | AssemblyLanguage | BASH | C-Programmming | CommonLisp | Computer Security | Databases | Emacs | Exploitation | Functional Programming | Firewalls | Git | Haskell | Javascript | Julia | Social Engineering | Picolisp | Pharo Smalltalk | Linux | Python | Operating Systems | Machine Learning | Metasploit | Open Data Science | Networking | Machine Learning | Racket | Scheme | Unity | vim | V | Web Development | Windows WSL

The V Programming Language

Here is the truth about V: it wants to be the language you can learn in a weekend and ship with on Monday – Go’s simplicity, C’s speed, Rust’s safety goals, without the steepest parts of any of them. Whether it fully delivers depends on what you need, but the ambition is clear and the tooling is pleasant.

What it is, in plain words

V (vlang.io) is a statically typed, compiled language created by Alexander Medvednikov, publicly announced in 2019. It compiles to native code via C (or its own backends), emphasises fast compilation, and aims for a small, readable language surface:

V is still young (pre-1.0 for a long time, now maturing through 0.4.x). The compiler and stdlib move quickly; pin versions in real projects.

Why it matters

There’s a gap between “I want something simpler than Rust” and “I don’t want Go’s empty interface{} years”. V aims at that gap, and its compile times are genuinely impressive. For CLI tools, small web services and people coming from scripting languages who want native binaries, it’s worth a look alongside Zig, Odin and Go.

An everyday analogy: a well-labelled toolkit

Rust’s toolkit comes with a lockout system and a thick manual. C’s toolkit has unmarked sharp tools. V tries to be the toolkit where every tool is labelled, the dangerous ones have sheaths, and you can build a shelf before lunch.

flowchart LR
  V[".v source"] --> C[v compiler]
  C --> T[translate / codegen]
  T --> CC[C toolchain or native]
  CC --> B[binary]

A hands-on example

# install via upstream instructions, then:
v version
mkdir hi && cd hi && v init
module main

struct Machine {
    name string
    wm   string
mut:
    uptime_days int
}

fn (m Machine) describe() string {
    return '${m.name} runs ${m.wm}'
}

fn (mut m Machine) tick() {
    m.uptime_days++
}

fn safe_div(a f64, b f64) !f64 {
    if b == 0 {
        return error('division by zero')
    }
    return a / b
}

fn main() {
    mut box := Machine{
        name: 'vikix'
        wm: 'StumpWM'
        uptime_days: 12
    }
    box.tick()
    println(box.describe())

    nums := [3, 1, 4, 1, 5]
    squares := nums.map(it * it)
    println(squares)

    if x := safe_div(10, 4) {
        println(x)
    } else {
        println(err)
    }
}
v run .
v -prod .

v fmt, v test, v install <module> cover the everyday loop. v up updates the compiler.

Where V feels good today

Where I’d pause: very large teams, ecosystems that need mature async story or heavy package depth, and anything that needs long-term API freezes. Match the language’s age to the project’s risk.

Common misconceptions

Connections

Variable

Variable are immutable by default

  x:= 100

use the mut keyword to make it mutable.

Naming Convetions

Declare variable with :=, use = to reassign.

Parallel Declaration and Assignment

  a, b, c := 1, 2 3
    mut d, mut e := "hello" , "hi"

reassign with the same type only:

d, e = "what" , "who"

Last edited · 2 revisions

Tags: #Computing