Rust vs Go: source lines of code compared
As of 2026-07-30, rust-lang/rust contains 4,759,437 total lines (3,853,844 code) across 40,189 files, while golang/go contains 2,857,765 total lines (2,030,744 code) across 9,101 files as of 2026-07-27. rust-lang/rust is about 1.9x the size of golang/go by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.
| Metric | rust-lang/rust | golang/go |
|---|
| Files | 40,189 | 9,101 |
| Total lines | 4,759,437 | 2,857,765 |
| Code lines | 3,853,844 | 2,030,744 |
| Comment lines | 459,711 | 601,493 |
| Blank lines | 445,882 | 225,528 |
| Languages counted | 12 | 12 |
Top languages in rust-lang/rust: Rust (74.7% of code), JSON (9.2% of code), HTML (8.2% of code). Top languages in golang/go: Go (90.9% of code), GNU Style Assembly (6.9% of code), Snakemake (1.0% of code). JSON, YAML appear in both top language lists; Rust, HTML, XML appear only in rust-lang/rust's top languages; Go, GNU Style Assembly, Snakemake appear only in golang/go's top languages.
Methodology: both counts come from cached OctoCounts reports generated with tokei. rust-lang/rust was counted at ref main (commit 83709eedfff3) on 2026-07-30; golang/go was counted at ref master (commit d1c13566375d) on 2026-07-27. See the counting methodology for ignored directories and analysis options.
Evidence and next steps:
Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.