Fastlane
No jumps and no loops. The instruction pointer has a speed, and the program changes how fast it goes.
TuxCrafting, 2019 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
TuxCrafting made Fastlane in 2019. After every instruction the pointer moves on by its speed, and it wraps around the end of the program. With speed 2 it reads every second character, with 0 it stays where it is, and below 0 it runs backwards. Running out of code ends nothing; only $ halts.
Read the story
There are 26 counters of any size, a to z, and one of them is selected at a time.
The machine
| Command | Does |
|---|---|
a to z | Select a counter |
> < | Raise or lower the speed by 1 |
+ - | Add or take 1 |
* | Skip the next instruction |
% @ | Skip the next instruction if the counter is 0, or if it is not |
! ? | Print the counter as a number and a line feed; read a number |
. , | Print the counter as a byte; read a byte, 0 at the end |
$ | Halt |
Every other character does nothing, and by custom it is #. The next instruction is the one the current speed lands on. The specification's interpreter is 79 lines of C with GNU MP for the counters.
Example
The truth machine reads a number and prints it.
The truth machine reads a number and prints it. On 0 the @ does not skip, and $ halts. On 1 it skips ahead, and the < at the end takes the speed to 0 and then to -1. The pointer then bounces between > and < and prints 1 each time it crosses !.
The adder reads into a and b and moves a into b one at a time. Each pass ends at %>, which takes the speed to 2. The pointer reads every second character, wraps past the end and lands on the < that slows it back to 1.
Hello world walks one counter up and down between the letters.
Patterns it teaches
- Counter machines: the specification turns any 25-counter Minsky machine into Fastlane, with
aholding the address and an accelerator that speeds up to the right instruction.
Further
See also
Also in Strange time
Write your own in Run Convert a program from Fastlane
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: fastlane.
Command line
shib run fastlane -e '?!@$*>!<' --input '0'shib manual fastlaneSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/fastlane.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org