views:

155

answers:

2

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, ect?).

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/ect. (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.).

+1  A: 

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.

Stephan Eggermont
voted up for smalltalk awesomeness.
Roman A. Taycher
and of course the Seaside 3.0 includes jQuery
Stephan Eggermont
The ideomatic way would be to use inject:into:, but that is not as readable for non-smalltalkers
Stephan Eggermont
+1  A: 

Probably it should be fairer to compare jQuery with other javascript libraries alike ONLY. I'd like to think that this was taking into account that someone you talk about.

jQuery, PRODUCTION (24KB, Minified and Gzipped) or (155KB, Uncompressed Code)
jQuery UI, full Minified 200kb
Prototype, Size: 128kB
Script.aculo.us, Size: 63kB
mootools, Size: 63kB
extJS, Size: 6.6mB FULL, core 130Kb
Yahoo! UI Library (YUI), Size: core minified 17kb, 7kb minified and gzipped, full 379kb minified, 135 minified and gzipped
Mochikit, Size: 380kB
dojo, Size: compressed (27k)
Could you mention # of lines rather then size of file(s)?
Roman A. Taycher