A pure symbolic stack language that compiles to C.
Character set: !@#$%^&*()-+=[]{}|;:'",.<>/?\~ plus digits 0-9
All syntax is symbolic. No alphanumeric keywords.
pip install -e .This installs the sigic compiler.
# Compile to C
sigic hello.si -o hello.c
# Compile and run immediately
sigic hello.si --run
# Debug: show tokens
sigic hello.si --emit-tokens
# Debug: show AST
sigic hello.si --emit-ast| 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 |
| ` | ` | |
^ |
PRINTC | Pop and print as character |
? |
INPUT | Read number from stdin |
: |
STORE | Pop address, pop value → store to var |
<n> |
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 |
"Hello, World!\n"
!3 !4 + | \ prints 7
!10 !3 - | \ prints 7
!4 !5 * | \ prints 20
!5 @ + | \ 10 (DUP + ADD)
!1 !2 # | | \ 2 1 (SWAP)
!42 !0 : \ store 42 in var 0
0 | \ print 42
{0 "Hi\n"} \ define fn 0
{1 !42 |} \ define fn 1
(0) \ call fn 0
(1) \ call fn 1
!1 { "yes" ; "no" } \ prints "yes"
!0 { "yes" ; "no" } \ prints "no"
!5 [ @ | !1 - ] $ \ prints 5 4 3 2 1
Sigi is deliberately minimal. Every operation is a single character. There are no reserved words—only punctuation.
The language is stack-based with postfix notation, making parsing trivial.
Inspired by Forth, Joy, and other concatenative languages.