4 ms·
I would like to bring up some counter-examples: - 1. Generators that can allocate prevent comptime-overapproximation of potential stack usage (https://github.c
by matu3ba 5y ago
I would like to bring up some counter-examples:
- 1. Generators that can allocate prevent comptime-overapproximation of potential stack usage (https://github.com/ziglang/zig/issues/157#issuecomment-763952294 https://github.com/ziglang/zig/issues/157#issuecomment-76395...) or make analysis inside the compiler significant harder.
- 2. There is no reason why static analysis must be part of the compiler, though
its still an open research problem how to present lifetimes properly to the user
(https://github.com/ziglang/zig/issues/782#issuecomment-1014955593 https://github.com/ziglang/zig/issues/782#issuecomment-10149...)
- 3. Requiring static analysis to be inside the compiler pushes back on external static analysis. While this may be overall good to force upstreaming work and prevents monetarian incentive of introducing bugs as optimizations detectable by tool xyz, it reduces modularization incentive and extensibility for experimentation.
- 4. Trying to encompass everything in static analysis has the same problem as the all-encompassing logic: Soundness can not be proven and the proof for soundness becomes more and more problematic the more rules one adds (slow and hard to reason which rule has been applied).
And this does not even account human errors or the fact that a PL does not accurately implement the logic.
- 5. The biggest problem of complicated languages is that they have no process to define what underlying logic (see point 4) the compiler should follow and "what is too complex". Somehow folks also forget about Gödels incompleteness theorem (you cant reason on everything in the compiler).