Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
V, also written vlang, is a statically typed compiled language created by Alexander Medvednikov and first released in 2019. It aims for a small, readable syntax and very fast compilation, and it works by translating your code to C before producing a native binary. The language leans on safety defaults — variables are immutable unless you mark them otherwise, there are no null references in the usual sense, and safe code avoids undefined behavior. V is young and still pre-1.0, so its standard library, called vlib, and some language details continue to change between releases. On XCODX you can try V's syntax and vlib directly, compiling and running in the browser with no local setup.
import os
fn main() {
name := os.input('Enter your name: ')
println('Hello, ${name}!')
for i in 1 .. 6 {
println('${i} squared is ${i * i}')
}
}
V targets developers who want Go-like simplicity and fast builds with a compiled, C-backed binary — command-line utilities, small services, and tooling are typical uses, and its automatic C interop and C-translation features help when wrapping existing libraries. Choose it when quick compilation and a minimal, opinionated syntax appeal to you. Because the language is still pre-1.0, expect some rough edges and shifting APIs. It is a poor fit for production systems that need long-term stability today, and on XCODX modules outside vlib cannot be installed, since there is no package fetching or network access.
No. The sandbox provides only the bundled vlib standard library — there is no `v install`, no VPM access, no network, and no persistent filesystem, so third-party modules are unavailable. Import only modules that ship with V, such as `os`, `math`, or `strings`.
The simplest way is `os.input('prompt: ')`, which prints the prompt and returns the typed line as a string; `os.get_line()` reads a line without a prompt. In the live terminal the program waits for you to type and press Enter, or you can supply the Stdin Box, and Ctrl+D closes the stream. Import the `os` module first.
V is still pre-1.0 — recent releases sit in the 0.5 range — so while it is usable and actively developed, its standard library and some language features are still changing. Treat code as potentially needing updates across versions, and check the runtime badge for the exact version running here.
By design V avoids null references, using option and result types instead, and disallows undefined behavior in safe code, alongside defaults like immutable variables. Some low-level escapes exist behind `unsafe`, but everyday code stays inside the safe subset.
V generates C and keeps the language deliberately small, which together make builds quick even for larger programs. In the sandbox you still see a short compile step before your program runs, plus the overall run timeout.
No. Each run is isolated with no outbound network and no disk that persists between executions, so HTTP calls and saved files will not behave as they would locally. Use stdin for input and stdout for output within a single run.
main.vgoos.input()fn main() {
println('Hello from V!')
println('Welcome to XCODX Online Compiler!')
}