Added /routine support
Added test for /routine
Updated date
A stack effect checker for the Uxntal programming language, written in Uxntal.
Type inference in Uxntal is done by checking the stack effect declarations of words before they can be run, against the cumulative stack state of each item in the definition of each word.
You must have the Uxn assembler and emulator.
uxnasm src/uxnbal.tal bin/uxnbal.rom
The following command will read a tal
file, validate routine definitions and raise warnings when the arity of the body is not equal to the arity of the definition.
uxncli bin/uxnbal.rom path/to/source.tal
Routines to validate use the -:
spacer as follows, each jump label must have its own definition:
@wcpy ( src* des* -: cap* )
STH2
&w ( src* `des* -: cap* )
LDAk STH2kr STA
INC2r INC2 LDAk #20 GTH ?&w
POP2
( cap ) #00 STH2kr STA
INC2r STH2r JMP2r
If do not wish to assemble it yourself, you can download uxnbal.rom.
0000 0000
||+--- Defined
|+---- Vector
+----- Unsafe