4 ms·
With a powerful type system (think Coq/Lean/...) you can declare the following (for example): forall s:Source, execute_machine_code(compile(s)) = interpret_sou
by deterministic 1y ago
With a powerful type system (think Coq/Lean/...) you can declare the following (for example):
forall s:Source, execute_machine_code(compile(s)) = interpret_source_code(s)
And the compiler will only accept your compiler code as being typed correctly if for all possible source code, running the compiled code gives the same result as interpreting the source code directly.
In other words, you are proving your compiler to be correct. Think about it as having an infinite number of test cases in a single line.
Now that's powerful!
- b_e_n_t_o_n 1y agoThis is way beyond my capacity for understanding ;)
- deterministic 1y agoHere is a good place to start: https://adam.math.hhu.de/#/g/leanprover-community/nng4 https://adam.math.hhu.de/#/g/leanprover-community/nng4