{"id":19904863,"url":"https://github.com/lfalch/stalch","last_synced_at":"2026-05-09T22:16:25.861Z","repository":{"id":114829007,"uuid":"100825680","full_name":"LFalch/stalch","owner":"LFalch","description":"Stack oriented half-eso-lang","archived":false,"fork":false,"pushed_at":"2022-12-28T18:57:55.000Z","size":63,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T21:40:23.213Z","etag":null,"topics":["esolang","esoteric-language","language","stack-based"],"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/LFalch.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":"2017-08-19T22:53:01.000Z","updated_at":"2023-06-23T21:34:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"d85673f0-db9d-4865-b2df-125ffa1a78d4","html_url":"https://github.com/LFalch/stalch","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LFalch%2Fstalch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LFalch%2Fstalch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LFalch%2Fstalch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LFalch%2Fstalch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LFalch","download_url":"https://codeload.github.com/LFalch/stalch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241333622,"owners_count":19945824,"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","esoteric-language","language","stack-based"],"created_at":"2024-11-12T20:29:57.828Z","updated_at":"2025-11-26T01:04:50.298Z","avatar_url":"https://github.com/LFalch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stalch\nA stack-based esolang\n\n## Interpreter\n\nThe interpreter goes through each command, separated by whitespace, and runs the\ncommand. The command can be a value or an internal command. If it's a value, it\nwill be interpreted and pushed to the stack. Otherwise the command will run.\n\n## Variables\n\nStalch is dynamically typed, although a value still has an internal type:\n\nWhen the interpreter encounters a literal, it is parsed and pushed to the stack.\n\n * String\n\n    Anything inside quotation marks (\"\") will be treated as a string.\n    There is no escaping yet, everything between quotation marks will\n    be considered part of the string.\n * Bool\n\n    A boolean value `true` or `false`. Used for `if` and is the result of some\n    other operations like comparison operators.\n * Integer\n\n    A 64-bit signed integer value.\n * Float\n\n    A 64-bit floating point value. If a number can't be parsed as integer, it will try as float.\n * Block\n\n    A mixture between an anonymous function and an array/list. They are created with the by\n    putting code between the `{` and `}` operators. These are also pushed to\n    the stack. It can be run using the `apply` command (alias: `()`).\n * Null\n\n    This type is rarely used. It usually represents an error.\n * Variable name\n\n    Used to assign a value to a name. When called they either push what their\n    name is assigned to, or push a variable handle. This handle can be used to\n    assign a value to a name with the `def` command (alias: `:=`)\n    ##### Example\n        47 foo :=\n\n## Basic commands\n\nAlmost every command works with what's currently at the top of the stack.\nThe syntax is postfix and may therefore be unfamiliar.\n\nGo to [COMMANDS.md](./COMMANDS.md) to see a list of all commands and what they do.\n\n### Mathematical operators\n\nThe basic mathematical operators are `add`, `sub`, `mul`, `div`, `pow`, `rem` which\neach have the following respective symbolic aliases: `+`, `-`, `*`, `**`, `/`, `%`.\n\n#### Example\n\n`4 4 +`. This will end up with an `8` in the stack.\nLet's go through this step by step:\n\nFirst the interpreter will read the first `4` and then add that to the stack.\nThe stack now looks like this:\n\n`4`\n\nThe next `4` will then also be added to the top of the stack:\n\n`4 4`\n\nLastly, the add command is run, this pops the two numbers off the stack,\nadds them together and pushes the result. The resulting stack thus looks like:\n\n`8`\n\n**NOTE**: If you try and run a command without enough values on the stack.\nThe program will fail and exit. E.g. if you tried to write `4 + 4`, the interpreter\nwould try to add the two numbers on the stack together, but since it has only\ngotten the first `4` at that point, it will fail.\nRemember to put the operation last.\n\n### IO\n\nStalch has three commands to pass stuff through STDIN and STDOUT:\n\n#### `prnt` (`_`)\n\nThis prints pops the stack and prints the value to STDOUT along with a newline.\n\n#### `wrte` (`-\u003e`)\n\nDoes the same as `prnt`, but doesn't add a newline. Think of the arrow as pointing outwards.\n\n#### `read` (`\u003c-`)\n\nThis reads a line from `STDIN` and pushes it to the stack as a string. Think of the arrow as points inwards.\n(NOTE: The string will be right trimmed).\n\n### Stack manipulation\n\n#### `swap`, `$`\n\nThis command switches the two top values in the stack. E.g. imagine a stack as follows:\n\n`A B C D`\n\nRunning `swap` would make it look as this:\n\n`A B D C`\n\n#### `drop`, `~`\n\nPops the stack and simply throws away the value.\n\n#### `dup`, `d`\n\nPushes a copy of the current top value to the stack.\n\n#### `grab`, `#`\n\nPops a value, `n`, from the stack, this value is assumed to be an integer.\nIt then goes `n` elements back in the stack and moves that value to the top.\n\nE.g. doing `1 grab` would be equivalent to doing a `swap`.\n\n#### `dupgrab`, `:`\n\nDoes the same as `grab` except instead of moving the value, it makes a copy of\nand puts that on top. The original value will stay in its place.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfalch%2Fstalch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfalch%2Fstalch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfalch%2Fstalch/lists"}