Sigil

From Esolang
Jump to navigation Jump to search
Sigil
Paradigm(s) imperative
Designed by TuxCrafting
Appeared in 2016
Memory system stack-based and queue-based
Dimensions one-dimensional
Computational class Turing complete
Major implementations Original
File extension(s) .sigil

Sigil is an esoteric programing language with only 5 meaningful characters: #$%().

Language overview

A sigil program can be described with the following EBNF syntax:

main = command;
command = number ('(' command ')')*;
number = /[#$%]*/;

The Sigil VM also have a stack and a queue.

Number system

The number system used by Sigil is a variant of base 3.

To convert a Sigil number to a decimal number:

  • Convert # to 0, $ to 1 and % to 2
  • Convert the number to decimal from base 3
  • Add 1 if the original number is not empty

Commands

- NOP
#(x)(y) ADD
$(x) NEGATE
%(x) PUSH
$# POP
$$(x) ENQUEUE
$% DEQUEUE
%#(c)(x)(y) IF
%$(c)(b) WHILE
%%(n) NUMBER
$##(c) PRINT CHARACTER
$#$ INPUT CHARACTER
$#%(n) PRINT NUMBER
$$# INPUT NUMBER
$$$(a)(b)...(c) CHAIN