V (programming language)
Appearance
The official V logo | |
| Paradigms | Multi-paradigm: functional, imperative, structured, concurrent |
|---|---|
| Designed by | Alexander Medvednikov[1] |
| Stable release | 0.4.12[2] |
| Typing discipline | static, strong, infered |
| Implementation language | V |
| Platform | x86-64 |
| OS | Linux, macOS, Windows, FreeBSD, OpenBSD, NetBSD, DragonflyBSD, Solaris |
| License | MIT |
| Filename extensions | .v, .vsh |
| Website | vlang |
| Influenced by | |
| Go, Kotlin, Oberon, Python, Rust, Swift | |
V, also known as vlang, is a statically typed compiled programming language designed for ease of use, readability, and maintainability.[3][4] It was created by Alexander Medvednikov in 2019.[5]
Examples
Here is a hello world program in V.
fn main() {
println('Hello, World!')
}
Here is an example of how to declare a variable.
- Variables are immutable by default.
- Define by using
:=and a value. - Use the
mutkeyword to make them mutable. - Mutable variables can be assigned to using
=.
a := 1
mut b := 2
b = 3
Here is an example of using `if`, `else if` and `else` conditionals in V.
fn main() {
a := 10
b := 20
if a < b {
println('${a} < ${b}')
} else if a > b {
println('${a} > ${b}')
} else {
println('${a} == ${b}')
}
}
Here is an example of using loops in V.
// Define entry point.
fn main() {
mut count := 0
// Here is a condition `for` loop (also known as a `while` loop).
for count < 5 {
// some code
count++
println(count)
}
// Here is a range `for` loop.
for i in 1..10 {
println("${i}") // Prints numbers from 1 up to 9.
}
// Here is a map `for` loop.
m := {
'one': 1
'two': 2
}
for key, value in m {
println('${key} -> ${value}')
// Output: one -> 1
// two -> 2
}
}
References
- ↑ "Creator of V". GitHub.
- ↑ "Release 0.4.12". 19 September 2025. Retrieved 29 September 2025.
- ↑ Knott, Simon (27 June 2019). "An introduction to V". Retrieved 27 June 2019.
- ↑ Nasufi, Erdet. "An introduction to V - the vlang". DebConf. Retrieved 24 July 2022.
- ↑ Rao, Navule Pavan Kumar (December 10, 2021). Getting Started with V Programming. Packt Publishing. ISBN 978-1839213434. OCLC 1290492862.