🦡

Possum

a tiny stack-based critter language — forage, climb, hiss

program.possum Ctrl+Enter to run
Output

          
Field Guide — the Possum vocabulary

Programs are words separated by whitespace. Numbers are pushed onto a stack; words pull values off it and push results back. # starts a comment.

Stack

  • climb — duplicate the top value
  • scram — drop the top value
  • waddle — swap the top two
  • peek — copy the 2nd value to the top
  • tumble — rotate the top three

Maths & logic

  • + - * / % — arithmetic on the top two
  • < > = <= >= != — compare, push 1 (true) or 0 (false)
  • and or not — logic (nonzero is true)

Pouches (variables)

  • pouch name — pop the top, stash it in name
  • grab name — push the value stashed in name

Noises (output)

  • hiss — pop and print as a number
  • screech — pop and print as an ASCII character
  • say "text" — print a literal string

Control flow

  • if … end / if … else … end — pops a condition
  • times … end — pop N, repeat the body N times; count is the 0-based index
  • while … do … end — repeat while the condition block leaves a nonzero value