Sigi

ewan April 10, 2026
Source

Sigi is an esoteric stack language where all syntax consists of symbols and punctuation. No alphanumeric keywords anywhere.

Character set: !@#$%^&()-+=[]{}|;:'",.<>/?~ plus digits 0-9

Installation

This installs the sigic compiler.

Usage

Symbol reference

Symbol Name Effect
!N PUSH Push number N (int or float)
@ DUP Duplicate top of stack
# SWAP Swap top two elements
$ DROP Discard top of stack
+ ADD Pop b, pop a → push a + b
- SUB Pop b, pop a → push a - b
` MUL Pop b, pop a → push a b
/ DIV Pop b, pop a → push a / b
% MOD Pop b, pop a → push fmod(a, b)
= EQ Pop b, pop a → push 1 if equal, else 0
< LT Pop b, pop a → push 1 if a < b
> GT Pop b, pop a → push 1 if a > b
~ NOT Pop a → push 1 if zero, else 0
PRINT
^ PRINTC Pop and print as character
? INPUT Read number from stdin
: STORE Pop address, pop value → store to var
LOAD Push value of variable n (digits 0-99)
[ body ] WHILE Loop while stack top is nonzero
{ then ; else } IF-ELSE Pop condition, execute then or else
{N body } FUNC Define function N (0-99)
(N) CALL Call function N
"text" STRING Print characters
'x CHAR Push character code
\ COMMENT Line comment (rest of line ignored)

Data model

  • All values are 64-bit IEEE 754 doubles
  • Stack depth: 1000 by default
  • 100 variables: vars[0]–vars[99]`

Examples

Hello World

Arithmetic

Stack operations

Variables

Functions

Control flow

While loops

Loop semantics: peek at stack top. If zero, exit. Otherwise execute body. Body must leave updated counter on stack.

Factorial

Project layout

Licence

AGPL 3.0

Discussion in the ATmosphere

Loading comments...