{"id":18057386,"url":"https://github.com/1computer1/rpnlang","last_synced_at":"2025-07-14T15:33:02.002Z","repository":{"id":110793187,"uuid":"97533406","full_name":"1Computer1/rpnlang","owner":"1Computer1","description":"An esolang based on RPN","archived":false,"fork":false,"pushed_at":"2017-08-01T03:04:25.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-05T10:26:18.012Z","etag":null,"topics":["esoteric-language","rpn","stack-based"],"latest_commit_sha":null,"homepage":null,"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/1Computer1.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-07-18T00:11:36.000Z","updated_at":"2017-07-18T21:19:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"36811f3b-8e2d-4307-84b0-5a910cf1a230","html_url":"https://github.com/1Computer1/rpnlang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/1Computer1/rpnlang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frpnlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frpnlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frpnlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frpnlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1Computer1","download_url":"https://codeload.github.com/1Computer1/rpnlang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1Computer1%2Frpnlang/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265311988,"owners_count":23745176,"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":["esoteric-language","rpn","stack-based"],"created_at":"2024-10-31T02:07:35.155Z","updated_at":"2025-07-14T15:33:01.927Z","avatar_url":"https://github.com/1Computer1.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RPNLang\n\nA dynamically-typed, RPN-based, and stack-based esoteric language.  \n\n```\n\u003e 'Hello World!'; // Hello World!\n\u003e 1 1 + 2 2 + -; // -2\n\nx = 5;\n\u003c 1 2 3 $x [\u003e]; // [5, 3, 2, 1]\n\nadder = (a) =\u003e (\n    (b) =\u003e $a $b +\n);\n\n\u003e 3 5 $adder@@; // 8\n\nis_prime = (num) =\u003e (\n    $num $sqrt@ $floor@ 2 (sqnum, i) =\u003e ({\n        $num $i % 0 == : !?,\n        $i $sqnum \u003e= : $num 1 !=,\n        !! : $sqnum $i 1 + $@\n    })@\n);\n\n\u003e 1231 $is_prime@; // true\n```\n\n## Language\n\nSee the explanation for the language at the [documentations](./docs/README.md).  \nNote that it is not a guide but rather just the syntax and operators.  \n\n## API\n\nRPNLang is interpreted with JavaScript.  \nYou can require the module and run code:  \n\n```js\nconst RPNProgram = require('rpnlang');\n\nconst program = new RPNProgram('\u003e 1 1 +;');\nprogram.execute(); // 2\n```\n\nYou can also use `RPNProgram.makeModule` in order to make a module compatible with RPNLang.  \nTo call a lambda from RPNLang, use `RPNProgram.callLambda`.  \n\n```js\nconst RPNProgram = require('rpnlang');\nmodule.exports = RPNProgram.makeModule({\n    num: 5,\n    add: (a, b) =\u003e a + b,\n    map: (...args) =\u003e {\n        const mapper = args[0];\n        return args.slice(1).map(e =\u003e RPNProgram.callLambda(mapper, [e])[0]);\n    }\n});\n```\n\n```\nmath \u003c\u003c 'math.js';\n\u003e math::num 10 math::add@; // 15\n```\n\n#### `RPNProgram(source[, options])`\n\n- `source` - The source code.\n- `options.log` - Function for standard output.\n- `options.debug` - Debug mode, prints more errors.\n- `options.safe` - Disables file I/O and stdin.\n\n## CLI\n\nYou can also run a file via the CLI:  \n\n```\n$ rpn input_file.rpn\n```\n\n#### `Flags`\n\n- `-c [code]` - Runs code.\n- `-d` - Enables debug mode.\n- `-s` - Enables safe mode.\n\n## Other\n\nRPNLang is made purely for fun, don't take it too seriously!  \nCreated with [jison](http://zaa.ch/jison/).  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1computer1%2Frpnlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1computer1%2Frpnlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1computer1%2Frpnlang/lists"}