diff --git a/_layout.html b/_layout.html index ec69106b4..74bf8465e 100644 --- a/_layout.html +++ b/_layout.html @@ -16,45 +16,126 @@
-
-
- - - - @end @define "footer" diff --git a/app.css b/app.css index 9cdd8f812..af62ce3db 100644 --- a/app.css +++ b/app.css @@ -1,3 +1,8 @@ +:root { + color: #000; + /* font-weight: 500; */ +} + .select { position: relative; display: inline-block; @@ -85,7 +90,7 @@ body { .content { grid-area: content; height: 100%; - width: 100% + width: 100%; } #app { @@ -93,14 +98,19 @@ body { grid-template-columns: 1fr; grid-template-rows: 72px 1fr; grid-template-areas: "header" "content"; - width: 100% + width: 100%; } a { - color: #4078c0; + color: #5D87BF; text-decoration: none } +a:hover { + text-decoration: underline; + transition: all .2s ease-in-out; +} + .flex { flex: 1 } @@ -144,11 +154,11 @@ textarea:focus { .codeblock { background: #334; - padding: 12px 12px 4px 12px; + padding: 12px; max-width: calc(100vw - 56px); border-radius: 6px; margin: 0; - color: #c9c5c4; + color: #ffffff; font-size: 15px; position: relative; font-family: "Roboto Mono", "Courier New", Menlo, "DejaVu Sans Mono", Monaco, Courier, monospace @@ -165,7 +175,8 @@ textarea:focus { overflow-y: hidden; line-height: 1.2; font-family: "Roboto Mono", "Courier New", Menlo, "DejaVu Sans Mono", Monaco, Courier, monospace; - white-space: pre-wrap + white-space: pre-wrap; + font-weight: 400; } .codeblock textarea { @@ -192,9 +203,7 @@ textarea:focus { .codeblock .titlebar { display: flex; align-items: center; - margin-bottom: 6px; position: relative; - top: -2px } .codeblock .play-btn { @@ -353,15 +362,17 @@ textarea:focus { height: 100%; width: 100%; position: sticky; - background: #fff; + -webkit-backdrop-filter: blur(8px); + backdrop-filter: blur(8px); z-index: 100; top: 0; display: flex; - align-items: center + align-items: center; + color: #000; } .header .logo { - width: 32px; + width: 40px; margin-bottom: -3px; margin-right: 16px } @@ -385,34 +396,35 @@ textarea:focus { } .header .nav a:hover { - color:#333; + color:#000; } .header .nav .item { - color: #777; + color: #000; text-decoration: none; - padding-right: 18px; - padding-left: 18px; + padding: 10px; font-size: 22px; - font-weight: 300 + font-weight: 400; + margin-right: 10px; } -.header .nav .item.active { - color: #222b38 +.header .nav .item:hover { + background-color: #9c9c9c7a; + border-radius: 8px; } - .header .donate-button .paypal { - width: 80px; - height: 33px; - background: #3b7bbf; - margin-bottom: 3px; - border-radius: 3px; - color: #fff; - text-align: center; - line-height: 32px; - font-size: 15px; - margin-left: 10px; - } +.header .donate-button .paypal { + width: 80px; + height: 33px; + background: #3b7bbf; + margin-bottom: 3px; + border-radius: 3px; + color: #fff; + text-align: center; + line-height: 32px; + font-size: 15px; + margin-left: 10px; +} @media (max-width:1100px) { .header { position: static; @@ -510,7 +522,7 @@ textarea:focus { display: flex; padding: 8px 8px 8px 6px; align-items: center; - color: #333 + color: #000000 } .landing .hero .button .options-container .options .dl-option .name { @@ -519,7 +531,7 @@ textarea:focus { } .landing .hero .button .options-container .options .dl-option .size { - color: #818e9c; + color: #000000; font-size: 15px } @@ -690,8 +702,11 @@ textarea:focus { flex-direction: column; justify-content: flex-start; align-items: center; - background: linear-gradient(168deg, #fff 800px, #f6f9fc 800px); - padding-bottom: 32px + padding-bottom: 32px; + /* background-image: radial-gradient(#444cf7 0.5px, transparent 0.5px), radial-gradient(#444cf7 0.5px, transparent 0.5px); + background-size: 20px 20px; + make the backgoud image static + background-attachment: fixed; */ } .landing .section { @@ -700,10 +715,8 @@ textarea:focus { width: calc(100vw - 32px); justify-content: space-around; margin-top: 32px; - background: #fff; - color: #222; + color: #101010; border-radius: 6px; - border: 1px solid #efefef } .landing .section h1, @@ -715,8 +728,18 @@ textarea:focus { .landing .section .block { flex: 1; padding: 18px 16px; - margin: 12px; - border-radius: 6px; + margin: 20px; + border-radius: 15px; + width: 225px; + background-color: transparent; + border: 0.2px solid #5e5e5e25; + +} + +@media (max-width: 600px) { + .landing .section .block { + width: 75vw; + } } .landing .section .block td { @@ -732,7 +755,14 @@ textarea:focus { .landing .section .block pre { white-space: pre-wrap; - word-break: break-word + word-break: break-word; + background: #334; + padding: 12px; + max-width: calc(100vw - 56px); + border-radius: 6px; + margin-top: 10px; + margin-bottom: 10px; + color: #ffffff; } .landing ul { @@ -745,12 +775,22 @@ textarea:focus { font-size: 14px } -@media (max-width:1500px) { +@media (max-width:800px) { .landing .hero .examples .codeblock { - min-width: auto + width: 100%; + height: 10rem; + overflow-y: scroll; + white-space: pre-wrap; } } +.landing .hero .examples .codeblock { + width: 35rem; + height: 15rem; + overflow-y: scroll; + white-space: pre-wrap; +} + @media (max-width:1200px) { .landing .hero { margin: 32px 0; @@ -805,7 +845,7 @@ textarea:focus { .playground .editor .codeblock, .playground .editor .output { flex: 1; - margin: 6px + margin: 6px; } .playground .select { @@ -927,11 +967,35 @@ position:absolute; right:0px; top:50px; text-align:center; display:block; width: .news { font-size: 80%; margin-top: 0 !important; - flex-direction: column; + display: flex; + max-width: 1100px; + width: calc(100vw - 32px); + justify-content: space-around; + overflow-x: scroll; + overflow-y: hidden; } + +@media (min-width: 800px) { + .news { + grid-template-columns: auto auto; + } +} + .news .container { display: flex } + + +.news .block { + flex: 1; + padding: 18px 16px; + margin: 12px; + border-radius: 6px; + width: 225px; + /* make the box have no shadow and make it !important so it overrides the default */ + box-shadow: none !important; +} + .news_header{ text-align:center; padding-top: 1rem; @@ -942,4 +1006,56 @@ position:absolute; right:0px; top:50px; text-align:center; display:block; width: .text-center { text-align: center; -} \ No newline at end of file +} + +.dropdown-content { + display: none; + position: absolute; + background-color: #f9f9f9; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; + } + + .navDropdown:hover .dropdown-content { + display: block; + } + + .navDropdown { + margin-top: 10px; + font-weight: 400 !important; + } + + .dropdown-content a { + color: black !important; + padding: 12px 16px; + text-decoration: none; + display: block; + } + + .dropdown-content a:hover { + background-color: #f1f1f1; + } + + .link { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + } + + .link .block { + background-color: #5D87BF; + color: white !important; + border-radius: 5px; + padding: 15px; + margin: 12px; + width: auto; + background-color: #3b7bbf; + /* apply no shadow to the element and make it !important */ + box-shadow: none !important; + } + + .link .block:hover { + /* animate the box to slightly move up */ + transform: translateY(-6px); + } diff --git a/img/gitly.png b/img/gitly.png new file mode 100644 index 000000000..10e3aac23 Binary files /dev/null and b/img/gitly.png differ diff --git a/img/hot.mp4 b/img/hot.mp4 new file mode 100644 index 000000000..c7b548cc8 Binary files /dev/null and b/img/hot.mp4 differ diff --git a/img/vwin.mp4 b/img/vwin.mp4 new file mode 100644 index 000000000..212c1ce6e Binary files /dev/null and b/img/vwin.mp4 differ diff --git a/index.html b/index.html index 9835b7025..5dc25ee01 100644 --- a/index.html +++ b/index.html @@ -8,18 +8,18 @@
-

The V Programming Language 0.3 beta

-

Simple, fast, safe, compiled. For developing maintainable software.

- +

Programming Language

+

“simple, fast, safe, compiled language for developing maintainable software”

+
github.com/vlang/v - 33k + 30k
-
+
@@ -52,6 +52,8 @@

The V Programming Language 0.3 V version: 0.3x beta

+ -
-
- -
- -
-

Latest news

-
-
-
-
- January 30, 2023 -
- -
-
-
- October 31, 2022 -
- -
- -
-
- August 31, 2022 -
- -
- -
-
- June 30, 2022 -
- -
- -
-
- June 22, 2022 -
-
- C2V is out! Demo video: +

Latest news


+ + -
-
-
- June 10, 2022 -
- -
-
-
- June 9, 2022 -
-
- As of today, programs built with the V compiler no longer leak memory by default. -
-
+
+
+ June 22, 2022 +
+
+ C2V is out! Demo video: - +
+
+
+
+ June 10, 2022 +
+ +
+
+
+ June 9, 2022 +
+
+ As of today, programs built with the V compiler no longer leak memory by default. +
+
+
+
+ May 29, 2022 +
+
+7000 pull requests have been merged! +
+
+
-
+ -
+

Why V?

+
@@ -423,6 +374,7 @@

Safety

+
+
+

Painless deployments and dependency management

+

+ To build your project, no matter how big, all you need to do is run +

+v .
+

+ No build environments, makefiles, headers, virtual environments, etc.
+ You get a single statically linked binary that is guaranteed to work on all operating systems (provided you cross compile) without any dependencies.

+ Installing new libraries via vpm, a centralized package manager written in V, is as simple as +
+v install ui
+		
+

+
+
+

Run everywhere

+

+ V can emit (human readable) C, so you get the great platform support and optimization of GCC and Clang. (Use v -prod . to make optimized builds.)

+ Emitting C will always be an option, even after direct machine code generation matures.

+ V can call C code, and calling V code is possible in any language that has C interop. +

+
+
+ +
+
+

REPL

+
v
+>>> import net.http
+>>> data := http.get('https://vlang.io/utc_now')?
+>>> data.text
+1565977541
+
+
+

Cross-platform shell scripts in V

+

+ V can be used as an alternative to Bash to write deployment scripts, build scripts, etc. -

-
-

Partners & Sponsors

-
- - - - - - - - - - - - - - - +The advantage of using V for this is the simplicity and predictability of the language, and cross-platform support. "V scripts" run on Unix-like systems as well as on Windows. +

+
for file in ls('build/') {
+  rm(file)
+}
+mv('v.exe', 'build/')
+
+v run deploy.vsh
+

Read more about V script

- - Become a sponsor via GitHub Sponsors - -

Performance

    +
  • As fast as C (V's main backend compiles to human readable C)
  • C interop without any costs
  • Minimal amount of allocations
  • Built-in serialization without runtime reflection
  • -
  • Compiles to native binaries without any dependencies: a simple web server is only about 250 KB
  • -
  • As fast as C (V's main backend compiles to human readable C), - with equivalent code. -
    V does introduce some overhead for safety (such as array bounds checking, GC free), but these features can be disabled/bypassed when performance is more important. -
  • +
  • Compiles to native binaries without any dependencies: a simple web server is only 65 KB
@@ -491,37 +464,37 @@

Fast compilation

- - - - - -
-
-

Small and easy to build compiler

+
+

Small and easy to build compiler

V can be bootstrapped in under a second by compiling its code translated to C with a simple

cc v.c
No libraries or dependencies needed.

- For comparison, space and time required to build each compiler: + For comparison, space and time required to build each compiler. The lines show the amount of time that it takes to build:

+ + + + + + +
Space  Build time
Go525 MB1m 33s
Rust30 GB45m
GCC8 GB50m
Clang90 GB [0] 60m
Swift70 GB [1] 90m
V< 10 MB [2] - <1s
1s
-
-
-

Flexible memory management

+
+

Innovative and flexible memory management

V avoids doing unnecessary allocations in the first place by using value types, string buffers, promoting a simple abstraction-free code style.

- There are 4 ways to manage memory in V. -

+ Right now allocations are handled by a minimal and well performing GC until V's autofree engine is production ready.

- The default is a minimal and a well performing tracing GC. - -

- The second way is autofree, it can be enabled with -autofree. It takes care of most objects (~90-100%): + Autofree can be enabled with -autofree. It takes care of most objects (~90-100%): the compiler inserts necessary free calls automatically during compilation. Remaining small percentage of objects is freed via GC. The developer doesn't need to change anything in their code. "It just works", @@ -588,7 +547,7 @@

Flexible memory management

-
+

V's autofree demo. All objects are freed during compilation. Running the Ved editor on an 8 MB file with 0 leaks:

@@ -604,7 +563,7 @@

Flexible memory management

-
+

C translation

V can translate your entire C project and offer you the safety, simplicity, and compilation speed-up (via modules).

@@ -625,7 +584,7 @@

C translation

C++ to V translation is at an early stage.

-
+

Translating DOOM from C to V and building it in under a second:

@@ -639,7 +598,7 @@

C translation

-
+

Hot code reloading

Get your changes instantly without recompiling. @@ -648,126 +607,69 @@

Hot code reloading

github.com/.../examples/hot_reload
-
+
-
-

A powerful graphics library

+
-
- +
+
-
-

Light and fast cross-platform GUI library

+
+

Native cross-platform GUI library

- Build native UI apps with V UI. You no longer need to embed a browser to develop cross-platform apps quickly.

- V has a UI module that uses custom drawing, similar to Qt and Flutter, but with as much similarity to the native GUI toolkit as possible. -

-

- It has a declarative API similar to SwiftUI and React Native and runs on Windows, Linux, macOS, and Android. -

-

+ Build native apps with native controls. You no longer need to embed a browser to develop cross-platform apps quickly.

+ V has a ui module that uses native GUI toolkits: WinAPI/GDI+ on Windows, Cocoa on macOS. On Linux custom drawing is used.

Coming soon:

  • a Delphi-like visual editor for building native GUI apps
  • -
  • iOS support
  • +
  • iOS/Android support with native controls
  • +
  • a declarative API similar to SwiftUI and React Native

github.com/vlang/ui

-
+

- Volt, a 300 KB Slack client built with V and V UI: + Volt, a 300 KB Slack client built with V and V ui:

- +
-
+

Easy cross compilation

- To cross compile your software simply run v -os windows or v -os linux. No extra steps required, even for GUI and graphical apps!

+ To cross compile your software simply run v -os windows. or v -os linux. No extra steps required, even for GUI and graphical apps!

(Compiling macOS software only works on macOS for now.)

-
+

Building V for Windows using V for macOS, and then testing resulting v.exe on a Windows VM:

-
-
- -
-
-

Painless deployments and dependency management

-

- To build your project, no matter how big, all you need to do is run -

-v .
-

- No build environments, makefiles, headers, virtual environments, etc.
- You get a single statically linked binary that is guaranteed to work on all operating systems (provided you cross compile) without any dependencies.

- Installing new libraries via vpm, a centralized package manager written in V, is as simple as -
-v install ui
-		
-

-
-
-

Run everywhere

-

- V can emit (human readable) C, so you get the great platform support and optimization of GCC and Clang. (Use v -prod . to make optimized builds.)

- Emitting C will always be an option, even after direct machine code generation matures.

- V can call C code, and calling V code is possible in any language that has C interop. -

+
-
-
-

REPL

-
v
->>> import net.http
->>> data := http.get('https://vlang.io/utc_now')?
->>> data.text
-1565977541
-
-
-

Cross-platform shell scripts in V

-

- V can be used as an alternative to Bash to write deployment scripts, build scripts, etc. - -The advantage of using V for this is the simplicity and predictability of the language, and cross-platform support. "V scripts" run on Unix-like systems as well as on Windows. -

-
for file in ls('build/') {
-  rm(file)
-}
-mv('v.exe', 'build/')
-
-v run deploy.vsh
-

Read more about V script

-
-
@@ -853,18 +755,18 @@

Friendly error messages

-
-

Powerful built-in web framework Vweb

-

Vweb is very fast, it compiles into a single binary (html templates are also compiled), supports hot code reloading - (the website is automatically updated in the browser once you change any .v/.html file). -

github.com/vlang/v/tree/master/vlib/vweb

+
+

Powerful built-in web framework

+

A simple yet powerful web server with built-in routing, parameter handling, templating, and other features.

+

Lean More Here

+ Run
-
['/post/:id'] +
['/post/:id'] fn (b Blog) show_post(id int) vweb.Result { post := b.posts_repo.retrieve(id) or { return vweb.not_found() @@ -877,7 +779,6 @@

Powerful built-in web framework Vweb

} return vweb.view(post) }
-
-

Gitly, a light and fast alternative to GitHub/GitLab is built in V and vweb.

+

Gitly, a light and fast alternative to GitHub/GitLab is built in V and vweb.

+
+ +
+
-
-

Built-in ORM

-

+

+

Built-in ORM

+

-

+
-
-
-
+
+
+ Run +
-
import db.sqlite +
import sqlite struct Customer { - id int - name string - nr_orders int - country string +id int +name string +nr_orders int +country string } fn main() { - db := sqlite.connect('example.sqlite') or { - panic('could not create/find example.sqlite') - } +db := sqlite.connect('example.sqlite') or { +panic('could not create/find example.sqlite') +} - nr_customers := sql db { - select count from Customer - }! - println('number of all customers: ${nr_customers}') +nr_customers := sql db { +select count from Customer +} +println('number of all customers: $nr_customers') - // V syntax can be used to build queries - uk_customers := sql db { - select from Customer where country == 'uk' && nr_orders > 0 - }! +// V syntax can be used to build queries +uk_customers := sql db { +select from Customer where country == 'uk' && nr_orders > 0 +} - for customer in uk_customers { - println('${customer.id} - ${customer.name}') - } +for customer in uk_customers { +println('$customer.id - $customer.name') +} - // by adding `limit 1` we tell V that there will be - // only one object - customer := sql db { - select from Customer where id == 1 limit 1 - }! - println(customer.name) - - // insert a new customer - new_customer := Customer{name: 'Bob', nr_orders: 10} - sql db { - insert new_customer into Customer - }! +// by adding `limit 1` we tell V that there will be +// only one object +customer := sql db { +select from Customer where id == 1 limit 1 } -
-
+println(customer.name) + +// insert a new customer +new_customer := Customer{name: 'Bob', nr_orders: 10} +sql db { +insert new_customer into Customer +} +} +
-

+

+
+ +
+
+

Sponsors

+
+ + Become a sponsor via GitHub Sponsors +
-
-

Built in V

+
+

Built in V

V

@@ -1021,7 +988,7 @@

Filey

V UI

-

Cross-platform widget toolkit.

+

Cross-platform widget toolkit using native APIs.

@@ -1042,18 +1009,6 @@

Filey

A curated list of awesome V frameworks, libraries and software

-
-

The V Tensor Library

-

An n-dimensional Tensor data structure, sophisticated reduction, elementwise, and accumulation operations, data Structures that can easily be passed to C libraries, powerful linear algebra routines backed by VSL. -

-
-
-

The V Scientific Library -

-

A Scientific Library with a great variety of different modules.

-
- -

Are you using V to build your product or library? Have it added to this list.

@@ -1061,7 +1016,7 @@

Filey

- Web design by Leah. + Web design by Leah And modified by:RangerDevv. logo by Sonovice and Don. diff --git a/preview.html b/preview.html index 1984fe076..ccc840369 100644 --- a/preview.html +++ b/preview.html @@ -10,7 +10,7 @@ - The V Programming Language +The V Programming Language
@@ -20,18 +20,26 @@
@@ -63,9 +144,9 @@
-

The V Programming Language 0.3

-

Simple, fast, safe, compiled. For developing maintainable software.

- +

Programming Language

+

“simple, fast, safe, compiled language for developing maintainable software”

+
- + +
+
+ +
-
-
-
-
fn main() {
-    areas := ['game', 'web', 'tools', 'science', 'systems',
-              'embedded', 'drivers', 'GUI', 'mobile']
-    for area in areas {
-        println('Hello, $area developers!')
-    }
+ 
fn main() {
+   areas := ['game', 'web', 'tools', 'science', 'systems',
+             'embedded', 'drivers', 'GUI', 'mobile']
+   for area in areas {
+       println('Hello, $area developers!')
+   }
 }
-
- - @@ -310,10 +372,10 @@

The V Programming Language 0.3

function update_ex() { var elems = document.querySelectorAll('.hello_devs'); - for (var index = 0 ; index < elems.length; index++) { + for (var index = 0 ; index < elems.length; index++) { - elems[index].style.display = 'none'; - } + elems[index].style.display = 'none'; + } document.getElementById('ex' + ex_id).style.display = 'table-cell'; if (ex_id <= 3) { document.getElementById('ex' + ex_id).style.fontSize = '100%'; @@ -341,85 +403,91 @@

The V Programming Language 0.3

function tokenize_codeblock_99404097 (e) { - Tokenizer(e.target.value).then(function(tokens) { - document.getElementById("codeblock_hl_04227451").innerHTML = tokens - .map(function(token) { return `${token.value}` }) - .join('') - }) + Tokenizer(e.target.value).then(function(tokens) { + document.getElementById("codeblock_hl_04227451").innerHTML = tokens + .map(function(token) { return `${token.value}` }) + .join('') + }) } document.getElementById("codeblock_ta_39322469").oninput = tokenize_codeblock_99404097 tokenize_codeblock_99404097({target:{value: document.getElementById("codeblock_ta_39322469").value}}) document.getElementById("codeblock_rb_13318017").onauxclick = function(e) { - localStorage.setItem('sandbox-code', document.getElementById("codeblock_ta_39322469").value) + localStorage.setItem('sandbox-code', document.getElementById("codeblock_ta_39322469").value) } document.getElementById("codeblock_rb_13318017").onclick = function(e) { - if (location.pathname === 'https://v-wasm.vercel.app') e.preventDefault() - var codeblock_value = document.getElementById("codeblock_ta_39322469").value - localStorage.setItem('sandbox-code', codeblock_value) + if (location.pathname === 'https://v-wasm.vercel.app') e.preventDefault() + var codeblock_value = document.getElementById("codeblock_ta_39322469").value + localStorage.setItem('sandbox-code', codeblock_value) }
-
-
-
- Latest news
-
-
-
- June 30, 2022 -
- -
+

Latest news


+ +
+
+
+ June 30, 2022 +
+
+ V 0.3 is out! -
-
- June 22, 2022 -
-
- C2V is out! Demo video: +
+
- - translating DOOM from C to V, building it under a second and running it! -
-
-
-
- June 10, 2022 -
- -
- -
-
- June 9, 2022 -
-
- As of today, programs built with the V compiler no longer leak memory by default. -
-
+
+
+ June 22, 2022 +
+
+ C2V is out! Demo video: + +translating DOOM from C to V, building it under a second and running it! -
-
- May 29, 2022 -
-
- 7000 pull requests have been merged! -
-
+
+
+
+
+ June 10, 2022 +
+ +
+
+
+ June 9, 2022 +
+
+ As of today, programs built with the V compiler no longer leak memory by default. +
+
+
+
+ May 29, 2022 +
+
+7000 pull requests have been merged! +
+
+
+ -
+

Why V?

+
@@ -456,29 +524,57 @@

Safety

+
+
+

Painless deployments and dependency management

+

+ To build your project, no matter how big, all you need to do is run +

+v .
+

+ No build environments, makefiles, headers, virtual environments, etc.
+ You get a single statically linked binary that is guaranteed to work on all operating systems (provided you cross compile) without any dependencies.

+ Installing new libraries via vpm, a centralized package manager written in V, is as simple as +
+v install ui
+		
+

+
+
+

Run everywhere

+

+ V can emit (human readable) C, so you get the great platform support and optimization of GCC and Clang. (Use v -prod . to make optimized builds.)

+ Emitting C will always be an option, even after direct machine code generation matures.

+ V can call C code, and calling V code is possible in any language that has C interop. +

+
+
-
-
-

Sponsors

-
- - - - - - - - - - - - +
+
+

REPL

+
v
+>>> import net.http
+>>> data := http.get('https://vlang.io/utc_now')?
+>>> data.text
+1565977541
+
+
+

Cross-platform shell scripts in V

+

+ V can be used as an alternative to Bash to write deployment scripts, build scripts, etc. + +The advantage of using V for this is the simplicity and predictability of the language, and cross-platform support. "V scripts" run on Unix-like systems as well as on Windows. +

+
for file in ls('build/') {
+  rm(file)
+}
+mv('v.exe', 'build/')
+
+v run deploy.vsh
+

Read more about V script

- - Become a sponsor via GitHub Sponsors - -
@@ -504,37 +600,37 @@

Fast compilation

- - - - - -
-
-

Small and easy to build compiler

+
+

Small and easy to build compiler

V can be bootstrapped in under a second by compiling its code translated to C with a simple

cc v.c
No libraries or dependencies needed.

- For comparison, space and time required to build each compiler: + For comparison, space and time required to build each compiler. The lines show the amount of time that it takes to build:

+ + + + + + +
Space  Build time
Go525 MB1m 33s
Rust30 GB45m
GCC8 GB50m
Clang90 GB [0] 60m
Swift70 GB [1] 90m
V< 10 MB [2] - <1s
1s
-
+

Building V in 0.3 seconds and then using the resulting binary to build itself again:

@@ -552,7 +648,7 @@

Small and easy to build compiler

-
+

Innovative and flexible memory management

V avoids doing unnecessary allocations in the first place @@ -587,7 +683,7 @@

Innovative and flexible memory management

-
+

V's autofree demo. All objects are freed during compilation. Running the Ved editor on an 8 MB file with 0 leaks:

@@ -603,7 +699,7 @@

Innovative and flexible memory management

-
+

C translation

V can translate your entire C project and offer you the safety, simplicity, and compilation speed-up (via modules).

@@ -624,7 +720,7 @@

C translation

C++ to V translation is at an early stage.

-
+

Translating DOOM from C to V and building it in under a second:

@@ -638,7 +734,7 @@

C translation

-
+

Hot code reloading

Get your changes instantly without recompiling. @@ -647,13 +743,13 @@

Hot code reloading

github.com/.../examples/hot_reload
-
+
-
+ -
- +
+
-
+

Native cross-platform GUI library

Build native apps with native controls. You no longer need to embed a browser to develop cross-platform apps quickly.

@@ -686,81 +782,30 @@

Native cross-platform GUI library

github.com/vlang/ui

-
+

Volt, a 300 KB Slack client built with V and V ui:

- +
-
+

Easy cross compilation

To cross compile your software simply run v -os windows. or v -os linux. No extra steps required, even for GUI and graphical apps!

(Compiling macOS software only works on macOS for now.)

-
+

Building V for Windows using V for macOS, and then testing resulting v.exe on a Windows VM:

-
-
-
-

Painless deployments and dependency management

-

- To build your project, no matter how big, all you need to do is run -

-v .
-

- No build environments, makefiles, headers, virtual environments, etc.
- You get a single statically linked binary that is guaranteed to work on all operating systems (provided you cross compile) without any dependencies.

- Installing new libraries via vpm, a centralized package manager written in V, is as simple as -
-v install ui
-		
-

-
-
-

Run everywhere

-

- V can emit (human readable) C, so you get the great platform support and optimization of GCC and Clang. (Use v -prod . to make optimized builds.)

- Emitting C will always be an option, even after direct machine code generation matures.

- V can call C code, and calling V code is possible in any language that has C interop. -

-
-
- -
-
-

REPL

-
v
->>> import net.http
->>> data := http.get('https://vlang.io/utc_now')?
->>> data.text
-1565977541
-
-
-

Cross-platform shell scripts in V

-

- V can be used as an alternative to Bash to write deployment scripts, build scripts, etc. - -The advantage of using V for this is the simplicity and predictability of the language, and cross-platform support. "V scripts" run on Unix-like systems as well as on Windows. -

-
for file in ls('build/') {
-  rm(file)
-}
-mv('v.exe', 'build/')
-
-v run deploy.vsh
-

Read more about V script

-
-
@@ -846,9 +891,10 @@

Friendly error messages

-
+

Powerful built-in web framework

-

github.com/vlang/v/tree/master/vlib/vweb

+

A simple yet powerful web server with built-in routing, parameter handling, templating, and other features.

+

Lean More Here

@@ -856,7 +902,7 @@

Powerful built-in web framework

Run
-
['/post/:id'] +
['/post/:id'] fn (b Blog) show_post(id int) vweb.Result { post := b.posts_repo.retrieve(id) or { return vweb.not_found() @@ -869,7 +915,6 @@

Powerful built-in web framework

} return vweb.view(post) }
-
-

Gitly, a light and fast alternative to GitHub/GitLab is built in V and vweb.

+

Gitly, a light and fast alternative to GitHub/GitLab is built in V and vweb.

+
+ +
+
-
-

Built-in ORM

-

+

+

Built-in ORM

+

-

+
-
-
- Run -
+
+
+ Run +
-
import sqlite +
import sqlite struct Customer { - id int - name string - nr_orders int - country string +id int +name string +nr_orders int +country string } fn main() { - db := sqlite.connect('example.sqlite') or { - panic('could not create/find example.sqlite') - } +db := sqlite.connect('example.sqlite') or { +panic('could not create/find example.sqlite') +} - nr_customers := sql db { - select count from Customer - } - println('number of all customers: $nr_customers') +nr_customers := sql db { +select count from Customer +} +println('number of all customers: $nr_customers') - // V syntax can be used to build queries - uk_customers := sql db { - select from Customer where country == 'uk' && nr_orders > 0 - } +// V syntax can be used to build queries +uk_customers := sql db { +select from Customer where country == 'uk' && nr_orders > 0 +} - for customer in uk_customers { - println('$customer.id - $customer.name') - } +for customer in uk_customers { +println('$customer.id - $customer.name') +} - // by adding `limit 1` we tell V that there will be - // only one object - customer := sql db { - select from Customer where id == 1 limit 1 - } - println(customer.name) +// by adding `limit 1` we tell V that there will be +// only one object +customer := sql db { +select from Customer where id == 1 limit 1 +} +println(customer.name) - // insert a new customer - new_customer := Customer{name: 'Bob', nr_orders: 10} - sql db { - insert new_customer into Customer - } +// insert a new customer +new_customer := Customer{name: 'Bob', nr_orders: 10} +sql db { +insert new_customer into Customer +} }
-

+

+
+ +
+
+

Sponsors

+
+ + Become a sponsor via GitHub Sponsors +
-
-

Built in V

+
+

Built in V

V

@@ -1082,12 +1152,12 @@

Filey

- Web design by Leah. + Web design by Leah RangerDevv. logo by Sonovice and Don.
- +