Skip to content

Instantly share code, notes, and snippets.

@ttim
Last active July 15, 2021 04:36
Show Gist options
  • Save ttim/3de681f008d408745c9369d2ea076c69 to your computer and use it in GitHub Desktop.
Save ttim/3de681f008d408745c9369d2ea076c69 to your computer and use it in GitHub Desktop.
Programming languages complexity comparison

Programming languages complexity comparison

Got inspired by https://erik-engheim.medium.com/source-code-of-python-and-julia-compared-7895202e8cb2 and compared couple more languages CLOCs. I did top ~3 for each + total.

  • Julia
    • Julia: 210K code, 65K comments
    • C + C++: 95K code, 9K comments
    • Markdown: 35K
    • Total: 380K code, 80K comments
  • Python (cpython)
    • Python: 590K code, 150K comments
    • C + C++: 554K code, 62K comments
    • reStructuredText: 116K code, 137K comments (?!?)
    • Total: 1360K code, 355K comments
  • Scala 3 (dotty)
    • Scala: 320K code, 50K comments
    • Markdown: 20K
    • Total: 357K code, 53K comments
  • Rust
    • Rust: 977K code, 276K comments
    • Markdown: 40K
    • Total: 1057K code, 287K comments
  • Swift
    • C++: 793K code, 200K comments. Is it autogenerated?
    • (???) JSON: 516K code
    • Swift: 509K code, 281K comments
    • Markdown + reStructuredText: 60K code
    • Total: 1968K code, 500K comments
  • Zig
    • C + C++: 1935K code, 275K comments. I'm certain bunch of that is autogenerated tho
    • Zig: 396K code, 32K comments
    • Total: 2406K code, 325K comments
  • C/C++ (clang, without llvm, libc & co, just clang subdirectory in https://github.com/llvm/llvm-project)
    • C + C++: 1782K code, 2028K comments
    • Total: 2119K code, 2105K comments
  • Ruby
    • Ruby: 848K code, 70K comments
    • C: 392K code, 83K comments
    • Total: 1311K code, 155K comments
  • JS (v8)
    • C++: 1567K code, 159K comments
    • JS: 645K code, 111K comments
    • Total: 2276K code, 279K comments
  • Kotlin
    • Kotlin: 1913K code, 321K comments
    • Java: 1047K code, 76K comments
    • Total: 3226K code, 426K comments
  • JVM (hotspot)
    • C++: 777K code, 236K comments
    • Total: 805K code, 237K comments
  • Java (jdk - hotspot)
    • Java: 4302K code, 2510K comments
    • XML: 1310K code
    • Total: 6737K code, 2742K comments
  • Java (only compiler's src)
    • (Only) Java: 106K code, 54K comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment