V (programming language): Difference between revisions - Wikipedia


Article Images

Content deleted Content added

Line 37:

===Safety===

V has stricter policies to facilitate greater memory-safety, speed, and secure code.<ref name="section">{{cite web |last1=Umoren |first1=Samuel |title=Building a Web Server using Vlang |url=https://www.section.io/engineering-education/building-web-server-with-vlang/ |website=Section |access-date=5 April 2021}}</ref><ref name="MUO">{{cite web |last1=Galuh |first1=Rosa |title=A Brief Introduction to the V Language |url=https://www.makeuseof.com/v-language-brief-introduction |website=MUO |date=8 August 2022 |access-date=8 August 2022}}</ref> Among these default safety features are:<ref name="section"></ref><ref name="MUO"></ref><ref name="hackaday">{{cite web |last1=James |first1=Ben |date=23 July 2019 |title=The V Programming Language: Vain Or Virtuous? |url=https://hackaday.com/2019/07/23/the-v-programming-language-vain-or-virtuous/ |access-date=23 July 2019 |website=Hackaday}}</ref><ref name="Knott">{{cite web |last1=Knott |first1=Simon |title=An introduction to V |date=27 June 2019 |url=https://simonknott.de/articles/vlang/ |access-date=27 June 2019}}</ref> 1) Usage of bounds checking. 2) Usage of Option/Result. 3) Mandatory checking of errors. 4) Variables are immutable by default. 5) Structs are immutable by default. 6) Function args are immutable by default. 7) No usage of values that are undefined. 8) No shadowing of variables. 9) No usage of null (unless in unsafe code marked as unsafe). 10) No usage of global variables (unless enabled via flag).

=== Performance ===