{"id":19798638,"url":"https://github.com/eriknyquist/addlad","last_synced_at":"2026-06-09T06:31:22.832Z","repository":{"id":206356187,"uuid":"716441608","full_name":"eriknyquist/addlad","owner":"eriknyquist","description":"A single-instruction esoteric programming language, inspired by Chris Domas' \"MovFuscator\"","archived":false,"fork":false,"pushed_at":"2023-11-10T06:18:35.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:44:34.744Z","etag":null,"topics":["esolang","esoteric","esoteric-interpreter","esoteric-lang","esoteric-language","esoteric-languages","esoteric-programming-language","oisc","python","python-3","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eriknyquist.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-11-09T06:26:02.000Z","updated_at":"2024-03-20T17:47:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2728adf-abc1-483e-9147-6bd664eccefd","html_url":"https://github.com/eriknyquist/addlad","commit_stats":null,"previous_names":["eriknyquist/addlad"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eriknyquist/addlad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Faddlad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Faddlad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Faddlad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Faddlad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eriknyquist","download_url":"https://codeload.github.com/eriknyquist/addlad/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriknyquist%2Faddlad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34095242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","esoteric","esoteric-interpreter","esoteric-lang","esoteric-language","esoteric-languages","esoteric-programming-language","oisc","python","python-3","python3"],"created_at":"2024-11-12T07:30:56.587Z","updated_at":"2026-06-09T06:31:22.814Z","avatar_url":"https://github.com/eriknyquist.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. contents:: **Table of Contents**\n\nAddLad - an esoteric programming language\n-----------------------------------------\n\n``AddLad`` is an esoteric programming language that emulates a One-Instruction-Set-Computer\n(OISC) with transport-triggered I/O, inspired partially by `Brainf**k \u003chttps://en.wikipedia.org/wiki/Brainfuck\u003e`_\nand partially by Chris Domas' `movfuscator \u003chttps://github.com/xoreaxeaxeax/movfuscator\u003e`_.\n\n``AddLad`` programs operate on a \"memory tape\", a fixed-size array of 8-bit unsigned integers.\nThere is only a single operation available in ``AddLad``, which reads a value from one array\nindex (the source index), and adds it to the value stored in another array index (the destination\nindex). A single operation consists of an integer (the destination array index, where the\nresult will go), followed by a comma, followed by another integer (the source array index),\nand finally a semicolon:\n\n.. code::\n\n    6, 7;   # Read from array index 7, and add to value stored in index 6\n    6, 8;   # Read from array index 8, and add to value stored in index 6\n\nEnclosing an array index with square brackets ``[]`` will cause the value at that\narray index to be used as the array index (i.e. a pointer to another array index):\n\n.. code::\n\n    6, [7]; # Read from array index stored at array index 7, and add to value stored in index 6\n\nRegisters\n=========\n\nIn order to facilitate some of the features that programmers are accustomed to\n(specifically: input, output, modifying the instruction pointer, and non-zero values), 4\nspecific negative array indices (-1 through -4) are reserved for special purposes,\nand are referred to as \"registers\":\n\n* **array index -1: Output register** Using index -1 as the destination index will write\n  the value at the source index to stdout. **Using index -1 as the source index will add\n  1 to the value stored in the destination index. This is the only way you can change\n  any initial value in the array from 0 to 1, and most programs will start by adding array\n  index -1 to some other array index**.\n\n* **array index -2: Input register** Using index -2 as the source index will read\n  1 character from stdin, and then add the read value to the value stored at the destination\n  index. Using index -2 as the destination index will result in no change to the value at the\n  source index.\n\n* **array index -3: Instruction pointer increment register** Using index -3 as the\n  destination index will add the value at the source index to the current instruction\n  pointer value. If the value at the source index is zero, then the instruction pointer\n  will not be changed and execution will continue normally. Using index -3 as the source\n  index will result in no change to value at the destination index.\n\n* **array index -4: Instruction pointer decrement register** Using index -4 as the\n  destination index will subtract the value at the source index from the current\n  instruction pointer value. If the value at the source index is zero, then the\n  instruction pointer will not be changed and execution will continue normally. Using\n  index -4 as the source index will result in no change to the value at the destination index.\n\nNOTE: None of the registers can be used with pointer syntax (e.g. ``[-1]``), and this\nwill be a parsing failure.\n\nAdditional technical specifications\n===================================\n\n* All array values (including registers) are 8-bit unsigned integers, so values are\n  fixed between 0-255. Integer overflow/underflow will wrap around.\n\n* Using the same array index for the source and destination is allowed, and will\n  cause the value stored at the array index to be doubled.\n\n* Instruction pointer increments or decrements are allowed to overflow/underflow.\n  They will wrap around to the first/last instruction in this case.\n\n* Default array size is 100k elements\n\n* All whitespace is ignored. Single-line comments are available with the ``#`` character.\n\nInstall the interpreter\n-----------------------\n\nInstall with ``pip``:\n\n.. code::\n\n    pip install addlad\n\nUsing the interpreter\n---------------------\n\nTo run the AddLad interpreter, use the ``addlad`` command and pass your AddLad source\nfile as an argument:\n\n.. code::\n\n    addlad my_addlad_code.ps\n\nPractical examples\n------------------\n\nThis section contains some example AddLad programs, and showcases a couple of\ninteresting ways that standard programming constructs can be expressed with AddLad.\n\n\"Hello world\" in AddLad\n=======================\n\n.. code::\n\n    263,-1;     # Add 1 to index 263\n    263,263;    # Put '2' in index 263, for arithmetic later\n    264,263;\n    264,264;    # Put '4' in index 264, for arithmetic later\n    265,264;\n    265,265;    # Put '8' in index 265, for arithmetic later\n    25,265;     # Index 25, space character\n    25,25;\n    25,25;\n    20,25;      # Index 20, first character 'H'\n    20,20;\n    20,265;\n    30,20;      # Index 30,  last character 'd'\n    30,265;\n    30,265;\n    30,265;\n    30,264;\n    21,30;      # Index 21, 'e' character\n    21,-1;\n    22,21;      # Index 22, first 'l' character\n    22,264;\n    22,263;\n    22,-1;\n    23,22;      # Index 23, second 'l' character\n    29,23;      # Index 29, last 'l' character\n    24,29;      # Index 24, first 'o' character\n    24,263;\n    24,-1;\n    27,24;      # Index 27, last 'o' character\n    28,27;      # Index 28, 'r' character\n    28,263;\n    28,-1;\n    26,28;      # Index 26, 'w' character\n    26,264;\n    26,-1;\n    31,265;     # Index 31, newline character\n    31,263;\n    -1,20;      # Print 'H'\n    -1,21;      # Print 'e'\n    -1,22;      # Print 'l'\n    -1,23;      # Print 'l'\n    -1,24;      # Print 'o'\n    -1,25;      # Print ' '\n    -1,26;      # Print 'w'\n    -1,27;      # Print 'o'\n    -1,28;      # Print 'r'\n    -1,29;      # Print 'l'\n    -1,30;      # Print 'd'\n    -1,31;      # Print '\\n'\n\n\nHow do I write an \"if\" statement with AddLad?\n=============================================\n\nIt may seem like ``AddLad`` isn't capable of constructs like this:\n\n.. code:: c\n\n    if ((value \u003e= LOWER_BOUND) \u0026\u0026 (value \u003c= UPPER_BOUND))\n    {\n        // Some conditional code\n    }\n\nBut if we take some inspiration from Stephen Dolan's\n`\"mov is Turing-complete\" \u003chttps://drwho.virtadpt.net/files/mov.pdf\u003e`_ paper,\nand Chris Domas' `MovFuscator \u003chttps://github.com/xoreaxeaxeax/movfuscator\u003e`_ project, we\ncan do some interesting things.\n\nThis section shows how to create an ``AddLad`` program that reads 1 byte from\nstdin, and prints ``uppercase`` if the read byte is an ASCII uppercase letter,\nand prints ``lowercase`` otherwise. The full example program is available\n`in the Github repo \u003chttps://github.com/eriknyquist/addlad/blob/master/examples/condition.ps\u003e`_\n\n1. Change the values stored at array indices 65 through 90 (ASCII 'A' through 'Z') from 0 to 1:\n\n   .. code::\n\n        65,-1;\n        66,-1;\n        67,-1;\n        68,-1;\n        69,-1;\n        70,-1;\n        71,-1;\n        72,-1;\n        73,-1;\n        74,-1;\n        75,-1;\n        76,-1;\n        77,-1;\n        78,-1;\n        79,-1;\n        80,-1;\n        81,-1;\n        82,-1;\n        83,-1;\n        84,-1;\n        85,-1;\n        86,-1;\n        87,-1;\n        88,-1;\n        89,-1;\n        90,-1;\n\n   It's important that all other array indices in the 0-255 range remain at their\n   initial default value of 0. After this step, array indices 0-64 should hold a value of 0, array\n   indices 65-90 should hold a value of 1, and finally array indices 91-255 should hold\n   a value of 0. You'll see why in the following steps.\n\n2. Read 1 byte from stdin, into array index 260:\n\n   .. code::\n\n       260,-2;\n\n3. Interpret the byte read from stdin as an array index, and add the value\n   stored in that array index to the value stored in array index 261:\n\n   .. code::\n\n       261,[260];\n\n   After this step, if the value stored in array index 261 is 1, then we know that\n   the byte read from stdin is an uppercase letter, since it's within the range of\n   array indices that we set to a value of 1 in step #1.\n\n   If the value stord in array index 261 is 0, then we know that the byte read from\n   stdin is *not* an uppercase letter, since it's outside the range of array indices\n   that we set to a value of 1 in step #1, and those array indices will still be at\n   their default value of 0.\n\n4. You can now use the value of \"0\" or \"1\" obtained in step #3 to (for example) switch\n   between different array indices which contain different instruction pointer increment\n   values. This is how the ``examples/condition.ps`` program decides which characters to\n   print.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriknyquist%2Faddlad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feriknyquist%2Faddlad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriknyquist%2Faddlad/lists"}