[racket-dev] code base metrics

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Mon Nov 29 17:32:49 EST 2010

There is one thing defined at phase 0, module-begin. The module exports
a bunch of stuff

(provide (rename-out [module-begin #%module-begin])
         (except-out (all-from-out scheme/base) #%module-begin)
         (all-from-out scheme/unit)
         (all-from-out scheme/contract)
         (for-syntax (all-from-out scheme/base)))

I realize you probably wanted something like 'only count exports of
things defined in the module' but thats a little harder to compute,
which is why the metric is a first approximation.

On 11/29/2010 03:29 PM, Matthias Felleisen wrote:
> Thanks, that's great. But what does this mean: 
>
>  "collects/racket/signature/lang.rkt defined 1 exported 2747"
>
> -- Matthias
>
>
>
>
> On Nov 29, 2010, at 4:24 PM, Jon Rafkind wrote:
>
>> On 11/29/2010 12:20 PM, Jon Rafkind wrote:
>>> I hacked my old tool to get a first approximation and ran it on all the
>>> files of the collects/racket tree. I can run it on the entire collects
>>> tree if you want, but its sort of slow so it will take a while. I
>>> couldn't expand all the files because local requires failed, I'll try to
>>> fix that.
>> Here is a better list
>>
>> collects/racket/file.rkt defined 29 exported 18
>> collects/racket/include.rkt defined 5 exported 4
>> collects/racket/set.rkt defined 32 exported 26
>> collects/racket/gui/info.rkt defined 3 exported 2
>> collects/racket/gui/init.rkt defined 0 exported 3354
>> collects/racket/gui/base.rkt defined 4 exported 209
>> collects/racket/gui/lang/reader.rkt defined 6 exported 3
>> collects/racket/gui/dynamic.rkt defined 5 exported 2
>> collects/racket/gui/installer.rkt defined 1 exported 1
>> collects/racket/match/define-forms.rkt defined 1 exported 1
>> collects/racket/match/compiler.rkt defined 13 exported 1
>> collects/racket/match/struct.rkt defined 1 exported 1
>> collects/racket/match/runtime.rkt defined 11 exported 6
>> collects/racket/match/gen-match.rkt defined 3 exported 2
>> collects/racket/match/patterns.rkt defined 194 exported 163
>> collects/racket/match/reorder.rkt defined 11 exported 1
>> collects/racket/match/parse-legacy.rkt defined 1 exported 1
>> collects/racket/match/parse.rkt defined 2 exported 1
>> collects/racket/match/parse-helper.rkt defined 15 exported 11
>> collects/racket/match/parse-quasi.rkt defined 3 exported 1
>> collects/racket/match/legacy-match.rkt defined 11 exported 15
>> collects/racket/match/match-expander.rkt defined 1 exported 1
>> collects/racket/match/match.rkt defined 11 exported 16
>> collects/racket/match/split-rows.rkt defined 2 exported 1
>> collects/racket/system.rkt defined 0 exported 8
>> collects/racket/control.rkt defined 0 exported 24
>> collects/racket/package.rkt defined 10 exported 11
>> collects/racket/runtime-path.rkt defined 2 exported 7
>> collects/racket/tcp.rkt defined 1 exported 12
>> collects/racket/runtime-config.rkt defined 1 exported 1
>> collects/racket/init.rkt defined 0 exported 3206
>> collects/racket/serialize.rkt defined 5 exported 12
>> collects/racket/surrogate.rkt defined 1 exported 1
>> collects/racket/cmdline.rkt defined 5 exported 2
>> collects/racket/splicing.rkt defined 15 exported 11
>> collects/racket/provide-syntax.rkt defined 1 exported 1
>> collects/racket/require-transform.rkt defined 30 exported 22
>> collects/racket/load/lang/reader.rkt defined 6 exported 3
>> collects/racket/stream.rkt defined 19 exported 17
>> collects/racket/contract/regions.rkt defined 5 exported 3
>> collects/racket/contract/private/object.rkt defined 15 exported 6
>> collects/racket/contract/private/arrow.rkt defined 104 exported 17
>> collects/racket/contract/private/ds.rkt defined 45 exported 9
>> collects/racket/contract/private/guts.rkt defined 95 exported 69
>> collects/racket/contract/private/misc.rkt defined 121 exported 28
>> collects/racket/contract/private/provide.rkt defined 4 exported 2
>> collects/racket/contract/private/base.rkt defined 5 exported 3
>> collects/racket/contract/private/hash.rkt defined 22 exported 1
>> collects/racket/contract/private/vector.rkt defined 52 exported 4
>> collects/racket/contract/private/helpers.rkt defined 12 exported 9
>> collects/racket/contract/private/basic-opters.rkt defined 0 exported 0
>> collects/racket/contract/private/arr-i.rkt defined 26 exported 1
>> collects/racket/contract/private/opt-guts.rkt defined 40 exported 31
>> collects/racket/contract/private/legacy.rkt defined 22 exported 18
>> collects/racket/contract/private/arr-util.rkt defined 2 exported 2
>> collects/racket/contract/private/box.rkt defined 26 exported 2
>> collects/racket/contract/private/prop.rkt defined 72 exported 19
>> collects/racket/contract/private/opt.rkt defined 20 exported 6
>> collects/racket/contract/private/arr-i-old.rkt defined 22 exported 1
>> collects/racket/contract/private/arr-i-parse.rkt defined 45 exported 32
>> collects/racket/contract/private/blame.rkt defined 30 exported 18
>> collects/racket/contract/private/ds-helpers.rkt defined 18 exported 10
>> collects/racket/contract/base.rkt defined 0 exported 146
>> collects/racket/contract/exists.rkt defined 16 exported 3
>> collects/racket/draw/private/utils.rkt defined 3 exported 3
>> collects/racket/draw/private/bitmap-dc.rkt defined 3 exported 2
>> collects/racket/draw/private/bitmap.rkt defined 25 exported 5
>> collects/racket/draw/private/color.rkt defined 15 exported 7
>> collects/racket/draw/private/font-syms.rkt defined 3 exported 3
>> collects/racket/draw/private/record-dc.rkt defined 13 exported 3
>> collects/racket/draw/private/libs.rkt defined 1 exported 1
>> collects/racket/draw/private/fmod.rkt defined 1 exported 1
>> collects/racket/draw/private/brush.rkt defined 7 exported 4
>> collects/racket/draw/private/gl-context.rkt defined 11 exported 4
>> collects/racket/draw/private/lzw.rkt defined 3 exported 1
>> collects/racket/draw/private/point.rkt defined 4 exported 4
>> collects/racket/draw/private/local.rkt defined 50 exported 25
>> collects/racket/draw/private/post-script-dc.rkt defined 5 exported 1
>> collects/racket/draw/private/dc-path.rkt defined 10 exported 3
>> collects/racket/draw/private/ps-setup.rkt defined 12 exported 6
>> collects/racket/draw/private/gl-config.rkt defined 1 exported 1
>> collects/racket/draw/private/define.rkt defined 8 exported 4
>> collects/racket/draw/private/region.rkt defined 8 exported 4
>> collects/racket/draw/private/dc.rkt defined 20 exported 6
>> collects/racket/draw/private/font.rkt defined 16 exported 9
>> collects/racket/draw/private/syntax.rkt defined 54 exported 31
>> collects/racket/draw/private/dc-intf.rkt defined 1 exported 1
>> collects/racket/draw/private/hold.rkt defined 2 exported 1
>> collects/racket/draw/private/pen.rkt defined 10 exported 5
>> collects/racket/draw/private/font-dir.rkt defined 4 exported 3
>> collects/racket/draw/gif.rkt defined 46 exported 1
>> collects/racket/draw/bmp.rkt defined 9 exported 1
>> collects/racket/draw/xpm.rkt defined 4 exported 1
>> collects/racket/draw/unsafe/png.rkt defined 118 exported 57
>> collects/racket/draw/unsafe/jpeg.rkt defined 814 exported 29
>> collects/racket/draw/unsafe/bstr.rkt defined 1 exported 1
>> collects/racket/draw/unsafe/cairo.rkt defined 178 exported 146
>> collects/racket/draw/unsafe/pango.rkt defined 214 exported 138
>> collects/racket/draw/xbm.rkt defined 3 exported 1
>> collects/racket/provide.rkt defined 2 exported 2
>> collects/racket/async-channel.rkt defined 32 exported 6
>> collects/racket/unit.rkt defined 0 exported 37
>> collects/racket/private/kw.rkt defined 89 exported 14
>> collects/racket/private/old-if.rkt defined 1 exported 1
>> collects/racket/private/sandbox-coverage.rkt defined 26 exported 1
>> collects/racket/private/stxcase.rkt defined 8 exported 5
>> collects/racket/private/define-struct.rkt defined 8 exported 5
>> collects/racket/private/stxparamkey.rkt defined 15 exported 6
>> collects/racket/private/letstx-scheme.rkt defined 4 exported 20
>> collects/racket/private/stxcase-scheme.rkt defined 3 exported 13
>> collects/racket/private/serialize.rkt defined 30 exported 8
>> collects/racket/private/struct.rkt defined 1 exported 1
>> collects/racket/private/with-stx.rkt defined 5 exported 2
>> collects/racket/private/misc.rkt defined 18 exported 22
>> collects/racket/private/name.rkt defined 1 exported 1
>> collects/racket/private/sc.rkt defined 36 exported 10
>> collects/racket/private/norm-arity.rkt defined 4 exported 3
>> collects/racket/private/base.rkt defined 0 exported 1287
>> collects/racket/private/hash.rkt defined 5 exported 5
>> collects/racket/private/stxmz-body.rkt defined 2 exported 2
>> collects/racket/private/serialize-structs.rkt defined 17 exported 17
>> collects/racket/private/lang/reader.rkt defined 6 exported 3
>> collects/racket/private/stxloc.rkt defined 5 exported 6
>> collects/racket/private/more-scheme.rkt defined 46 exported 26
>> collects/racket/private/struct-info.rkt defined 11 exported 5
>> collects/racket/private/map.rkt defined 4 exported 4
>> collects/racket/private/local.rkt defined 0 exported 1
>> collects/racket/private/class-internal.rkt defined 319 exported 145
>> collects/racket/private/qq-and-or.rkt defined 7 exported 6
>> collects/racket/private/pre-base.rkt defined 6 exported 1226
>> collects/racket/private/namespace.rkt defined 11 exported 6
>> collects/racket/private/norm-define.rkt defined 1 exported 1
>> collects/racket/private/reqprov.rkt defined 25 exported 24
>> collects/racket/private/kernstruct.rkt defined 46 exported 46
>> collects/racket/private/old-ds.rkt defined 3 exported 3
>> collects/racket/private/define.rkt defined 4 exported 4
>> collects/racket/private/dict.rkt defined 96 exported 33
>> collects/racket/private/old-procs.rkt defined 9 exported 8
>> collects/racket/private/promise.rkt defined 35 exported 23
>> collects/racket/private/stx.rkt defined 19 exported 18
>> collects/racket/private/old-rp.rkt defined 7 exported 7
>> collects/racket/private/kw-file.rkt defined 11 exported 9
>> collects/racket/private/list.rkt defined 21 exported 17
>> collects/racket/private/ellipses.rkt defined 2 exported 2
>> collects/racket/private/vector-wraps.rkt defined 1 exported 1
>> collects/racket/private/sort.rkt defined 1 exported 1
>> collects/racket/private/class-events.rkt defined 15 exported 10
>> collects/racket/private/for.rkt defined 94 exported 57
>> collects/racket/private/cond.rkt defined 4 exported 4
>> collects/racket/private/define-et-al.rkt defined 6 exported 6
>> collects/racket/private/classidmap.rkt defined 37 exported 19
>> collects/racket/private/portlines.rkt defined 3 exported 3
>> collects/racket/private/stxparam.rkt defined 0 exported 1
>> collects/racket/private/small-scheme.rkt defined 0 exported 16
>> collects/racket/private/string.rkt defined 16 exported 10
>> collects/racket/private/modbeg.rkt defined 3 exported 1
>> collects/racket/private/qqstx.rkt defined 5 exported 4
>> collects/racket/unit/lang.rkt defined 3 exported 1319
>> collects/racket/unit/lang/reader.rkt defined 6 exported 3
>> collects/racket/base.rkt defined 0 exported 1287
>> collects/racket/mpair.rkt defined 23 exported 20
>> collects/racket/future.rkt defined 0 exported 5
>> collects/racket/trait.rkt defined 64 exported 9
>> collects/racket/fasl.rkt defined 2 exported 2
>> collects/racket/udp.rkt defined 1 exported 22
>> collects/racket/base/lang/reader.rkt defined 6 exported 3
>> collects/racket/function.rkt defined 5 exported 4
>> collects/racket/vector.rkt defined 26 exported 19
>> collects/racket/lang/reader.rkt defined 6 exported 3
>> collects/racket/generator.rkt defined 11 exported 7
>> collects/racket/date.rkt defined 0 exported 7
>> collects/racket/require-syntax.rkt defined 1 exported 1
>> collects/racket/fixnum.rkt defined 6 exported 34
>> collects/racket/flonum.rkt defined 6 exported 42
>> collects/racket/struct-info.rkt defined 0 exported 6
>> collects/racket/shared.rkt defined 0 exported 1
>> collects/racket/local.rkt defined 1 exported 1
>> collects/racket/enter.rkt defined 16 exported 1
>> collects/racket/pretty.rkt defined 85 exported 25
>> collects/racket/main.rkt defined 0 exported 3204
>> collects/racket/unsafe/ops.rkt defined 0 exported 88
>> collects/racket/port.rkt defined 17 exported 46
>> collects/racket/load.rkt defined 6 exported 2
>> collects/racket/require.rkt defined 4 exported 4
>> collects/racket/dict.rkt defined 106 exported 37
>> collects/racket/path.rkt defined 11 exported 9
>> collects/racket/language-info.rkt defined 1 exported 1
>> collects/racket/block.rkt defined 1 exported 1
>> collects/racket/promise.rkt defined 44 exported 11
>> collects/racket/list.rkt defined 39 exported 35
>> collects/racket/stxparam-exptime.rkt defined 2 exported 2
>> collects/racket/bool.rkt defined 6 exported 5
>> collects/racket/trace.rkt defined 33 exported 8
>> collects/racket/signature/lang.rkt defined 1 exported 2747
>> collects/racket/signature/lang/reader.rkt defined 6 exported 3
>> collects/racket/class.rkt defined 0 exported 118
>> collects/racket/contract.rkt defined 0 exported 151
>> collects/racket/gui.rkt defined 0 exported 3413
>> collects/racket/place.rkt defined 1 exported 10
>> collects/racket/provide-transform.rkt defined 22 exported 14
>> collects/racket/math.rkt defined 8 exported 8
>> collects/racket/stxparam.rkt defined 2 exported 4
>> collects/racket/string.rkt defined 2 exported 2
>> collects/racket/sandbox.rkt defined 95 exported 43
>> collects/racket/match.rkt defined 1 exported 16
>> collects/racket/unit-exptime.rkt defined 0 exported 2
>> collects/racket/help.rkt defined 10 exported 1
>> collects/racket/draw.rkt defined 0 exported 30



Posted on the dev mailing list.