esolang

Printscript

A print command that skips one character after its name, whatever that character is.

A, 2019 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 8 known programs · Test method

Run it

Expected: Hello, world!

The idea

The esolangs.org user A made Printscript in 2019, after Lua. It can print strings, and from version 4 on it has one-character variables. It has no loops and no conditions.

Read the story

The parser does not look for a space after print. It skips exactly one character, so printf"hi" prints hi too. Before version 3 a string that never closed made the interpreter print spaces until there was no more space for code; version 3 prints an error instead.

The machine

CommandDoes
print "text"Print the text, line breaks included, up to the next quote
print xPrint the variable x
set x cSet x to the character c
sev x ySet x to the value of y

Inside a string \ makes the next character literal, so \" prints a quote and \n prints n. Anything between commands is passed over, so one print can follow the closing quote of the last.

Example

The last one skips the quote as the character after print, so no string starts at all.
Expected: print
Expected: 22
Expected: Unfinished string.

The last one skips the quote as the character after print, so no string starts at all.

Further

Ideas it shows

Also in Jokes

Write your own in Run Convert a program from Printscript

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run printscript -e 'print"'
shib manual printscript

Source

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

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

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