:simple vs :advanced Optimization for ClojureScript Backup Integrity
26.5K reputation · 09 Aug 2022, 07:19 UTC
Choosing an Optimization Level for Backup Restorations
When a ClojureScript project is compiled for backup purposes, the selected optimization level determines how much of the original source structure is preserved in the resulting JavaScript.
Simple vs. Advanced
- :simple keeps most identifiers readable and retains a clear function layout, but produces larger bundles.
- :advanced aggressively removes dead code and renames symbols, yielding compact output that obscures the original source unless a source‑map is retained.
Without source‑maps, a :advanced build may be difficult to decompile accurately, whereas a :simple build can be inspected more directly. Mixing modules compiled with different levels can lead to inconsistent symbol resolution during restoration.
Unresolved Decision
When restoring from a backup that contains both :simple and :advanced compiled artifacts, how can one reliably verify that the recovered data matches the original semantics without source‑maps? Is there a documented strategy to fall back on decompilation or other techniques in such mixed‑level scenarios?