V , the programming language that is making a lot of success
Vlang is suitable for Web Development, Game Development, Graphical Interfaces, Mobile, Science, Embedded Systems, Tools and etc.
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.
Installation
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:
git clone --depth=1 https://github.com/vlang/v
cd v
make
cd ..
mv v/ /opt
cd /opt/v/
sudo ./v symlink
Then you can test Vlang:
v version
Possible and similar output:
V 0.2.4 d826317
.
Hello Vlang!
Let’s test a Hello, World! . Create a .v
file, eg nvim hello.v
and insert this code:
fn main() {
println('Hello Vlang!')
}
Now to run:
v run hello.v
Probable output:
Hello Vlang!
.
You can also compile and run after generating the binary:
v hello.v
./hello
Customizing your IDE/Editor with Highlight for Vlang
- For Vim or Neovim install this plugin;
- For VSCode use this extension;
- And also for Emacs and for Sublime.
Translating according to other languages
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:
v help
- https://vlang.io/
- https://github.com/vlang/v
- https://github.com/vlang/v/blob/master/doc/docs.md
- https://github.com/vlang/v/wiki
Comments