Jump to content

User:SWinxy/V (programming language): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Tiraboschi (talk | contribs)
A few small fixes.
Tiraboschi (talk | contribs)
Submit as an AfC
Line 1: Line 1:
{{AFC submission|||ts=20200209100019|u=Tiraboschi|ns=118}}
{{Redirect|V|V programming language}}
{{Redirect|V|V programming language}}
{{About||other programming languages named V|V (disambiguation)#Computing|other uses|V (disambiguation)}}
{{About||other programming languages named V|V (disambiguation)#Computing|other uses|V (disambiguation)}}

Revision as of 10:00, 9 February 2020

V
V Programming Language
The V logo
Paradigms
Designed byAlexander Medvednikov[1]
DeveloperAlexander Medvednikov[1] & Other open source contributors
First appeared2019; 6 years ago (2019) [2]
Stable release
V 0.1.24[3] / January 8, 2020; 4 years ago (2020-01-08)
Typing discipline
Platformx86-64 x86 arm64 arm
OSLinux, macOS, Windows, FreeBSD, OpenBSD, Solaris, Android
LicenseMIT[3][4]
Filename extensions.v, .vh, .vsh
Websitewww.vlang.io
Major implementations
GCC, Clang, MSVC
Dialects
Good Ol' Fashioned V
Influenced by
Numerous: AMPL, AWK, csh, C++, C#, Objective-C, D, Go, JavaScript, Julia, Limbo, LPC, Perl, PHP, Pike, Processing, Python, Ring,[5] Rust, Seed7

V (/v/, 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 features are:

Comparison & 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() {}

Citations

  1. ^ a b c "Volt | <1 MB desktop client for Slack, Skype, Twitter, Facebook, Gmail and more". Retrieved 17 November 2019.
  2. ^ Open-sourced with V 0.0.12
  3. ^ a b "The V Programming Language". Retrieved 17 November 2019.
  4. ^ 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.
  5. ^ "Introduction". Ring 1.10 documentation. Ring (programming language). Retrieved 27 June 2019.
  6. ^ "V 0.0.12 open-source release · vlang/v@d32e538". Retrieved 17 November 2019.
  7. ^ "The V Programming Language: Vain or Virtuous? | Hackaday".
  8. ^ "The V programming language is now open source - is it too good to be true? | Packt Hub". Retrieved 17 November 2019.