User:SWinxy/V (programming language): Difference between revisions
remove hatnotes; title is parenthetically disambiguated |
|||
Line 53: | Line 53: | ||
V is influenced by [[Go (programming language)|Go]] , [[Python (programming language)|Python]], [[C++]] and [[Rust (programming language)|Rust]]; but aims on being self contained and still achieve greater simplicity, security, and fast compilation. |
V is influenced by [[Go (programming language)|Go]] , [[Python (programming language)|Python]], [[C++]] and [[Rust (programming language)|Rust]]; but aims on being self contained and still achieve greater simplicity, security, and fast compilation. |
||
The key design |
The key design goals are: |
||
* Simplicity: A "one-way" system similar to Python's [[pythoninfo:TOOWTDI|"There's Only One Way To Do It"]] |
* Simplicity: A "one-way" system similar to Python's [[pythoninfo:TOOWTDI|"There's Only One Way To Do It"]] |
Revision as of 23:49, 11 February 2020
This template is being used in the wrong namespace. To nominate this user page for deletion, go to Miscellany for deletion.
An editor has nominated this article for deletion. You are welcome to participate in the deletion discussion, which will decide whether or not to retain it. |
Paradigms | |
---|---|
Designed by | Alexander Medvednikov[1] |
Developer | Alexander Medvednikov[1] & Other open source contributors |
First appeared | 2019[2] |
Stable release | |
Typing discipline | |
Platform | x86-64 x86 arm64 arm |
OS | Linux, macOS, Windows, FreeBSD, OpenBSD, Solaris, Android |
License | MIT[3][4] |
Filename extensions | .v, .vh, .vsh |
Website | www |
Major implementations | |
GCC, Clang, MSVC | |
Dialects | |
Good Ol' Fashioned V | |
Influenced by | |
: AMPL, AWK, csh, C++, C#, Objective-C, D, Go, JavaScript, Julia, Limbo, LPC, Perl, PHP, Pike, Processing, Python, Ring,[5] Rust, Seed7 |
V (/viː/, as in the letter v), also known as Vlang, is a general-purpose, procedural computer programming language designed and maintained by Russian programmer Alex Medvednikov. V is very similar to Go, ghosting its syntax and concurrency system, but implements a memory management scheme and other safety features similar to Rust. The first release of the V compiler was originally written in Go, but is now self-hosting and can further transpile to Javascript and C. V was written to specifically focus on being easy to learn, fast, and safe. A consistent claim of the language is its ability to compile up to 1.2 million lines of code per second, with the resulting binary performing within 3% of an equivalent C program, and that it can as such compile its own compiler in under a second.[4]
History
The V programming language was first documented in March 2019, after a period of being listed as a new language used specifically to create Volt, a social networking app created by V designer Alex Medvednikov.[1] Until June, no source code for V was released; the website simply hosted the specification for the language, its features, and an online 'playground' to test V code. on 22 June, the V GitHub repository received its first commit, version 0.0.12.[6] It was created with the intent of having a very small memory footprint, small binary sizes, fast compilation, and of being safe, with features such as checking for type-errors at compile-time, lacking null pointers, and defaulting to immutable objects. At launch, V only supported Linux and macOS, but now supports many others.
As of November, V is considered to be in alpha, as many of its claims are still a work in progress.[4] According to V's official website and GitHub repository, the first stable release, version 0.2, is due late January 2020, and release 1.0 is due 2020.[4]
Design
V is influenced by Go , Python, C++ and Rust; but aims on being self contained and still achieve greater simplicity, security, and fast compilation.
The key design goals are:
- Simplicity: A "one-way" system similar to Python's "There's Only One Way To Do It"
- Safety: No null variables or pointers, no global variables, no undefined behavior, and variable immutability by default
- Memory management similar to lobster with no garbage collection
- A Read-Eval-Print-Loop environment
- Hot reloading
- A modular but powerful standard library, notably implementing a cross-platform, native graphics library
Comparison and performance
V's first appearance in the Web Framework Benchmark in January 2020 ranked V's alpha release second place.
Criticism
V has received criticism across sources, generally questioning its claims to performance, safety, and lack of dependencies. It has, especially prior to the source code's release, been considered vaporware.[7][8]
On 22 June, Alex stated in the release announcement for V's source code release that there are "lots of hacks I'm really embarrassed about" and that it contains "a lot of ugly C code", but that it will be "quickly cleaned up in the coming weeks".
Examples
Hello world
A V hello world appears similar to a Rust equivalent, but lacks semi-colon line endings and allowing the use of single quotes to denote strings:
fn main() {
println('Hello World!')
}
A simple website
A simple website using V's standard library web framework, vweb:
module main
import vweb
pub struct App {
mut:
vweb vweb.Context
}
fn main() {
vweb.run<App>(8080)
}
fn (app mut App) index() {
app.vweb.text('Hello, world from vweb!')
}
pub fn (app &App) init() {}
pub fn (app &App) reset() {}
References
- ^ a b c "Volt | <1 MB desktop client for Slack, Skype, Twitter, Facebook, Gmail and more". Retrieved 17 November 2019.
- ^ Open-sourced with V 0.0.12
- ^ a b "The V Programming Language". Retrieved 17 November 2019.
- ^ a b c d "vlang/v: Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero dependencies. Stable release in November 2019". Retrieved 17 November 2019.
- ^ "Introduction". Ring 1.10 documentation. Ring (programming language). Retrieved 27 June 2019.
- ^ "V 0.0.12 open-source release · vlang/v@d32e538". Retrieved 17 November 2019.
- ^ "The V Programming Language: Vain or Virtuous? | Hackaday".
- ^ "The V programming language is now open source - is it too good to be true? | Packt Hub". Retrieved 17 November 2019.