Search code examples
frameworksstandard-librarylines-of-codecode-size

How do the size standard libraries compare for different languages


Someone was recently raving about how great jQuery was and how it made javascript into a pleasure and also how the whole source code was so small(and one file).

I looked it up on www.ohloh.net/ and it said it was about 30,000 lines of javascript, when I tired curl piped to wc it said about 5000 lines(strange discrepancy that, maybe test suites, etc?).

I thought well it isn't that strange since javascript from what I've heard has a lot of fun dynamic tricks, so you can probably get away with a small library.

But then I thought what about other high level languages, the ones with large standard libraries and wondered how big the standard are for python/ruby/haskell/pharo(smalltalk)/*ml/etc. (libraries not vm stuff to the degree its possible to separate it)

Anybody know? Any details (comment/blank/code lines , test code lines, lines in language vs lines in ffi/byte-code) are appreciated!

edit: ps. since it started this me asking about jQuery as a bonus if you could please list the size of mega frameworks, a megaframewok provides so much that people using an x megaframework in language y might sometimes refer to programming in xy or even x rather then in y (ie. : qt, jQuery, etc.).


Solution

  • In Pharo, printing:

    |i|
    i := 0.
    SystemNavigation default allBehaviorsDo: [:each| 
    each selectors do: [:selector |
        i := i+((each sourceCodeAt: selector) lineCount)]].
    i. 
    

    results in:

    • PharoCore-1.1-11326 updated to 11334: 367231
    • Seaside-2.8.4: 473368
    • Pharo-1.0 with Suixo base framework: 558656
    • Seaside 3.0a5: 408019

    That includes method comments, and I'm not sure what happens to traits.