https://github.com/lengthlang/length
Reference Implementation for Length
https://github.com/lengthlang/length
dart esolang interpreter length
Last synced: 5 months ago
JSON representation
Reference Implementation for Length
- Host: GitHub
- URL: https://github.com/lengthlang/length
- Owner: LengthLang
- License: gpl-3.0
- Created: 2021-01-03T03:31:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-22T21:42:19.000Z (about 5 years ago)
- Last Synced: 2025-10-23T02:51:53.050Z (7 months ago)
- Topics: dart, esolang, interpreter, length
- Language: Dart
- Homepage:
- Size: 42 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Length
[](https://discord.gg/st6SqenRnm) `irc.libera.chat #lengthlang`
A programming language based on line length
## Guide
| Line Length | Name | Description |
|-------------|---------|----------------------------------------------------------------------------------|
| 9 | `inp` | Pushes the ascii value of the first byte of stdin to the stack. |
| 10 | `add` | Adds the top two values on the stack and pushes the result onto the stack. |
| 11 | `sub` | Subtracts the top two values on the stack and pushes the result onto the stack. |
| 12 | `dup` | Duplicates the top value of the stack. |
| 13 | `cond` | If the top value of the stack is 0, skip the next instruction. Then pop it. |
| 14 | `gotou` | Sets the program counter to the value of the line under the instruction. |
| 15 | `outn` | Pops the top of the stack, and outputs it as a number. |
| 16 | `outa` | Pops the top of the stack, and outputs its ascii value. |
| 17 | `rol` | Rotates the stack to the left: `[ 7 6 5 ]` -> `[ 6 5 7 ]` |
| 18 | `swap` | Swaps the top two values of the stack: `[ 7 6 5 ]` -> `[ 6 7 5 ]` |
| 20 | `mul` | Multiplies the top two values on the stack and pushes the result onto the stack. |
| 21 | `div` | Divides the top two values on the stack and pushes the result onto the stack. |
| 23 | `pop` | Pops the top value of the stack |
| 24 | `gotos` | Sets the program counter to the value on top of the stack |
| 25 | `push` | Pushes the value of the line under it to the stack, and skips that line |
| 27 | `ror` | Rotates the stack to the right: `[ 7 6 5 ]` -> `[ 5 7 6 ]` |
Esolangs link: https://esolangs.org/wiki/Length (go here instead, its a bit more detailed)