forked from vlang/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
695 lines (639 loc) · 42.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
@t header
<!--
BUILTIN TESTING
V LANGUAGE SERVER
-->
<div class='content landing'>
<div class='hero'>
<div class='info'>
<h1>The V Programming Language</h1>
<p>Simple, fast, safe, compiled. For developing maintainable software.</p>
<a class='button' target=_blank href="https://github.com/vlang/v">
<svg class="svg-inline--fa fa-github fa-w-16" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" data-fa-i2svg=""><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>
<div class='text'>
<span class='link'>github.com/vlang/v</span>
<span class='details'><svg viewBox='0 0 14 16' version='1.1' width='12' height='14' aria-hidden='true'><path fill-rule='evenodd' d='M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z' /></svg>18k</span>
</div>
</a>
<div class='button' style="background: #4a607e">
<a id="dl-a" href="https://github.com/vlang/v/releases/latest/download/v_linux.zip" style="display: flex; color: #eee">
<svg class="svg-inline--fa fa-windows fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="windows" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"></path></svg>
<div class='text'>
<span class='link' id='dl-name'>Download for Linux</span>
<span class='details' id='dl-size'>v0.1.28 - 1.7MB</span>
</div>
</a>
<div class='options-container' tabindex="0">
<img class='right-icon' src='/img/down.png' />
<div class='options'>
<a href="https://github.com/vlang/v/releases/latest/download/v_linux.zip" class='dl-option' id='dl_linux'>
<svg class="svg-inline--fa fa-linux fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="linux" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"></path></svg>
<span class='name'>Linux</span>
<span class='size'>1.9MB</span>
</a>
<a href="https://github.com/vlang/v/releases/latest/download/v_macos.zip" class='dl-option' id='dl_macos'>
<svg class="svg-inline--fa fa-apple fa-w-12" id="dl-icon" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="apple" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" data-fa-i2svg=""><path fill="currentColor" d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"></path></svg>
<span class='name'>macOS</span>
<span class='size'>1.9MB</span>
</a>
<a href="https://github.com/vlang/v/releases/latest/download/v_windows.zip" class='dl-option' id='dl_windows'>
<svg class="svg-inline--fa fa-windows fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="windows" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"></path></svg>
<span class='name'>Windows</span>
<span class='size'>1.9MB</span>
</a>
<a href="https://github.com/vlang/v#installing-v-from-source" class='dl-option'>
<svg class="svg-inline--fa fa-windows fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="windows" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""></svg>
<span class='name'>Build from source</span>
</a>
</div>
</div>
</div>
<script>
var dlname = document.getElementById('dl-name')
var dlicon = dlname.parentElement.parentElement.children[0]
var dlsize = document.getElementById('dl-size')
var dla = document.getElementById('dl-a')
var ua = window.navigator.userAgent,
platform = window.navigator.platform,
macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'],
windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'],
iosPlatforms = ['iPhone', 'iPad', 'iPod'],
os = null;
//console.log(platform + '!!');
if (macosPlatforms.indexOf(platform) !== -1 || iosPlatforms.indexOf(platform) !== -1) {
document.getElementById('dl_macos').style.display = 'none'
dlname.innerText = 'Download for macOS'
dlsize.innerText = 'v0.1.28 - 1.9MB'
console.log('hello', dlicon)
dlicon.outerHTML = '<svg class="svg-inline--fa fa-apple fa-w-12" id="dl-icon" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="apple" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" data-fa-i2svg=""><path fill="currentColor" d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"></path></svg>'
dla.href = "https://github.com/vlang/v/releases/latest/download/v_macos.zip"
} else if (windowsPlatforms.indexOf(platform) !== -1 || /Android/.test(ua)) {
document.getElementById('dl_windows').style.display = 'none'
dlname.innerText = 'Download for Windows'
dlsize.innerText = 'v0.1.28 - 1.9MB'
dlicon.outerHTML = '<svg class="svg-inline--fa fa-windows fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="windows" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"></path></svg>'
dla.href = "https://github.com/vlang/v/releases/latest/download/v_windows.zip"
} else if (!os && /Linux/.test(platform)) {
document.getElementById('dl_linux').style.display = 'none'
dlname.innerText = 'Download for Linux'
dlsize.innerText = 'v0.1.28 - 1.9MB'
dlicon.outerHTML = '<svg class="svg-inline--fa fa-linux fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="linux" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M220.8 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7zm-21.9 1.7c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4zM420 403.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7zM223.7 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8zM183 75.8c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1zm-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3-1.4-4.9 0-9 4.2-12.3zm3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9zm-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2zm257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6zM173.3 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5z"></path></svg>'
dla.href = "https://github.com/vlang/v/releases/latest/download/v_linux.zip"
}
</script>
<div class='links'>
<a target=_blank href="https://fast.vlang.io/">Is V still fast?</a>
<a target=_blank href="https://github.com/vlang/v/wiki/FAQ">FAQ</a>
<a target=_blank href="https://github.com/vlang/v/blob/master/CHANGELOG.md">Changelog</a>
</div>
<div class='social'>
<a target=_blank href='https://twitter.com/v_language'><svg class="svg-inline--fa fa-twitter fa-w-16" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg></a>
<a target=_blank href='https://discord.gg/vlang'><svg class="svg-inline--fa fa-discord fa-w-14" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="discord" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M297.216 243.2c0 15.616-11.52 28.416-26.112 28.416-14.336 0-26.112-12.8-26.112-28.416s11.52-28.416 26.112-28.416c14.592 0 26.112 12.8 26.112 28.416zm-119.552-28.416c-14.592 0-26.112 12.8-26.112 28.416s11.776 28.416 26.112 28.416c14.592 0 26.112-12.8 26.112-28.416.256-15.616-11.52-28.416-26.112-28.416zM448 52.736V512c-64.494-56.994-43.868-38.128-118.784-107.776l13.568 47.36H52.48C23.552 451.584 0 428.032 0 398.848V52.736C0 23.552 23.552 0 52.48 0h343.04C424.448 0 448 23.552 448 52.736zm-72.96 242.688c0-82.432-36.864-149.248-36.864-149.248-36.864-27.648-71.936-26.88-71.936-26.88l-3.584 4.096c43.52 13.312 63.744 32.512 63.744 32.512-60.811-33.329-132.244-33.335-191.232-7.424-9.472 4.352-15.104 7.424-15.104 7.424s21.248-20.224 67.328-33.536l-2.56-3.072s-35.072-.768-71.936 26.88c0 0-36.864 66.816-36.864 149.248 0 0 21.504 37.12 78.08 38.912 0 0 9.472-11.52 17.152-21.248-32.512-9.728-44.8-30.208-44.8-30.208 3.766 2.636 9.976 6.053 10.496 6.4 43.21 24.198 104.588 32.126 159.744 8.96 8.96-3.328 18.944-8.192 29.44-15.104 0 0-12.8 20.992-46.336 30.464 7.68 9.728 16.896 20.736 16.896 20.736 56.576-1.792 78.336-38.912 78.336-38.912z"></path></svg></a>
<a target=_blank href='https://forum.vlang.io/'><svg class="svg-inline--fa fa-comments fa-w-18" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="comments" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" data-fa-i2svg=""><path fill="currentColor" d="M416 192c0-88.4-93.1-160-208-160S0 103.6 0 192c0 34.3 14.1 65.9 38 92-13.4 30.2-35.5 54.2-35.8 54.5-2.2 2.3-2.8 5.7-1.5 8.7S4.8 352 8 352c36.6 0 66.9-12.3 88.7-25 32.2 15.7 70.3 25 111.3 25 114.9 0 208-71.6 208-160zm122 220c23.9-26 38-57.7 38-92 0-66.9-53.5-124.2-129.3-148.1.9 6.6 1.3 13.3 1.3 20.1 0 105.9-107.7 192-240 192-10.8 0-21.3-.8-31.7-1.9C207.8 439.6 281.8 480 368 480c41 0 79.1-9.2 111.3-25 21.8 12.7 52.1 25 88.7 25 3.2 0 6.1-1.9 7.3-4.8 1.3-2.9.7-6.3-1.5-8.7-.3-.3-22.4-24.2-35.8-54.5z"></path></svg></a>
<a href='https://www.youtube.com/channel/UCLZIElNyubHOvbfudT7KS1A'><svg class="svg-inline--fa fa-youtube fa-w-18" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="youtube" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" data-fa-i2svg=""><path fill="currentColor" d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"></path></svg></a>
<a href='https://t.me/vlang_en'><svg class="svg-inline--fa fa-telegram fa-w-16 telegram" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="telegram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512" data-fa-i2svg=""><path fill="currentColor" d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm121.8 169.9l-40.7 191.8c-3 13.6-11.1 16.9-22.4 10.5l-62-45.7-29.9 28.8c-3.3 3.3-6.1 6.1-12.5 6.1l4.4-63.1 114.9-103.8c5-4.4-1.1-6.9-7.7-2.5l-142 89.4-61.2-19.1c-13.3-4.2-13.6-13.3 2.8-19.7l239.1-92.2c11.1-4 20.8 2.7 17.2 19.5z"></path></svg></a>
<a target=_blank href='https://twitch.tv/v_language'>
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="twitch" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-twitch fa-w-16 fa-2x"><path fill="currentColor" d="M391.17,103.47H352.54v109.7h38.63ZM285,103H246.37V212.75H285ZM120.83,0,24.31,91.42V420.58H140.14V512l96.53-91.42h77.25L487.69,256V0ZM449.07,237.75l-77.22,73.12H294.61l-67.6,64v-64H140.14V36.58H449.07Z" class=""></path></svg>
</a>
<a target=_blank href='https://marketplace.visualstudio.com/items?itemName=0x9ef.vscode-vlang'><img width=27 src='/img/vscode.png'></a>
<a target=_blank href='https://github.com/ollykel/v-vim'><img width=27 src='/img/vim.png'></a>
<a target=_blank href='https://github.com/damon-kwok/v-mode'><img width=27 src='/img/emacs.png'></a>
<a target=_blank href='https://github.com/oversoul/vlang-sublime'><img width=27 src='/img/sublime.png'></a>
</div>
<div style='margin:12px'>
<a target=_blank href='https://discord.gg/vlang'>
<img src='https://camo.githubusercontent.com/6c33b3fd882c28b844cc7970053244660b857100/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3539323130333634353833353832313036383f6c6162656c3d446973636f7264266c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465'>
</a>
</div>
</div>
<div class='examples'>
<div class='codeblock' id="codeblock_99404097">
<div class='titlebar separator'>
<div class='flex'></div>
<!--
<a href="https://v-wasm.now.sh" class='play-btn' id='codeblock_rb_13318017'><svg class="svg-inline--fa fa-play fa-w-14" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="play" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg> Run</a>
-->
</div>
<pre><div id="codeblock_hl_04227451">fn main() {
areas := ['game', 'web', 'tools', 'science', 'systems',
'embedded', 'drivers', 'GUI', 'mobile']
for area in areas {
println('Hello, $area developers!')
}
}</div><textarea spellCheck="false" id="codeblock_ta_39322469" class="">fn main() {
areas := ['game', 'web', 'tools', 'science', 'systems',
'embedded', 'drivers', 'GUI', 'mobile']
for area in areas {
println('Hello, $area developers!')
}
}</textarea></pre>
</div>
<script>
function tokenize_codeblock_99404097 (e) {
Tokenizer(e.target.value).then(function(tokens) {
document.getElementById("codeblock_hl_04227451").innerHTML = tokens
.map(function(token) { return `<span class='${token.type}'>${token.value}</span>` })
.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)
}
document.getElementById("codeblock_rb_13318017").onclick = function(e) {
if (location.pathname === 'https://v-wasm.now.sh') e.preventDefault()
var codeblock_value = document.getElementById("codeblock_ta_39322469").value
localStorage.setItem('sandbox-code', codeblock_value)
}
</script>
</div>
</div>
<div>
<div class="section">
<div class="block">
<h2>%simple_language_for_maintainable_programs</h2>
<p>
You can learn the entire languages by going through the
<a target=_blank href='https://github.com/vlang/v/blob/master/doc/docs.md'>documentation</a> in half an hour, and in most cases there's only one way to do something.
<p>
This results in simple, readable, and maintainable code.
<p>
Despite being simple, V gives a lot of power to the developer and can be used in pretty much every field, including systems programming, webdev, gamedev, GUI, mobile (wip), science, embedded, tooling, etc.
</p>
<p>
V is very similar to Go. If you know Go, you already know ≈80% of V.
Things V improves on Go: <a target=_blank href='https://vlang.io/compare#go'>vlang.io/compare#go</a>.
</p>
</div>
<div class="block">
<h2>Safety</h2>
<ul>
<li>No null</li>
<li>No global variables</li>
<li>No undefined values</li>
<li>No undefined behavior</li>
<li>No variable shadowing</li>
<li>Bounds checking</li>
<li><a href="https://github.com/vlang/v/blob/master/doc/docs.md#variables">Immutable variables by default</a></li>
<li><a href="https://github.com/vlang/v/blob/master/doc/docs.md#pure-functions-by-default">Pure functions by default</a></li>
<li><a href="https://github.com/vlang/v/blob/master/doc/docs.md#access-modifiers">Immutable structs by default</a></li>
<li><a href="https://github.com/vlang/v/blob/master/doc/docs.md#optionresult-types-and-error-handling">Option/Result and mandatory error checks</a></li>
<li><a href="https://github.com/vlang/v/blob/master/doc/docs.md#sum-types">Sum types</a></li>
<li><a href="https://github.com/vlang/v/blob/master/doc/docs.md#generics">Generics</a></li>
</ul>
</div>
</div>
<div class="section">
<div class="block">
<h2>Performance</h2>
<ul>
<li>As fast as C</li>
<li>C interop without any costs</li>
<li>Minimal amount of allocations</li>
<li>Built-in serialization without runtime reflection</li>
<li>Compiles to native binaries without any dependencies: a simple web server is only 65 KB</li>
</ul>
</div>
<div class="block">
<h2>Fast compilation</h2>
<p>
V compiles between ≈80k (Clang backend) and ≈1 million (x64 and tcc backends) lines of code per second per CPU core. <br><i>(Intel i5-7500, SM0256L SSD, no optimization)</i><br/><br/>
V is written in V and compiles itself in under a second.
</p>
</div>
</div>
<div class="section">
<div class="block">
<h2>Small and easy to build compiler</h2>
<p>
V can be bootstrapped in under a second by compiling its code translated to C with a simple <pre>cc v.c</pre>No libraries or dependencies needed.
<br /><br />
For comparison:
</p>
<table>
<tbody><tr><td></td><td>Space required </td><td>Build time</td></tr>
<tr><td>Go</td><td>525 MB</td><td>1m 33s</td></tr>
<tr><td>Rust</td><td>30 GB</td><td>45m</td></tr>
<tr><td>GCC</td><td>8 GB</td><td>50m</td></tr>
<tr><td>Clang</td><td>90 GB
<a target="_blank" class="sidenote" href="https://lists.llvm.org/pipermail/llvm-dev/2019-April/132028.html">[0]</a>
</td><td>60m</td></tr>
<tr><td>Swift</td><td>70 GB
<a target="_blank" class="sidenote" href="https://github.com/apple/swift#getting-started">[1]</a>
</td><td>90m</td></tr>
<tr><td>V</td><td>< 2 MB
<a target="_blank" class="sidenote" href="https://github.com/vlang/vc/blob/master/v.c">[2]</a>
</td><td><1s</td></tr>
</tbody></table>
</div>
<div class="block">
<p>Building V in 0.4 seconds and then using the resulting binary to build itself again:</p>
<video looping="true" autoPlay muted src="/img/buildv.mp4" style="width: 80%; margin-left: 10%"></video>
</div>
</div>
<div class="section">
<div class="block">
<h2>C translation (wip)</h2>
<p>V can translate your entire C project (wip) and offer you the safety, simplicity, and 10-25x compilation speed-up. </p>
<div style="display: flex">
<pre style="margin-right: 36px">std::vector<std::string> s;
s.push_back("V is ");
s.push_back("awesome");
std::cout << s.size();</pre>
<pre>mut s := []
s << 'V is '
s << 'awesome'
println(s.len)</pre>
</div>
<p>
A blog post about translating DOOM will be published.<br/><br/>
<i>C++ to V translation is at an early stage.</i>
</p>
</div>
<div class="block">
<p>
Translating DOOM from C to V and building it in 0.7 seconds:
</p>
<img src="/img/doom.png" style="width: 80%; margin-left: 0">
<p>
You can follow the progress and read translated code here:
<a target=_blank href='https://github.com/vlang/doom'>github.com/vlang/doom</a>
</p>
</div>
</div>
<div class="section">
<div class="block">
<h2>Hot code reloading</h2>
<p>
Get your changes instantly without recompiling.
<br /><br />
Since you also don't have to get to the state you are working on after every compilation, this can save a lot of precious minutes of your development time.
</p>
<a href="https://github.com/vlang/v/tree/master/examples/hot_reload">github.com/.../examples/hot_reload</a>
</div>
<div class="block">
<video looping="true" autoPlay muted src="/img/hot.mp4" style="width: 80%; margin-left: 10%"></video>
</div>
</div>
<div class="section">
<div class="block">
<h2>Powerful graphics libraries</h2>
<p>
Cross-platform drawing library built on top of GDI+/Cocoa Drawing, and an OpenGL based graphics library for more complex 2D/3D applications, that will also have the following features:
</p>
<ul>
<li>Loading complex 3D objects with textures</li>
<li>Camera (moving, looking around)</li>
<li>Skeletal animation</li>
</ul>
<p>DirectX, Vulkan, and Metal support is planned.</p>
<p>A simple example of the graphics library in action is <a href="https://github.com/vlang/v/blob/master/examples/tetris">tetris.v</a>.</p>
</div>
<div class="block">
<img src="/img/gg.png" style="width: 60%; margin-left: 20%"></img>
</div>
</div>
<div class="section">
<div class="block">
<h2>Native cross-platform GUI library</h2>
<p>
Build native apps with native controls. You no longer need to embed a browser to develop cross-platform apps quickly.<br /><br />
V has a ui module that uses native GUI toolkits: WinAPI/GDI+ on Windows, Cocoa on macOS. On Linux custom drawing is used.<br /><br />
Coming soon:
</p>
<ul>
<li>a Delphi-like visual editor for building native GUI apps</li>
<li>iOS/Android support with native controls</li>
<li>a declarative API similar to SwiftUI and React Native</li>
</ul>
<p><a href="https://github.com/vlang/ui">github.com/vlang/ui</a></p>
</div>
<div class="block">
<p>
Volt, a 300 KB Slack client built with V and V ui:
</p>
<img src="https://volt-app.com/img/screen3.png" style="width: 100%"></img>
</div>
</div>
<div class="section">
<div class="block">
<h2>Easy cross compilation</h2>
<p>
To cross compile your software simply run v -os windows. or v -os linux. No extra steps required, even for GUI and graphical apps!<br/><br/>
(Compiling macOS software only works on macOS for now.)
</p>
</div>
<div class="block">
<p>
Building V for Windows using V for macOS, and then testing resulting v.exe on a Windows VM:
</p>
<video looping="true" autoPlay muted src="/img/vwin.mp4" style="width: 100%"></img>
</div>
</div>
<div class="section">
<div class="block">
<h2>Painless deployments and dependency management</h2>
<p>
To build your project, no matter how big, all you need to do is run v .<br/><br/>
No more build environments, makefiles, headers, virtual environments, etc.<br/><br/>
You get a single statically linked binary that is guaranteed to work on all operating systems (provided you cross compile) without any dependencies.<br/><br/>
Installing new libraries is as simple as
<pre>
v install ui
</pre>
</p>
</div>
<div class="block">
<h2>Run everywhere</h2>
<p>
V can emit (human readable) C, so you get the great platform support and optimization of GCC and Clang.<br/><br/>
Emitting C will always be an option, even after direct machine code generation matures.<br/><br/>
V can call C code, and calling V code is possible in any language that has C interop.
</p>
</div>
</div>
<div class="section">
<div class="block">
<h2>REPL</h2>
<pre style="margin-right: 36px">v
>>> import net.http
>>> data := http.get('https://vlang.io/utc_now')?
>>> data.text
1565977541</pre>
</div>
<div class="block">
<h2>V Script</h2>
<pre style="margin-right: 36px">for file in ls('build/') {
rm(file)
}
mv('v.exe', 'build/')
v run deploy.vsh</pre>
<p><a href="/docs#bash">Read more about V script</a></p>
</div>
</div>
<div class="section">
<div class="block">
<h2>Code formatting with vfmt for consistent style</h2>
<p>
No more arguments about coding styles. There's one official coding style
enforced by the vfmt formatter.
</p>
<p>
All V code bases are guaranteed to use
the same style, making it easier to read and change code written by
other developers.
</p>
<pre>v fmt -w hello.v</pre>
</div>
<div class="block">
<h2>A built-in code profiler</h2>
<p>
Build and run your program with <pre>v -profile profile.txt x.v && ./x</pre> and
you'll get a detailed list for all function calls: number of calls, average time per
call, total time per call.
</p>
</div>
</div>
<div class="section">
<div class="block">
<h2>JavaScript and WASM backends</h2>
<p>
V programs can be translated to JavaScript:
</p>
<pre>v -o hello.js hello.v</pre>
<p>
They can also be compiled to and WASM (for now with Emscripten).
V compiler compiled to WASM and running V programs by translating them to JavaScript:
</p>
<p>
<a target=_blank href='https://v-wasm.now.sh/'>v-wasm.now.sh</a>
</p>
<p>A game written using V's graphical backend and compiled to WASM:</p>
<a target=_blank href='https://v2048.vercel.app/'>v2048</a>
</div>
<div class="block">
<h2>Automatic documentation</h2>
<p>
Use vdoc to get instant documentation generated directly from
the module's source code. No need to keep and update separate documentation.
</p>
<pre>v doc os</pre>
</div>
</div>
<div class="section">
<div class="block">
<h2>Powerful built-in web framework</h2>
<p><a href="https://github.com/vlang/v/tree/master/vlib/vweb">github.com/vlang/v/tree/master/vlib/vweb</a></p>
<div class='codeblock' id="codeblock_12828032">
<div class='titlebar separator'>
<div class='flex'></div>
<a href="https://v-wasm.now.sh" class='play-btn' id='codeblock_rb_06463216'><svg class="svg-inline--fa fa-play fa-w-14" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="play" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg> Run</a>
</div>
<pre><div id="codeblock_hl_93987704">['/post/:id']
fn (b Blog) show_post(id int) vweb.Result {
post := b.posts_repo.retrieve(id) or {
return vweb.not_found()
}
return vweb.view(post)
}</div><textarea spellCheck="false" id="codeblock_ta_15447927" class="">['/post/:id']
fn (b Blog) show_post(id int) vweb.Result {
post := b.posts_repo.retrieve(id) or {
return vweb.not_found()
}
return vweb.view(post)
}</textarea></pre>
</div>
<script>
function tokenize_codeblock_12828032 (e) {
Tokenizer(e.target.value).then(function(tokens) {
document.getElementById("codeblock_hl_93987704").innerHTML = tokens
.map(function(token) { return `<span class='${token.type}'>${token.value}</span>` })
.join('')
})
}
document.getElementById("codeblock_ta_15447927").oninput = tokenize_codeblock_12828032
tokenize_codeblock_12828032({target:{value: document.getElementById("codeblock_ta_15447927").value}})
document.getElementById("codeblock_rb_06463216").onauxclick = function(e) {
localStorage.setItem('sandbox-code', document.getElementById("codeblock_ta_15447927").value)
}
document.getElementById("codeblock_rb_06463216").onclick = function(e) {
if (location.pathname === 'https://v-wasm.now.sh') e.preventDefault()
var codeblock_value = document.getElementById("codeblock_ta_15447927").value
localStorage.setItem('sandbox-code', codeblock_value)
}
</script>
<p><a href="https://forum.vlang.io/">V forum</a> is running on Vorum (built with V/vweb).</p>
</div>
<div class="block">
<h2>Built-in ORM</h2>
<p>
<div class='codeblock' id="codeblock_63253338">
<div class='titlebar separator'>
<div class='flex'></div>
<a href="https://v-wasm.now.sh" class='play-btn' id='codeblock_rb_61993869'><svg class="svg-inline--fa fa-play fa-w-14" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="play" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"></path></svg> Run</a>
</div>
<pre><div id="codeblock_hl_69524066">import sqlite
struct Customer {
id int
name string
nr_orders int
country string
}
fn main() {
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')
// 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')
}
// 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
}
}
</div><textarea spellCheck="false" id="codeblock_ta_60982598" class="">import sqlite
struct Customer {
id int
name string
nr_orders int
country string
}
fn main() {
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')
// 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')
}
// 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
}
}
</textarea></pre>
</div>
<script>
function tokenize_codeblock_63253338 (e) {
Tokenizer(e.target.value).then(function(tokens) {
document.getElementById("codeblock_hl_69524066").innerHTML = tokens
.map(function(token) { return `<span class='${token.type}'>${token.value}</span>` })
.join('')
})
}
document.getElementById("codeblock_ta_60982598").oninput = tokenize_codeblock_63253338
tokenize_codeblock_63253338({target:{value: document.getElementById("codeblock_ta_60982598").value}})
document.getElementById("codeblock_rb_61993869").onauxclick = function(e) {
localStorage.setItem('sandbox-code', document.getElementById("codeblock_ta_60982598").value)
}
document.getElementById("codeblock_rb_61993869").onclick = function(e) {
if (location.pathname === 'https://v-wasm.now.sh') e.preventDefault()
var codeblock_value = document.getElementById("codeblock_ta_60982598").value
localStorage.setItem('sandbox-code', codeblock_value)
}
</script>
</p>
</div>
</div>
</div>
<div class="section" style="flex-direction: column">
<div class="block">
<h1>Sponsors</h1>
<div style="margin-top: 16px">
<a href="https://data.mx.com/">
<img style="height: 250px" src="/img/sponsor_mx.png" />
</a>
</div>
</div>
<a href="https://github.com/sponsors/medvednikov" target=_blank style="margin: 0 0px 32px 0px; text-align: center">
Become a sponsor via GitHub
</a>
</div>
<div class="section" style="flex-direction: column">
<div class="block">
<h1>Built in V</h1>
<div class="built-in-v">
<div class="first">
<h2>V</h2>
<p>V itself is written in V.</p>
</div>
<div class="second">
<a href="https://volt-app.com/"><h2>Volt</h2></a>
<p>Native desktop client for Slack, Skype, Matrix, Telegram, Twitch and many more services.</p>
</div>
<div class="first">
<h2>Filey</h2>
<p>Cross-platform file manager with Miller Columns and built-in selective sync with major cloud platforms.</p>
</div>
<div class="second">
<a href="https://github.com/medvednikov/ved"><h2>Ved</h2></a>
<p>Open-source 1 MB editor with the performance of Sublime Text.</p>
</div>
<div class="first">
<h2>C/C++ to V translator</h2>
<p>This tool already supports C and will soon support the latest standard of notoriously complex C++. It does full automatic conversion to human readable code.</p>
</div>
<div class="second">
<a href="https://github.com/vlang/ui"><h2>V UI</h2></a>
<p>Cross-platform widget toolkit using native APIs.</p>
</div>
<div class="first">
<a href="https://github.com/vlang/gitly"><h2>Gitly</h2></a>
<p>Open-source light and fast alternative to GitHub/GitLab.</p>
</div>
<div class="second">
<a href="https://github.com/vlang/vorum"><h2>Vorum</h2></a>
<p>Right now it's very basic forum/blogging software, but in the future it will be a full featured light alternative to Discourse.<br>The V forum runs on Vorum.</p>
</div>
<div class="first">
<a href="https://github.com/dariotarantini/vgram"><h2>vgram</h2></a>
<p>A bot library for Telegram Bot API.</p>
</div>
<div class="second">
<a href="https://github.com/vlang/awesome-v"><h2>Awesome V</h2></a>
<p>A curated list of awesome V frameworks, libraries and software</p>
</div>
</div>
<div style="text-align: center">
<p>Are you using V to build your product or library? <a href="mailto:alexander@vlang.io">Have it added to this list.</a></p>
</div>
</div>
</div>
<i style="margin-top: 48px; margin-bottom: 8px">Web design by <a href="https://twitter.com/leahlundqvist">Leah</a>.</i>
<i>
<img src="/img/v-logo.png" style="width:15px;position: relative; top: 3px;">
logo by <a href="https://github.com/sonovice/">Sonovice</a> and <a href="https://github.com/dhonx">Don</a>.
</i>
</div>
@t footer