Stack Interpreter with OCaml

Job ID: 32102632

Budget: $30 – $250 USD

a file with a function, interpreter, with this type signature:
interpreter : string -> string * (string list)

in terms of functionality:
the function will take a program as an input string, and will return the topmost element of the final stack state and a list of strings of "traced" values. this list of strings will be referred as the log.

in terms of execution:
when the interpreter function successfully parses and executes the entirety of its input, report the string representation of the topmost value of its final stack. also report the log generated by the trace command.

in terms of errors:
when an error is encountered, the interpreter stops interpreting any remaining commands. return the following as the result of the interpreter function when these error occur:
("Error", [])
Related categories: Haskell Software Development Coding Programming