This repository is the official compiler, standard library, and toolchain for the V programming language. It is a self-hosting, multi-backend compiler (primarily targeting C, with experimental JS and WASM backends) that produces highly optimized native executables. The standard library is exceptionally comprehensive, offering built-in support for cryptography (AES, SHA3, Ed25519, TLS via mbedtls), compression (gzip, zstd, lz4, snappy), database connectivity (SQLite, MySQL, PostgreSQL, MSSQL, Redis), a full web framework (veb), graphics (gg, sokol), and CLI development tools. The architecture is a monolithic compiler with a modular standard library. The compiler pipeline involves scanning, parsing, type-checking, and code generation. The build system uses a multi-stage bootstrap process. The codebase demonstrates extremely high craftsmanship, with clean abstractions, extensive test coverage, and reusable components. It is actively maintained with a large community. Key reusable components include the pure-V implementations of cryptographic primitives (Ed25519, SHA-3), compression algorithms (LZ77, Snappy), data structures (lock-free ring buffer, FSM), and the CLI framework. These modules are isolated, well-tested, and could be extracted for use in other projects with minimal modification.
llvm-cbe is a resurrected LLVM C backend that converts LLVM Intermediate Representation (IR) into compilable C code. It operates as both a library (implementing an LLVM target machine) and a command-line tool (llvm-cbe) that reads LLVM bitcode or IR and outputs C source files. The core is the CWriter pass, which handles type lowering, instruction translation, and generation of C-compatible code including structs, arrays, vectors, and intrinsics. It supports a wide range of LLVM features such as atomic operations, vector instructions, and various calling conventions, and includes extensive test suites (C, C++, and LLVM IR tests) to verify correctness across multiple optimization levels and compilers (GCC, Clang, MSVC). The project is actively maintained, targeting LLVM 22, and is used primarily in scenarios where C code generation is needed from LLVM IR, such as cross-compilation or embedding.