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.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of compiler

compiler

Photo of fast bytecode vm

fast bytecode vm

Related news:

News photo

C++: "model of the hardware" vs. "model of the compiler" (2018)

News photo

Hardening mode for the compiler

News photo

SIMD Perlin Noise: Beating the Compiler with SSE (2014)