PyFunge supports four distinct languages in the Funge family: Befunge-93, Unefunge-98, Befunge-98, Trefunge-98. All these languages operate in the Funge space (which is bounded to 25 rows and 80 columns in Befunge-93, or infinite in Funge-98) and the stack (which is extended to stack stacks in Funge-98).
PyFunge supports the full Befunge-93 language. It does not support Funge-98 commands in Befunge-93 mode at all, since it will make some legitimate Befunge-93 programs don’t work.
PyFunge 0.5.0 and later is fully (if not almost) compliant to Funge-98 specification. This section describes its undefined behaviors with respect to the specification, and precise behaviors of supported fingerprints.
In regarding Funge virtual machine:
In regarding Funge-98 commands:
In regarding system information command (y):
PyFunge supports many fingerprints enabled by default. The following is an exhaustive list of them.
Note that this is a description of PyFunge implementation, not the official specification. Unless the fingerprint is from PyFunge, do not consider this document is authoritative.
Notations for stack operation
This section uses a notation to describe how the command changes the stack. It looks like this:
- X : x1fp ... xnfp paths deltav startv n — xn ... x1
- Dumps the n values from Funge space starting at start with given delta. k-th popped value is multiplied by scale factor xk, and written to path as IEEE 754 double precision floating point format with unspecified endian. Reflects on failure. If succeed, it reverses the order of scale factors in the stack.
This fictional (and somewhat contrived) example shows the stack notation. The stack notation consists of “before” part and “after” part, each consists of the stack contents listed from the bottom to the top.
A superscript after the variable denotes the type. If there is no superscript, it is a single (scalar) cell. The type notation is as follows:
If the stack has a fewer cells than the command requires, it assumes the stack has infinite zeroes under the bottom unless specified. In the other words, the command pops the required cells (possibly implicit zeroes) and pushes the generated cells. Even if the “before” and “after” part contains the same number of cells, it can result in changes in the size of stack if the stack underflows.