V or Vlang is a programming language : compiled, general-purpose and statically typed . Launched as an open source project in June 2019 by Alex Medvedniko.
Designed for performance, security and fast compilation. The compiler is written in V and is less than 1MB, it is capable of compiling in less than a second about 1 million lines of code with zero library dependencies.
You can learn everything about the language just by reading the documentation in an hour, and in most cases, there’s only one way to do something.
This results in simple, readable and maintainable code.
Although simple, V gives a lot of power to the developer and can be used in practically all fields, including systems programming: Web Development, Game Development, Graphic Interfaces, Mobile, Science, Embedded Systems, Tools, etc.
You can install using V on almost all possible operating systems, such as: Linux, macOS, Windows, *BSD, Solaris, WSL, Android, Raspbian , …
To install use the commands below in order:
Then you can test Vlang:
Possible and similar output:
V 0.2.4 d826317
.
Let’s test a Hello, World! . Create a .v
file, eg nvim hello.v
and insert this code:
Now to run:
Probable output:
Hello Vlang!
.
You can also compile and run after generating the binary:
If you are used to C++ this mini table shows operations in Vlang similar to C++:
C++ | Vlang |
---|---|
std::vector s; |
mut s := [] |
s.push_back("Vis "); |
s << 'Vis ' |
s.push_back("awesome"); |
s << 'awesome' |
std::cout << s.size(); |
println(s.len) |
You may notice that Vlang is very similar to Go/Golang . See this table for comparison.
For more information and documentation see the links below: