Get the latest tech news
A Fast Bytecode VM for Arithmetic: The Compiler
We write a fast bytecode VM for arithmetic in Haskell.
In a stack-based VM, all values created during the execution of a program are stored only in a Stack data-structure residing in the memory. Recall that in the previous post, we wrote our parser such that the bytecode size for each AST node was calculated while parsing it. Finally, I also tried converting the go function to be tail-recursive by using Continuation-passing style(CPS), and then defunctionalizing the continuations, as well as, using the ContT monad transformer.
Or read this on Hacker News