Jump to content

User:SWinxy/V (programming language)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Steven Gay (talk | contribs) at 07:13, 23 January 2020. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 from Rust. The official 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 compile its own compiler in under half 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.

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; but aim on being self contained and still achieve greater simplicity, security, and fast compilation.

The key design features are:

  • Simplicity: one way principle
  • Safety: no null, no globals, no undefined behavior, immutability by default
  • Memory management similar to lobster; no GC
  • Cross compilation
  • REPL
  • Hot code reloading
  • Modular design with in-built libraries such as: Built-in graphics module, Cross-platform UI module or ORM module
  • [wip] No dependency for the core language and modules
  • C bootstrap

Comparison & Performance

One of the first benchmark was the Web Framework Benchark which ranked V second place in Jan 2020 with an alpha version.


Criticism

V has received multiple of criticisms 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

Here is a simple "Hello, World!" program written in V. The println function prints the message to standard output.

fn main() {
    println('Hello World!')
}

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. https://vlang.io". Retrieved 17 November 2019. {{cite web}}: External link in |title= (help)
  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.