This is a bit of a pet peeve for me, really. It seems like an unnecessary pithy dismissal of computation theory.
This is a bit of a pet peeve for me, really. It seems like an unnecessary pithy dismissal of computation theory.
Haskell compilers generally compile in the following way:
text -> tokens -> AST -> lambda calculus variant -> abstract functional machine code -> imperative IR -> machine code
the AST to lambda calculus variant step is a single step. It takes the Haskell representation of the lambda calculus and outputs lambda calculus.
Contrast this with an imperative compilation:
text -> tokens -> AST -> imperative IR -> machine code
The imperative IR may be LLVM IR. LLVM IR is almost a first order functional programming language, it is certainly not machine code for a turing machine. So imperative languages are not syntactic sugar of a turing machine, there is no desugaring step in the pipeline (except maybe when building the AST).
My point was that although there are functional languages that are syntactic sugar over the lambda calculus, I don't know of any imperative languages (and in fact it would not make sense to design an imperative language) that is syntactic sugar over turing machine code.
I should have made my position clearer. I do agree that compiling any non-pure functional language via lambda calculus is a fruitless endeavor.