esolang

Sisi

Four statements and a line number on every line, somewhere between BASIC and assembly.

DLosc · Turing complete: yes · ●○○ easy

Tested with 5 known programs · Hello World on Try It Online: identical except the line end · Test method

Run it

Expected: Hello, World!

The idea

DLosc made Sisi as a small interpreter whose syntax takes after BASIC, and a little after assembly language. Every line starts with a number. There is one assignment, one print and two jumps, and an assignment holds at most one operator. Anything bigger is built from temporary variables and jumps.

The machine

StatementDoes
10 set x val / 10 set x a op bAssign a value, or one operation on two values
10 print valPrint it and a newline
10 jump nGo to line n
10 jumpif val nGo to line n unless val is 0 or ""

A value is a lowercase name, which is 0 until it is set, a run of digits, or a "string". The operators are + - * / < > =. Underneath they are Python's: 7 / 2 is 3.5, 1 < 2 is True, and + with a string joins both sides as text. There are no negative literals, so -1 is 0 - 1.

Line numbers must increase down the file. A jump to a number with no line goes on at the next line after it, and a jump past the end stops the program. The reference is sisi.py in the Sisi folder of github.com/dloscutoff/Esolangs.

Example

The second counts to 5 with a test stored in a variable, since jumpif takes one value.
Expected: 1 2 3 4 5 done
Expected: 3.5 3.51

The second counts to 5 with a test stored in a variable, since jumpif takes one value. The third shows the reference's typing. Dividing gives a float, and a float plus an integer is not two integers, so + joins them as text.

Patterns it teaches

Further

Also in Turing tarpits

Write your own in Run Convert a program from Sisi

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: sisi.

Command line

shib run sisi -e '10 print "Hello, World!"'
shib manual sisi

Source

Module
langs/tio/ports.js
Interpreter
langs/tio/sisi.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language