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

ergosys
  • 47,835
  • 5
  • 49
  • 70
Roman A. Taycher
  • 18,619
  • 19
  • 86
  • 141
  • There's a readable version of jQuery for maintenance, and a minified version for deploying, to reduce the download size. That could explain the discrepancy. – Thomas May 14 '10 at 12:09
  • jQuery and, say, Python have vastly different purposes, environments and scope. It might be kinda cool to know the weight ratio between a battleship and a Volkswagen Beetle, but it isn't a particularly _useful_ number. – Marcelo Cantos May 14 '10 at 12:27
  • note 5000 lines of code was for the non minified version. – Roman A. Taycher May 14 '10 at 20:45
  • i know they have a very large non overlapping purpose, but I would still like to know. – Roman A. Taycher May 15 '10 at 12:59
  • 1
    Using Python as an example, a lot of the Python "standard libraries" (time, os, sys) are largely just wrappers around standard C library functions, and other "standard python" features (readline support) are wrappers around non-standard C libraries. Is it fair to say that Python has a small library when it uses millions of lines of existing code? Of course, I really mean CPython. There's Jython (Python-on-JVM), PyPy (Python-on-Python), and IronPython (Python.NET) to name a few; all of them will have their own libraries and no doubt call into C libraries for stuff like file access... – tc. May 25 '10 at 00:12

2 Answers2

2

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
  • 15,847
  • 1
  • 38
  • 65
1

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)
user347594
  • 1,256
  • 7
  • 11