• Roman Alifanov's avatar
    Add Dead Code Elimination (DCE) for stdlib · dde710fe
    Roman Alifanov authored
    - 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)
    dde710fe
stdlib.py 17.7 KB