# V — Simple Fast Safe Compiled Language > V is a statically typed compiled programming language designed for building maintainable software. It compiles itself in under one second with zero library dependencies and offers automatic C-to-V translation. ## Install Save as a script file and run: # V — Simple Fast Safe Compiled Language ## Quick Use ```bash # Install V git clone https://github.com/vlang/v cd v && make sudo ./v symlink # Hello world echo 'import os fn main() { println("Hello, V!") }' > hello.v v run hello.v # Build optimized binary v -prod hello.v ``` ## Introduction V is a general-purpose programming language that aims to combine the simplicity of Go, the performance of C, and the safety guarantees of Rust into a single coherent design. It compiles directly to C, making it easy to interoperate with existing C libraries and achieve near-native performance without a garbage collector pause. ## What V Does - Compiles entire projects in under one second with minimal memory usage - Translates C and C++ code to idiomatic V automatically - Provides memory safety without a garbage collector via ownership and reference semantics - Ships a built-in package manager (VPM), formatter, and documentation generator - Supports hot code reloading for rapid development iteration ## Architecture Overview V's compiler is a multi-pass pipeline written in V itself (self-hosted). Source files are lexed, parsed into an AST, then lowered to C code that is compiled by a system C compiler (GCC, Clang, or MSVC). An optional direct-to-machine-code backend is under development. The standard library covers networking, JSON, concurrency (coroutines on top of OS threads), and a cross-platform UI module. ## Self-Hosting & Configuration - Clone the repo and run `make`; no external dependencies beyond a C compiler - Use `v symlink` to install the `v` binary system-wide - Manage dependencies via `v.mod` and `v install author.package` - Configure build flags with `v.cfg` or command-line switches (`-prod`, `-cc gcc`) - Cross-compile to Windows, Linux, macOS, FreeBSD, and WASM targets ## Key Features - Autofree memory management eliminates GC pauses while preventing leaks - First-class concurrency with lightweight coroutines and channel-based communication - Built-in ORM for SQLite, PostgreSQL, and MySQL without external dependencies - `@[live]` attribute enables hot code reloading during development - C interop requires zero boilerplate; call any C function directly ## Comparison with Similar Tools - **Go** — V offers similar simplicity but compiles faster, produces smaller binaries, and avoids a runtime GC - **Rust** — Rust provides stronger safety guarantees at the cost of a steeper learning curve and slower compile times - **Zig** — Zig targets low-level systems programming; V aims higher with built-in ORM, web framework, and UI toolkit - **Nim** — Nim also compiles via C but uses a GC by default; V's autofree approach is distinct - **C** — V can be seen as a modernized C with bounds checking, modules, and safer defaults ## FAQ **Q: Is V ready for production use?** A: V is usable for many projects and has a growing ecosystem, but some advanced features are still maturing. Evaluate it for your use case. **Q: How does V handle memory management without a GC?** A: V uses an autofree system that inserts deallocation calls at compile time based on scope analysis, similar to defer-based cleanup. **Q: Can V call existing C libraries?** A: Yes. V can call C functions directly with minimal wrapper code, and the `c2v` tool can translate entire C codebases to V. **Q: What editor support is available?** A: Official plugins exist for VS Code, Vim, Emacs, and Sublime Text with syntax highlighting, auto-completion, and diagnostics. ## Sources - https://github.com/vlang/v - https://vlang.io - https://github.com/vlang/v/blob/master/doc/docs.md --- Source: https://tokrepo.com/en/workflows/asset-213dda99 Author: Script Depot