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:
- Go-like syntax and
defer, but with generics, sum types and immutability by default; - no null –
?Typeoptionals instead; - no global state by default (with escape hatches);
- a built-in formatter, tester, package manager and
v webframework; - C interop by design – you can
#includeand call C with little ceremony; - a memory model that offers a GC, manual management, and growing autofree experiments.
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
- Small CLI tools and scripts you’d rather ship as a single binary.
- Learning systems programming without C’s full footgun kit.
- Wrapping C libraries quickly.
- Experiments with
v webfor modest HTTP services.
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
- “V is vapourware / lied about features.” Early marketing overpromised (especially autofree). The language today is real and usable; read current docs, not 2019 threads.
- “It’s just Go.” Similar readability goals; different type system (sum types, optionals), different memory story, different ecosystem.
- “No GC means Rust-level safety.” V’s safety model is simpler and still evolving. Don’t assume what you haven’t tested.
- “It’s ready to replace C everywhere.” For many tools, yes. For the Linux kernel, no. Match the tool to the job.
- “The ecosystem is tiny.” Smaller than Go/Rust, growing; C interop fills many gaps.
Connections
- Zig, Odin, Rust, Go – the neighbourhood.
- C Programming – what V compiles through and interops with.
- Web Development –
v web.
Variable
Variable are immutable by default
x:= 100
use the mut keyword to make it mutable.
Naming Convetions
- start with lower case
- no uppercase alphabet
- no special chars except _
- names can end in numbers or _
- use snake_case
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"
