UNLIMITED
Discover the all-new V language
Credit: https://vlang.io
No, V isn’t a fan fiction release of the famous 1980s TV series. Instead, it’s a fast, modern, open source, statically typed compiled programming language. V can be used in various areas including web development, systems programming, embedded programming, graphical user interfaces and mobile development. So, all the usual then!
You can install V on an Arch Linux system that uses paru by running paru -S vlang with root privileges. Use your favourite package manager to install V on your own Linux distribution or follow the instructions found at the GitHub repository of V for a manual installation (see https://github.com/vlang/v). The name of the V compiler is just v. You can discover the version of V you’re using by running v --version on your Linux shell. V source code files have the .v file extension.
Running V code
Let’s kick things off by learning how to run V code. In order to do that we need a small source code file, which is going to contain the following code and is called hw.v:
module main
fn main() {
// Print the message println('Hello Linux Format!')
Before executing the code, we need a quick explanation. The previous code defines a function called main(), which when present is the entry point to a V program. The println() function is used for printing on screen. Additionally, V uses curly braces for defining blocks of code, including function implementations. Finally,
You’re reading a preview, subscribe to read more.
Start your free 30 days