Get the latest tech news
A Bytecode VM for Arithmetic: The Parser
We write a bytecode VM for arithmetic in Haskell.
The let expressions grammar is pretty standard, except we require one-or-more spaces after the let and in keywords to make them unambiguous. attoparsec works directly with bytestrings so we don’t incur the cost of decoding unicode characters. The helper parser expect is used to parse known string tokens ( let,= and in), and provide good error messages in case of failures.
Or read this on Hacker News