Iyingsihoktsiungtsk

From Esolang
Jump to navigation Jump to search

Iyingsihoktsiungtsk is a programming language designed by PSTF.

The name was directly writing yy8xhokDi3H(literally firefly) in "Latin" form.

Semantics

We use the 26 standard Latin letters and apostrophes (or numeric suffixes) as variable names.

Every program must strictly have one or more expressions. A program without any expressions (or commands) will automatically have a no-operation expression added after being compiled into a preliminarily processed program.

Control Flow Expressions

Conditional

expression ? label1 : label2

If the value of expression is not 0, jump to label1; otherwise, jump to label2. One of these two parameters can be nop, which means do nothing.

jump label

Jump to label without ANY conditions.

nop

No operation.

halt

Halt immediately.

Arithmetic

var_name += x

Add x to the value of var_name.

var_name -= x
var_name *= x
var_name /= x
var_name //= x
var_name \= x
var_name ^= x
var_name @= x

Minus, multiply, divide, integer-division, modulo, exponent, and assignment.

Any valid mathematical expression is a valid numeric constant (allowing the return of decimals and even irrational numbers).

Bitwise

var_name << x
var_name >> x

Multiply or divide var_name by 2x, respectively.

Logical and Comparison

exp1 > exp2

Greater than.

exp1 < exp2

Less than.

exp1 = exp2

Equal to.

exp1 <= exp2

Not greater than.

exp1 >= exp2

Not less than.

exp1 != exp2

Not equal to.

!exp

NOT. A single variable needs to be enclosed in parentheses to be an expression.

exp1 & exp2

AND. In the case where the first expression in two expressions is actually an isolated variable or a constant, the logical operation will become a bitwise operation.

exp1 | exp2

OR.

exp1 ` exp2

XOR.

Literals

"H"

Rune literal.

"""Hello, World!"""

String literal. Can't be directly assigned to a single variable.

[1, 2, 3]

Array literal.

114514.1919810

Number literal.

True/False

Boolean literal.

None

NULL literal.

(1st, 2nd)

Pair literal.

I/O

stdin

Standard input stream.

stdout

Standard output stream. These two 'variables' belong to ports. Among them, the standard output stream can only accept values, and the standard input stream can only be used for assignment (just like a constant).

stderr

Standard error stream.

stdlog

Standard debug log stream.

Examples

Numeric Machine

The data here ensures that the input values are natural numbers (0 and positive integers).

a @= stdin
(a) ? zero : other
#zero
stdout @= "0"
jump zero
#other
b @= a
stdout @= a
b -= 1
(b) ? other : ok
#ok
halt

Categories