Adrian Prantl
TU Vienna

ForthLog: A Prolog compiler and virtual machine written in Forth

This is another tiny project we did for a course, in this case stack-based languages. It's a compiler for a (very limited) subset of Prolog that generates WAM (Warren Abstract Machine) code, and Gergo's Forth implementation of the WAM.

We wrote it over the course of a couple of weeks and the resulting product is barely good enough to play with basic predicates such as append. But keep in mind, it was out first Forth program and for that it has some nice features, including scanner, parser, virtual machine (each instruction is a Forth word), and an interactive shell!

Source code

The program was tested with gforth.

    

top | HTML 4.01 | last update: 2014-06-07 (Adrian)