esolang

!

Pronounced "not". True is !!, false is !, and every line starts with a symbol.

PersonMan, 2020 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 6 known programs · Test method

Run it

Expected: Hello, World!

The idea

PersonMan made ! in 2020. A program opens with !- and closes with -!. In between there are only two kinds of line. One declares a variable and one prints. Each value has a type, and the type is a symbol in front of the name. _ is a string, $ a number and ! a boolean. Booleans are not True and False but !! and !.

The machine

LineDoes
!- ... -!Start and end of the program
_name ? textDeclare a string
$name ? 5Declare a number
!name ? !!Declare a boolean, !! true and ! false
#_textPrint a string variable, or the text itself when there is none
#$name #!namePrint a number, or a boolean as 0 or 1
#$ $a + $bPrint a sum; #_ _a + _b puts strings together

/n in a string is a line feed, and nothing else ends a line. The specification gives these examples and no more, so the rest is the plainest reading of them. A declaration takes a value as written, numbers are whole, and a line that is not one of these is an error.

Example

A Hello World, and a string kept in a variable first.

A Hello World, and a string kept in a variable first.

Expected: Hello world!

Booleans print as 0 and 1. The specification puts a /n between them.

Expected: 0 1

Adding numbers looks as you would expect. Adding strings needs the space as a string of its own, the _ in the middle.

Expected: 7
Expected: hello world!

Patterns it teaches

  • Encoding tricks: a type is a single symbol, and a boolean is how many exclamation marks there are.

Further

Also in Jokes

Write your own in Run Convert a program from !

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run u21 -e '!-
#_hello world!
-!'
shib manual u21

Source

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

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

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