{"id":48592082,"url":"https://github.com/asllop/runpack","last_synced_at":"2026-04-08T20:02:34.794Z","repository":{"id":45687850,"uuid":"513870607","full_name":"asllop/RunPack","owner":"asllop","description":"Minimalistic, yet practical, scripting language","archived":false,"fork":false,"pushed_at":"2022-12-12T11:09:50.000Z","size":241,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-08-06T19:54:56.399Z","etag":null,"topics":["async-await","concatenative-language","embedded","interpreter","programming-language","rust","scripting"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/asllop.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2022-07-14T11:16:28.000Z","updated_at":"2023-03-23T16:12:08.000Z","dependencies_parsed_at":"2023-01-27T18:15:33.324Z","dependency_job_id":null,"html_url":"https://github.com/asllop/RunPack","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/asllop/RunPack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asllop%2FRunPack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asllop%2FRunPack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asllop%2FRunPack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asllop%2FRunPack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asllop","download_url":"https://codeload.github.com/asllop/RunPack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asllop%2FRunPack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["async-await","concatenative-language","embedded","interpreter","programming-language","rust","scripting"],"created_at":"2026-04-08T20:02:34.313Z","updated_at":"2026-04-08T20:02:34.780Z","avatar_url":"https://github.com/asllop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RunPack\n\n_Minimalistic, yet practical, scripting language_\n\n## Introduction\n\nRunPack is a small and modular scripting language written in ~1000 lines of Rust code, and designed to be embedded.\n\nIt is a [concatenative](https://en.wikipedia.org/wiki/Concatenative_programming_language), [stack-based](https://en.wikipedia.org/wiki/Stack-oriented_programming), [homoiconic](https://en.wikipedia.org/wiki/Homoiconicity), [async/await oriented](https://en.wikipedia.org/wiki/Async/await) programming language, strongly inspired by [Forth](https://en.wikipedia.org/wiki/Forth_(programming_language)), and to a lesser extent by [Factor](https://en.wikipedia.org/wiki/Factor_(programming_language)), [Racket](https://en.wikipedia.org/wiki/Racket_(programming_language)), and [Rust](https://en.wikipedia.org/wiki/Rust_(programming_language)).\n\nLanguage and implementation are designed to be extensible, providing a lightweight and powerful Rust API that allows to control any aspect of the language. Many features that in other languages are a core part of the compiler, like if/else/while statements, anonymous functions or variables, in RunPack are just words defined using the public API, or even RunPack itself.\n\nRunPack is what you are looking for, if you...\n\n1. Need a scripting language for your Rust application.\n2. Want it to be small, simple and modular.\n3. Require something fully customizable and hackable.\n4. Appreciate concatenative programming languages.\n\n## Installation\n\nAdd the following line to your Cargo dependencies:\n\n```\nrunpack = { git = \"https://github.com/asllop/RunPack\" }\n```\n\n## Usage\n\nTo run a simple script that adds two numbers:\n\n```rust\nuse runpack::{Pack, Cell};\n\nlet script = r#\"\n    \"Add two integers, leaving the result in the stack\"\n    10 20 +\n\"#;\n\n// Create the pack\nlet mut pack = Pack::new();\n// Append code\npack.code(script);\n// Run\npack.run().expect(\"Error running the script\");\n// Check results in the stack\nif let Some(Cell::Integer(i)) = pack.stack.pop() {\n    println!(\"Result = {}\", i);\n}\n```\n\nIt's easy to define a new word in Rust and then call it from a script in RunPack:\n\n```rust\nuse runpack::{self, Pack, Cell};\n\nlet script = r#\"\n    \"Put a string in the stack and then execute the 'hi' word\"\n    'Andreu' hi\n\"#;\n\nlet mut pack = Pack::new();\n// Define a word \"hi\" in Rust\npack.dictionary.native(\"hi\", hi_word);\npack.code(script);\npack.run().expect(\"Error running the script\");\n\nfn hi_word(pack: \u0026mut Pack) -\u003e Result\u003cbool, runpack::Error\u003e {\n    // Get a string from the stack and print it\n    if let Some(Cell::String(name)) = pack.stack.pop() {\n        println!(\"Hi {}!\", name);\n        Ok(true)\n    }\n    else {\n        Err(runpack::Error::new(\"Couldn't get a string\".into()))\n    }\n}\n```\n\nAnd it's also easy to define a word in RunPack and call it from Rust:\n\n```rust\nuse runpack::{self, Pack, Cell};\n\nlet script = r#\"\n    \"Define the word 'pi' that puts the number π in the stack\"\n    3.14159 def pi\n\"#;\n\nlet mut pack = Pack::new();\npack.code(script);\npack.run().expect(\"Error running the script\");\n// Execute word \"pi\"\npack.exec(\"pi\").expect(\"Failed executing 'pi'\");\n// Check the stack for results\nif let Some(Cell::Float(f)) = pack.stack.pop() {\n    println!(\"The number π is {}\", f);\n}\n```\n\n## Learn RunPack\n\nLearning is easy, you only need a couple of hours of your time and this introductory [tutorial](TUTORIAL.md). Additionally, we offer the [RunPack REPL](https://github.com/asllop/RunPack-REPL), a cli tool to facilitate the development of RunPack programs.\n\nEnjoy the trip!\n\n## Documentation\n\nThere are two sources of documentation, one is the standard Rust autodoc, generated with `cargo doc` as usual. The other is the vocabulary of RunPack words offered by a module, that comes in a [DOC.md](DOC.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasllop%2Frunpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasllop%2Frunpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasllop%2Frunpack/lists"}