I originally designed Creole Forth as a Delphi component that can be dropped onto a form. Later on I created a version of it to Excel where it exists as a couple of spreadsheets combined with some VBA modules, classes, and forms. Can it be rebuilt in JavaScript? Click on the link to see my first attempt at it. So far, it’s just a bunch of primitives in a single JavaScript file with an outer and inner interpreter that can look them up and execute them.

Some words implemented:

  1. HELLO - pops up a message box saying "Hello World".
  2. + : Adds two numbers on the stack. Make sure they're on there first.
  3. -, *, /, % : other arithmetic operations.
  4. DUP - duplicates a stack argument.
  5. SWAP - swaps the top two stack args.
  6. ROT - moves the third stack arg to the top.
  7. -ROT - moves the top stack arg to the third position.
  8. Over 20 others so far.

Stay tuned. Based on my previous experience, about 70 primitives along with the colon interpreter and compiler is enough for a decent application base.