{"id":24355542,"url":"https://github.com/amari-calipso/stacc","last_synced_at":"2025-07-24T14:10:01.609Z","repository":{"id":271799549,"uuid":"914605776","full_name":"amari-calipso/stacc","owner":"amari-calipso","description":"A parserless stack-based programming language made in a night for fun","archived":false,"fork":false,"pushed_at":"2025-02-05T22:16:46.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T07:32:52.337Z","etag":null,"topics":["esoteric-language","esoteric-programming-language","interpreter","programming-language","rust","stack-based-language","stack-machine"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/amari-calipso.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}},"created_at":"2025-01-09T23:37:51.000Z","updated_at":"2025-02-11T06:46:40.000Z","dependencies_parsed_at":"2025-01-10T00:32:03.345Z","dependency_job_id":"96b26675-cc71-41c8-b246-20e86d474ca0","html_url":"https://github.com/amari-calipso/stacc","commit_stats":null,"previous_names":["amari-calipso/stacc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amari-calipso/stacc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amari-calipso%2Fstacc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amari-calipso%2Fstacc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amari-calipso%2Fstacc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amari-calipso%2Fstacc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amari-calipso","download_url":"https://codeload.github.com/amari-calipso/stacc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amari-calipso%2Fstacc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266854489,"owners_count":23995485,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"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":["esoteric-language","esoteric-programming-language","interpreter","programming-language","rust","stack-based-language","stack-machine"],"created_at":"2025-01-18T17:57:46.767Z","updated_at":"2025-07-24T14:10:01.554Z","avatar_url":"https://github.com/amari-calipso.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stacc\nA parserless stack-based programming language made in a night for fun\n\n# Usage\nTo compile, use `cargo build --release`. To run directly, use `cargo run`.\n```\nstacc \u003cfilename\u003e\n```\n\n# How does it work?\nYou have two stacks available. The code is composed of objects, operations and labels. \nCode is read from left to right: if an object is encountered, it gets pushed on the primary stack, if an operation is encountered, it's performed.\n\nObjects are:\n- Integers;\n- Floats;\n- Strings (denoted with `\"`);\n- Code objects (code surrounded by `{` and `}`).\n\nLabels are denoted by surrounding their name with `[` and `]`, for example: `[myLabel]`.\n\nAvailable operations are:\n- `,`: pops the primary stack, and pushes the output on the secondary;\n- `;`: pops the secondary stack, and pushes the output on the primary;\n- `@`: pops the secondary stack, discarding the result;\n- `#`: swaps the primary and secondary stacks (the primary becomes secondary, and viceversa);\n- `.`: duplicates the last value on the primary stack (x = pop, push x, push x);\n- `$`: pops the primary stack, and prints the output;\n- `!`: pops the primary stack, if the popped value is truthy, pushes 0 on the primary stack, else 1;\n- `+`: pops the primary stack twice, the first pop corresponds to the second operand, and the second pop corresponds to the first operand. The two operands are added together and the result is pushed on the primary stack. The operation is different depending on the operands' types:\n    - `int + int` -\u003e int (arithmetic addition, wraps around on overflow);\n    - `int + float` -\u003e float (arithmetic addition);\n    - `float + int` -\u003e float (arithmetic addition);\n    - `float + float` -\u003e float (arithmetic addition);\n    - `string + string` -\u003e string (string concatenation);\n    - `int + string` or `float + string` -\u003e string (turns first operand to string, and concatenates it to second operand);\n    - `string + int` or `string + float` -\u003e string (concatenates the first operand to the second operand, turned into a string);\n    - `code + code` -\u003e code (concatenates the code as if it were executed in sequence. If labels collide, an error is thrown);\n    - Any other operation will throw an error.\n- `-`, `/`, `*` and `%`: pop the primary stack twice, the first pop corresponds to the second operand, and the second pop corresponds to the first operand. Perform subtraction, division, multiplication and modulo, respectively, pushing the output on the primary stack. The operation is different depending on the operands' types:\n    - `int + int` -\u003e int (subtraction, division and multiplication wrap around on overflow);\n    - `int + float` -\u003e float;\n    - `float + int` -\u003e float;\n    - `float + float` -\u003e float;\n    - Any other operation will throw an error.\n- `\u0026` and `|`: pop the primary stack twice, the first pop corresponds to the second operand, and the second pop corresponds to the first operand. Perform bitwise \"and\" and \"or\" operations respectively and push the result on the primary stack. They can only be applied to integers. Any other operation will throw an error;\n- `=`: pops the primary stack twice, obtaining two operands. Compares the operands, and if they're equal, pushes 1 on the primary stack, otherwise 0;\n- `\u003c` and `\u003e`: pop the primary stack twice, the first pop corresponds to the second operand, and the second pop corresponds to the first operand. Compare the operands, and if they're, respectively, first less than second, and first greater than second, push 1 on the primary stack, otherwise 0;\n- `^`: pops the stack and \"jumps\" to the token indicated by the result. This operation jumps in different ways depending on the type of the operand:\n    - int: jumps `n` tokens forward (or backwards, if the value is negative). Wraps around;\n    - float: jumps `floor(n)` tokens forward (or backwards, if the value is negative). Wraps around;\n    - string: jumps to a label with the name contained in the string. If the label doesn't exist, throws an error;\n    - code: executes the code.\n- `?`: pops the stack twice. The first pop corresponds to the location to jump to (this works the same way as the `^` operator), and the second pop corresponds to the condition. If the condition is truthy, the jump is performed, otherwise, it's not;\n- `:`: defines a function: pops the stack twice. The first pop corresponds to the function name, which has to be a string (if it's not, an error is thrown). The second pop corresponds to the code that will be executed when the function is called, which has t be a code object (if it's not, an error is thrown). Functions can be called by simply referencing their name without quotes in the code. Calling an undefined function will result in an error;\n- `~`: pops the primary stack, depending on the type of the popped value, it performs different operations:\n    - int -\u003e int: bitwise not;\n    - float -\u003e int: cast to int;\n    - string -\u003e code: parses the code contained in the string and returns a code object representing it.\n\n## Idioms\nIdioms are common sequences of operations that can be useful, some notable examples are:\n- `\"insert comment here\",@`: creates a comment;\n- `,0;-`: makes the last number on the stack negative (or positive, if it's already negative);\n- `~^`: \"eval\", parses the code in a string and executes it. This can also be used to parse integers and floats from strings;\n- `~^~`: if used on a string that contains a float, parses the float and casts it to an integer.\n\n## What values are truthy?\nStrings, code objects, nonzero integers and floats.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famari-calipso%2Fstacc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famari-calipso%2Fstacc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famari-calipso%2Fstacc/lists"}