HAVM is a Tree (HIR or LIR) programs interpreter. It was written by Robert Anisko so that EPITA students could exercise their compiler projects before the final jump to assembly code. It is implemented in Haskell, a pure non strict functional language very well suited for this kind of symbolic processing. HAVM was coined on both Haskell, and VM standing for Virtual Machine.

  • Required version is HAVM 0.28

  • HAVM Home Page

  • HAVM Documentation

  • Feedback can be sent to LRE’s Projects Address.

  • There are some known bugs that cause HAVM to execute incorrectly HIR programs. This happens when some jump break the recursive structure of the program, i.e., when a jump goes outside its enclosing structure (seq, or eseq etc.).

    Examples of Tiger sources onto which HAVM is likely to behave incorrectly include:

    while 1 do
      print_int((break; 1))


    if 0 | 0 then 0 else 1

    See HAVM Documentation for details, node “Known Problems”.

How to use HAVM:

To invoke havm run: havm OPTIONS FILE.

Where FILE is a simple text file, and OPTIONS is any combination of the following options:
  • -h, --help: Display a help message and exit successfully.

  • -V, --version: Display the version number and exit successfully.

  • -d, --display: Unparse the content of the FILE on the file descriptor FD, defaulting to 2 (standard error output).

  • -p [FD], :code:``--profile[=FD]`: Report simple profiling information on FD, defaulting to 2 (stderr).

  • -t [FD], --trace[=FD]: Display each instruction before execting it on FD, defaulting to 2 (stderr).

  • -l [FD], --low[=FD] Reject high level constructs.