> Only AMP can be guaranteed safe to preload through static analysis
This isn't how static analysis works. Yes, the halting problem says you can't determine safety of any possible input in a Turing-complete language, and yes, JS is Turing-complete. But it doesn't say you can't determine safety of some inputs. You can write an algorithm that outputs "Yes," "No," and "I don't know" just fine. Google can, if they desire, specify some rules / annotations that would help its analyzer answer "Yes" to more pages. They've chosen not to do that, and instead to only build an analyzer for AMP.
Besides, preloading pages is about fetching content, not rendering them, I think.
> specify some rules / annotations that would help its analyzer answer "Yes" to more pages
Isn't that exactly what AMP is? Whatever "rules" Google specifies will in fact, define a DSL/subset of HTML that can efficiently answer "yes". As people demand more and more capability in this ruleset, eventually you'll end up with something like AMP, only the syntax will be slightly different, but the fact that it is a weird subset of HTML will remain.
In a way yes, but isn't one of the "rules" that is has to be cached/re-served from Googles servers as well? That is a rather problematic one, especially wrt antitrust issues...
AMP doesn't allow arbitrary JS. It only allows a fixed set of components. That's what makes it amenable to (trivial) static analysis -- just verify that the page contains only the elements allowed by AMP.
This isn't how static analysis works. Yes, the halting problem says you can't determine safety of any possible input in a Turing-complete language, and yes, JS is Turing-complete. But it doesn't say you can't determine safety of some inputs. You can write an algorithm that outputs "Yes," "No," and "I don't know" just fine. Google can, if they desire, specify some rules / annotations that would help its analyzer answer "Yes" to more pages. They've chosen not to do that, and instead to only build an analyzer for AMP.
Besides, preloading pages is about fetching content, not rendering them, I think.