esolang

Bundle

Commands like a shell, one a line, and only two ways to change course. Skip the next line, or run the whole program again.

LankyBox02, 2022 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, world!

The idea

LankyBox02 made Bundle in 2022 for small programs such as cat programs and counters. Its website had a code sharing platform, and people still wrote FizzBuzz and 99 bottles of beer in it. It went through three versions before it was deleted on 6 July 2022. This entry covers the first.

Read the story

A program sits between a line start and a line end. Every line in between is a command, a space and its argument. There are no jumps and no blocks. if runs or skips the one line after it, and loop marks the program to run again from the top once it reaches end. Variables keep their values from one round to the next, and that is how a Bundle program counts.

The machine

CommandDoes
write text writebr text breakPrint text; text and a line break; a line break
throw xPrint the variable x
ask textPrint text and put a line of input in res
def x=v arr a=v,wSet a variable or an array
add a,b sub mul divArithmetic into res
charat hasdec getarr concat lengthText and arrays, into res
if a=b if a!=bRun the next line only if it holds
loop endloopRun the program again after end, or stop doing so
rasterizePut the source in res

An argument written {x} stands for the variable x. randomize, hash and the clock commands hour, minute, second and date are supported, with a fixed seed and a clock that reads midnight on the 1st, so every run replays.

Example

The cat prints its prompt too, since ask prints its argument.

The cat prints its prompt too, since ask prints its argument.

Expected: Input...hello

The quine asks for its own source with rasterize and prints it.

Expected: start rasterize throw res end

The FizzBuzz program sets its counters only in the first round, while looping is not yet yes. It ends in loop and has no endloop, so it never stops. It prints 1, 2, Fizz, 4, Buzz and on until the step limit runs out.

Patterns it teaches

  • Quine: with a command that hands over the source, a quine is two lines.

Further

Also in Turing tarpits

Write your own in Run Convert a program from Bundle

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run bundle -e 'start
write Hello, world!
end'
shib manual bundle

Source

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

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

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