https://github.com/voidwyrm-2/zonk
A BrainF superset for the purpose of a compilation target
https://github.com/voidwyrm-2/zonk
brainfuck brainfuck-interpreter zig
Last synced: 5 days ago
JSON representation
A BrainF superset for the purpose of a compilation target
- Host: GitHub
- URL: https://github.com/voidwyrm-2/zonk
- Owner: voidwyrm-2
- License: apache-2.0
- Created: 2025-06-25T06:57:35.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-25T13:17:03.000Z (12 months ago)
- Last Synced: 2025-07-05T21:02:35.947Z (12 months ago)
- Topics: brainfuck, brainfuck-interpreter, zig
- Language: Zig
- Homepage:
- Size: 37.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Zonk
Zonk is a superset of [BrainF](https://en.wikipedia.org/wiki/Brainfuck), made to be an easier compilation target than vanilla BrainF.
## Operations
The original eight BrainF operations are:
Operation | Description
--------- | -----------
`>` | Incrememt the data pointer by one.
`<` | Decrement the data pointer by one.
`+` | Incrememt the current cell by one.
`-` | Decrement the current cell by one.
`.` | Print the value of the current cell as an ASCII character.
`,` | Ask for one byte of input and set the current cell to it.
`[` | If the current cell is zero, jump to the position after the corresponding `]`.
`]` | If the current cell is zero, jump to the position after the corresponding `]`.
Along with those, Zonk adds 7 extra operations:
Operation | Description
--------- | -----------
`_` | Copy the value of the current cell into the cell to the right.
`/` | Jump forward by the amount specified by the current cell.
`\` | Jump back by the amount specified by the current cell.
`{[path, excluding extension]}`, e.g. `{/libs/io}` | Loads a dynamic library.
`$[name]` | Switches to the context to the specified module.
`@[name]` | Looks up the specified function in the context then calls it.