PushScript: A Subset-Of-Push Interpreter in JavaScript

The Push language in a web browser.

Download PushScript 0.9:

  • push.js: PushScript source code
  • README.txt: README file for the 0.9 release

    This is a demo of a subset-of-Push interpreter written in JavaScript. This allows Push programs to be executed in the client-side web browser when a user views a webpage.

    Most, but not all, standard Push instructions are implemented in PushScript. Currently implemented instructions:

    Float Integer Boolean Code Exec Name
  • FLOAT.+
  • FLOAT.-
  • FLOAT./
  • FLOAT.*
  • FLOAT.%
  • FLOAT.>
  • FLOAT.<
  • FLOAT.=
  • FLOAT.COS
  • FLOAT.DEFINE
  • FLOAT.DUP
  • FLOAT.FLUSH
  • FLOAT.FROMBOOLEAN
  • FLOAT.FROMINTEGER
  • FLOAT.MAX
  • FLOAT.MIN
  • FLOAT.POP
  • FLOAT.RAND
  • FLOAT.ROT
  • FLOAT.SHOVE
  • FLOAT.SIN
  • FLOAT.STACKDEPTH
  • FLOAT.SWAP
  • FLOAT.TAN
  • FLOAT.YANK
  • FLOAT.YANKDUP
  • float constants
  • INTEGER.+
  • INTEGER.-
  • INTEGER./
  • INTEGER.*
  • INTEGER.%
  • INTEGER.>
  • INTEGER.<
  • INTEGER.=
  • INTEGER.DEFINE
  • INTEGER.DUP
  • INTEGER.FLUSH
  • INTEGER.FROMBOOLEAN
  • INTEGER.FROMFLOAT
  • INTEGER.MAX
  • INTEGER.MIN
  • INTEGER.POP
  • INTEGER.RAND
  • INTEGER.ROT
  • INTEGER.SHOVE
  • INTEGER.STACKDEPTH
  • INTEGER.SWAP
  • INTEGER.YANK
  • INTEGER.YANKDUP
  • integer constants
  • BOOLEAN.=
  • BOOLEAN.AND
  • BOOLEAN.DEFINE
  • BOOLEAN.DUP
  • BOOLEAN.FLUSH
  • BOOLEAN.FROMFLOAT
  • BOOLEAN.FROMINTEGER
  • BOOLEAN.NOT
  • BOOLEAN.OR
  • BOOLEAN.POP
  • BOOLEAN.RAND
  • BOOLEAN.ROT
  • BOOLEAN.SHOVE
  • BOOLEAN.STACKDEPTH
  • BOOLEAN.SWAP
  • BOOLEAN.YANK
  • BOOLEAN.YANKDUP
  • boolean constants ("TRUE"/"FALSE")
  • CODE.=
  • CODE.ATOM
  • CODE.CAR
  • CODE.CDR
  • CODE.CONS
  • CODE.CONTAINS
  • CODE.DEFINE
  • CODE.DO
  • CODE.DO*
  • CODE.DO*COUNT
  • CODE.DO*RANGE
  • CODE.DO*TIMES
  • CODE.DUP
  • CODE.FLUSH
  • CODE.IF
  • CODE.LENGTH
  • CODE.LIST
  • CODE.NOOP
  • CODE.NTH
  • CODE.NULL
  • CODE.SHOVE
  • CODE.POP
  • CODE.QUOTE
  • CODE.ROT
  • CODE.SHOVE
  • CODE.STACKDEPTH
  • CODE.SWAP
  • CODE.YANK
  • CODE.YANKDUP
  • EXEC.=
  • EXEC.DEFINE
  • EXEC.DO*COUNT
  • EXEC.DO*RANGE
  • EXEC.DO*TIMES
  • EXEC.DUP
  • EXEC.FLUSH
  • EXEC.IF
  • EXEC.K
  • EXEC.POP
  • EXEC.ROT
  • EXEC.S
  • EXEC.SHOVE
  • EXEC.STACKDEPTH
  • EXEC.SWAP
  • EXEC.Y
  • EXEC.YANK
  • EXEC.YANKDUP
  • NAME.=
  • NAME.DUP
  • NAME.FLUSH
  • NAME.POP
  • NAME.RAND
  • NAME.ROT
  • NAME.SHOVE
  • NAME.STACKDEPTH
  • NAME.SWAP
  • NAME.YANK
  • NAME.YANKDUP
  • Type in a Push program below:

    We can dynamically load a Push program from a server, execute it in a web-browser and submit the results back to the server. Note that this does not require any actual user interaction and can be done continuously while a user views a webpage.

    PushScript written by jon klein.
    Push language designed by Lee Spector.