CompC

Update of "WHY?"
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: f9600afac213500382d17ae0e0df4aba1abfc822
Page Name:WHY?
Date: 2015-04-24 22:52:58
Original User: tehologist
Parent: 359f55781adbcc883bcf1e8b7863d59a0a77e9a1 (diff)
Content

WHY?!?

I have always been interested in forth. I was at a SVFIG group meet up at Stanford. Dr. Ting was handing out copies of his excellently written document entitled "eForth and Zen". I was intrigued, the virtual machine seemed simple enough. Most of the code for the entire system was written in forth. This got me thinking, what would be required to write a program that could implement enough of a subset of eforth to generate an image that was self hosting on a virtual machine. I gave myself a few constraints, minimal function calls, use as little of c as possible and treating c as portable assembler. The result fits in under 500 lines of C. It can read in an eforth source file and generate an image that can run on a very simple VM with 21 opcodes.