User:Taneb/Sacramento Wormhole

From Esolang
Jump to navigation Jump to search

Sacramento Wormhole is an upcoming esoteric programming language created by Nathan van Doorn and Daniel J. A. Bailey. To understand the language, first picture a wormhole in downtown Sacramento. This language is nothing like that.

Specification

A Sacramento Wormhole program consists of a list of instructions, most of which modify the source file as well as the interpreter's idea of the program.

Instructions

Command Effect
copy range number Copies lines in range to after line number.
append number number Appends the line at the first number with a copy of the line at the second number.
delete range Deletes the lines in range. Note that if this deletes lines before the current line, the current line is adjusted backwards accordingly, so the next instruction remains the one written after the delete, if it still exists.

Also if a line takes the form of an arithmetic expression, it is replaced with its evaluation.

Execution advances line by line sequentially and halts if the end of file is reached.

IO

Beyond modifying its source file, Sacramento Wormhole lacks any form of IO. However, by convention, the contents of the file at the end of execution is considered a program's output.