Up and running with V

Published .. 16-07-2024
Type ....... article
Tags ....... v

You can download an installer from https://vlang.io/

But you can also build from source:

On Linux and Mac with build essentials installed its as easy as:

git clone https://github.com/vlang/v
cd v
make

Here is a hello world script in V:

// in hello.v
fn main() {
  println('hello world')
}

V is not a "clean" as Go. Go's core is small and much is placed in the libraries. For instance Go requires you to import fmt to be able to access print functions, V does not.

Run with the code with:

v run hello.v

or compile with:

v hello.v

you can check out the generated c code using:

v -o hello.c hello.v

Its that easy.

V has a cache, in case you need to clear it, run:

v wipe-cache