3 ms·
How big is something like python?
by nickik 16y ago
How big is something like python?
- riffraff 16y agoI'd say that's possibly a not so interesting comparison, in the sense that python and clojure seem to have quite different name-usage patterns, but some values that may interest you: the size of __builtins_, the basic types and functions would be len(__builtins__.__dict__.values()) #=> 143 but then you'd have to consider the methods/attributes on each object len(list(chain( *[dir(o) for o in __builtins__.__dict__.values()]))) #=> 4133 but then again, most of these are either the same method that keeps appearing via inheritance, or a different implementation of the same protocol, so you may want to collapse same-named objects len(set(chain( *[dir(o) for o in __builtins__.__dict__.values()]))) #=> 250 which added to the names of the first iteration gives you ~400 names, about half of clojure. But a lot of code in python is in the standard lib even if not loaded as __builtin__, sadly, I'm not sure how to list/load all the standard library in one go.
- regularfry 16y agoI think that's a valid question. Python aims at "batteries included," so everything you get out of the box when you do a "make install" should count. With that in mind, I can't think of many that are bigger in terms of coverage.