esolang

Asig

Variables, sums, input and a test, all spelled in punctuation.

Adam, 2014 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: 2

The idea

Adam made Asig on March 30, 2014, after basic Java operations. Every command is written with symbols. It starts with ~, sits in braces, and says what it does with one more symbol. A number variable is %Joe, a string variable is @greeting, and adding 2 to Joe is ~{&:%Joe#+2}.

Read the story

There are no loops and no jumps. A program runs each command at most once, so every program stops. The only branch is a test that runs the commands after it when it holds.

The machine

CommandDoes
~{%name}Make a number variable of 0
~{@name[text]}Make a string variable
~{&:%name#+2}Add to a number variable; also -, * and /, by a number or a % variable
~{|%name} ~{|@name}Print a variable
~{^(#)%name} ~{^(@)@name}Read a number or a line of text
~{^:%name > 0 \ ~{...} \ ~{...}}Run the commands after each \ when the test holds; also = and <

Strings compare case-sensitively and numbers by value. A print adds no line break. White space may stand between the parts of a command.

Example

The sign check prints its prompt as %promptText, a name it made with @.
Expected: Hello, World!
Expected: Hello

The sign check prints its prompt as %promptText, a name it made with @. This implementation takes a variable by its name whatever its mark, so the check runs.

Expected: Please input a number: Your input number was negative.

Further

Ideas it shows

Also in Hostile

Write your own in Run Convert a program from Asig

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run asig -e '~{%Joe}
~{&:%Joe#+2}
~{|%Joe}'
shib manual asig

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/asig.js

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

Source esolangs.org (CC0) · Edit on esolangs.org