| Category/Non-comment LoC (Slang, unless indicated otherwise) | Code | Tests | Total |
|---|---|---|---|
| Runtime (Java, C) | 58,884 | 37,083 | 95,967 |
| Extension (Java, C; for, e.g., file/network I/O) | 37,241 | 47,559 | 84,800 |
| Library | 9,899 | 7,303 | 17,202 |
| Compiler (e.g., lexer, parser, AST, type checker, IR, C templates, and JVM bytecode/wasm AST writer/reader) | 117,251 | 57,032 | 174,283 |
| Other (e.g., Laba, Proyek build tool, Crucible test framework, Kopi code coverage framework, LL(k) parser generator, markdown/TOML parsers) | 264,316 | 170,409 | 434,725 |
| Misc (e.g., build/CI scripts, host adapters, V preview demos; C, Java, TypeScript, JavaScript, Swift, Objective-C, and wasm text) | 6,021 | 2,146 | 8,167 |
| Total V codebase | 493,612 | 321,532 | 815,144 |
- V is self-hosting and self-bootstrapping, starting with dependency installation (written in Slang). Compiling V's Slang codebase, including its tools and tests, also serves as a compiler regression test. Java and C runtime and extension implementations use their own toolchains. Unless indicated otherwise, the code is written in Slang.
- V's Slang test suites use Crucible, demonstrated by the test-suite example. The runtime also has direct Java and C tests. Tests LoC include their dedicated fixtures and support.
- Transpiled C code can be compiled using GCC, Clang, CompCert, and cosmocc. Generated wasm core-module bundles run using wasmtime, GraalWasm, and in compatible browsers as shown in the Compiler Demo.
- Bootstrapping starts from a qualified seed, rebuilds the runtime, parser/visitor generators, compiler, and build tools, then checks that its two successive compiler generations produce identical JARs. On a 16-core AMD Ryzen 9 9950X3D Linux desktop with 128 GB RAM, separate phase measurements took:
- About 15 minutes for dependency setup and qualification (cached downloads).
- About 31 minutes for the complete bootstrap.
- About 43 minutes for a full build and test run (reused build products).
- Browser compiler wasm32: 60.2 MiB (63,079,522 bytes, uncompressed).
- Precompiled runtime wasm32: 751.5 KiB (769,539 bytes, uncompressed).
- Precompiled library (including parts of Other) wasm32: 3.2 MiB (3,338,906 bytes, uncompressed).