SECD machine interpreter in Python

I wrote a Python interpreter for the SECD abstract machine, following the presentation in Kogge’s book. The pydot library was convenient for visualising the graph in memory corresponding to data and code. For example this short program:

[LDC, [3, 4], LDF, [LD, [1, 2], LD, [1, 1], ADD, RTN], AP, WRITEI, STOP,]

looks like this (click for enlarged image):

Source code is available on github: https://github.com/carlohamalainen/pysecd

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s