{"id":16445873,"url":"https://github.com/sporeball/naz","last_synced_at":"2025-06-19T01:38:52.428Z","repository":{"id":38048459,"uuid":"227750876","full_name":"sporeball/naz","owner":"sporeball","description":"an esolang where every instruction is named by a number and a letter","archived":false,"fork":false,"pushed_at":"2024-06-16T13:40:35.000Z","size":362,"stargazers_count":22,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T23:35:04.352Z","etag":null,"topics":["esolang","programming-language"],"latest_commit_sha":null,"homepage":"https://sporeball.dev/naz","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sporeball.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":"sporeball","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-12-13T03:48:26.000Z","updated_at":"2024-04-11T21:49:59.000Z","dependencies_parsed_at":"2022-09-11T19:30:53.472Z","dependency_job_id":"7a15291f-2495-43a1-8e32-6f6868db6e75","html_url":"https://github.com/sporeball/naz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sporeball/naz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sporeball%2Fnaz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sporeball%2Fnaz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sporeball%2Fnaz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sporeball%2Fnaz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sporeball","download_url":"https://codeload.github.com/sporeball/naz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sporeball%2Fnaz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260665166,"owners_count":23044266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esolang","programming-language"],"created_at":"2024-10-11T09:45:40.235Z","updated_at":"2025-06-19T01:38:47.413Z","avatar_url":"https://github.com/sporeball.png","language":"JavaScript","funding_links":["https://patreon.com/sporeball"],"categories":[],"sub_categories":[],"readme":"# naz\n**naz** is an esolang where every instruction is named by a number and a letter.\n\n### usage\n\n#### node\nfirst, clone this repository, and install its dependencies:\n\n```\n$ npm install\n```\n\nyou can then run any naz program like so:\n\n```\n$ node naz.js filename.naz\n```\n\n#### online\nyou can also experiment with naz using the [web-based interpreter](https://sporeball.dev/naz)! this is usually given less priority than the original Node-based implementation, but should work if you're in a hurry!\n\n### instruction reference\n- `0-9` - number literal. exactly **one** of these **must** be placed before every instruction.\n- `a` - adds *n* to the register.\n- `d` - divides the register by *n*, rounding down.\n- `e` - conditional equal to. goto function *n* if the value in the register is *equal to* the value of the variable referenced before this instruction.\n- `f` - function instruction:\n  - opcode 0 - *calls* function *n*.\n  - opcode 1 - *declares* function *n*.\n- `g` - conditional greater than. goto function *n* if the value in the register is *greater than* the value of the variable referenced before this instruction.\n- `h` - halts program execution. **this is meant to be used for debugging purposes only.**\n- `l` - conditional less than. goto function *n* if the value in the register is *less than* the value of the variable referenced before this instruction.\n- `m` - multiplies the register by *n*.\n- `n` - negates variable *n*.\n- `o` - outputs a value determined by the value in the register:\n  - 0-9 - outputs that number.\n  - 10 - outputs a newline.\n  - 32-126 - outputs an ASCII value.\n- `p` - divides the register by *n*, then sets the register equal to the remainder.\n- `r` - sets the register equal to the ASCII value of the *n*-th character of the input string, then removes that character from the input string.\n- `s` - subtracts *n* from the register.\n- `v` - variable instruction:\n  - opcode 0 - sets the register equal to the value of variable *n*.\n  - opcode 2 - sets variable *n* equal to the value in the register.\n  - opcode 3 - variable *n* will be considered when executing the conditional instruction that follows.\n- `x` - sets the current opcode to *n*.\n\n### opcodes\n- `0` - normal operation. instructions will execute one at a time, in order.\n- `1` - function write. the interpreter **must** parse a call to the `f` instruction first; instructions will then be added onto the end of the referenced function until a newline is parsed or the opcode is explicitly set to 0.\n- `2` - variable write. the interpreter **must** parse a call to the `v` instruction; after this is executed, the interpreter will return to opcode 0.\n- `3` - conditional opcode. the interpreter **must** parse a call to the `v` instruction, followed by a call to a conditional instruction (`l`, `e` or `g`). afterwards, the interpreter will return to opcode 0.\n\n### command line flags\n- `-d` / `--delay` - sets the delay between execution steps (default: 1ms) (optional)\n- `-f` / `--file` - sets the file whose contents will be read by the `r` instruction. this takes precedence over the `-i` flag (default: none) (optional)\n- `-i` / `--input` - sets the string to use as input, to be read by the `r` instruction (default: none) (optional)\n- `-n` / `--null` - if present, a null byte (U+0000) will be appended to the input\n- `-u` / `--unlimited` - if present, the default limits on integer values will be removed\n\n#### notes\n- by default, the value in the register must always be between -127 and 127 (both inclusive), or program execution will **immediately halt**. this behavior can be disabled with the `-u` flag.\n- conditional instructions can only be run in opcode 3.\n- anything placed after a `#` on a line will be ignored, allowing you to comment your code.\n\n### example\nthe following naz program will add 9 to the register, multiply by 7, and add 2 (resulting in a value of 65), then output once, resulting in a final output of `A`:\n\n```\n9a7m2a1o\n```\n\nfor more complicated examples, check the [examples folder](https://github.com/sporeball/naz/tree/master/examples).\n\n### testing\nif you're making some changes and need to make sure everything's still working correctly, you can run tests on some of the example programs like so:\n\n```\n$ npm test\n```\n\n### computational class\nnaz is provably as powerful as a finite state automaton, because it can implement the esolang [dd](https://esolangs.org/wiki/Dd). given some input file, the example program [dd.naz](https://github.com/sporeball/naz/blob/master/examples/dd.naz) will follow the dd specification and stop reading input when it encounters a null byte.\n\nas posited by quintopia [here](https://esolangs.org/wiki/Naz#Computational_class), naz `-u` is capable of implementing a universal Turing machine with 5 states and 7 symbols, making it Turing-complete; this means the original language is equivalent to a [bounded-storage machine](https://esolangs.org/wiki/Bounded-storage_machine).\n\n### other implementations\na few people have created naz interpreters in languages other than JavaScript! these are:\n- [nazly](https://github.com/Lyxal/nazly), written in Python (by [Lyxal](https://github.com/Lyxal))\n- [cnaz](https://github.com/tobiasheineken/cnaz), written in C, using an unbounded integer type for naz `-u` (by [tobiasheineken](https://github.com/tobiasheineken))\n\n### thanks\nthe naz interpreter and runner are heavily based on those of the fantastic [\\\\/\\\\/\u003e](https://github.com/torcado194/worm), by [torcado](https://github.com/torcado194). \u003c3\n\nthe example program [prime.naz](https://github.com/sporeball/naz/blob/master/examples/prime.naz) was designed by [tobiasheineken](https://github.com/tobiasheineken).\n\n### donate\nyou can support the development of this project and others via Patreon:\n\n[![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dsporeball%26type%3Dpledges%26suffix%3D%252Fmonth\u0026style=for-the-badge)](https://patreon.com/sporeball)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsporeball%2Fnaz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsporeball%2Fnaz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsporeball%2Fnaz/lists"}