V Programming Language

repository·master·Indexed 12 days ago

https://github.com/vlang/v

A compiled language featuring a fast CLI tool for compiler performance benchmarking, support for WebAssembly (WASM) targets, and the ability to compile to shared libraries for C interoperability. Includes documentation for editor integration in Vim and Neovim, as well as performance optimization flags for GCC.

Tokens
172.2K
Snippets
626
Records
961
Agent score
98%

What's inside V

  1. Overview of the v.token module

    master
    The v.token module provides the fundamental building blocks of the V language syntax. It includes the definitions for tokens and provides various utilities for working with them during parsing or lexical analysis.
  2. Overview of the io module

    master
    The io module provides common interfaces for buffered reading and writing of data in V. It is used to handle data streams through standardized interfaces, allowing for efficient I/O operations.
  3. Overview of the Ascon cryptography module

    master

    The ascon module is a pure V language implementation of Ascon-Based Cryptography, following the NIST Special Publication 800-232 standard. It is designed for lightweight cryptography on constrained devices and provides implementations for hashing, extendable output functions (XOF), and authenticated encryption.

    Supported primitives include:

    • Ascon-Hash256: A hashing implementation producing a 256-bit output.
    • Ascon-XOF128: An eXtendable Output Function (XOF) allowing user-selected output sizes.
    • Ascon-CXOF128: A customized XOF that supports both a customization string and user-selected output sizes.
    • Ascon-AEAD128: An Authenticated Encryption with Additional Data (AEAD) scheme.
  4. Overview of v-atomics

    master

    The x.atomics module provides low-level, native atomic operations for V implemented using inline assembly. Unlike standard atomic implementations that rely on C FFI, x.atomics uses architecture-specific assembly to provide predictable code generation and avoid C toolchain dependencies.

    Key Characteristics:

    • Sequential Consistency: All current operations provide sequentially consistent semantics, meaning operations appear globally ordered.
    • Native Implementation: Uses V's inline assembly support rather than calling into C.
    • Architecture Specific: Implementations are provided per-platform (e.g., via atomics.<arch>.v files).
    • i386 Requirement: On i386 architectures, MMX is required.
  5. Overview of p256-m

    master

    p256-m is a minimalistic C implementation of ECDH (Elliptic Curve Diffie-Hellman) and ECDSA (Elliptic Curve Digital Signature Algorithm) on the NIST P-256 curve. It is specifically designed for constrained 32-bit environments (like Arm Cortex-M and Cortex-A) with a focus on correctness, security, and a minimal footprint.

    Key characteristics:

    • Footprint: Less than 3KiB of code and less than 768 bytes of RAM.
    • Language: Standard C99 with optional assembly for Arm Cortex-M/A.
    • Security: Constant-time execution (no branches or memory accesses depending on secret data) and protection against timing attacks and micro-architectural side-channels.
    • Memory: Uses only the stack; no dynamic heap allocation.
  6. Overview of the io.fs module

    master
    The io.fs module provides small, standardized filesystem interfaces designed to be shared across different backends and virtual filesystems. It is modeled after Go's io/fs package but adheres to V's naming and type conventions. This allows developers to write code that operates on a generic FS interface, making it compatible with various underlying storage implementations (e.g., local disk, memory-based filesystems, or cloud storage).
  7. Overview of the coroutines module

    master
    coroutines is a namespace in the V standard library that provides a wrapper around third-party or Photon-based coroutine implementations. It is used to manage concurrent execution flows within the V language ecosystem.
  8. Overview of picoev event loop

    master

    picoev is a tiny, high-performance event loop designed for network applications. It provides an abstraction layer over various I/O multiplexing APIs, specifically supporting select(2), epoll(2), and kqueue(2).

    It achieves high performance through two primary architectural optimizations:

    1. Array-based File Descriptor Management: Instead of using sorted trees (like libevent or libev), picoev uses an array to store information related to file descriptors (such as callback function pointers and arguments). This leverages the fact that Unix file descriptors are small positive integers, allowing for faster state manipulation.
    2. Ring Buffer for Timeouts: Rather than using an ordered tree for timeout management, picoev uses a ring buffer (a sliding array) of bit vectors. Each bit vector represents a set of file descriptors that timeout at a specific interval. For example, it uses 128 bit vectors where each vector represents a one-second interval. If an application requires a timeout longer than 128 seconds, the granularity of the timeout becomes two seconds.
  9. Overview of the V ORM

    master
    V includes a built-in Object-Relational Mapper (ORM) that allows you to create tables, insert records, and manage relationships independently of the specific database driver used. The ORM is designed to work with drivers targeting SQLite, PostgreSQL, MySQL, and H2-backed connections via shared SQL generators.
  10. Overview of the regex module

    master
    The regex module is a small, powerful regular expression library written in pure V. It is designed with a philosophy of simplicity, which results in some behavioral differences compared to PCRE (Perl Compatible Regular Expressions).