Add Dead Code Elimination (DCE) for stdlib
- Add dce.py: UsageAnalyzer that scans AST for used stdlib categories
- Modify stdlib.py: emit_stdlib() now accepts used_categories parameter
- Modify codegen.py: analyze programs before generating stdlib
Categories: core, object, http, fs, json, logger, string, array,
dict, regex, math, time, awk, exception, args, misc
Results:
- Simple "print(Hello)" program: 200+ lines -> 35 lines
- Complex programs: minimal change (use most categories anyway)
Showing
bootstrap/dce.py
0 → 100644
Please
register
or
sign in
to comment