{"id":46653748,"url":"https://github.com/jordan-castro/pixelscript","last_synced_at":"2026-03-08T07:02:19.884Z","repository":{"id":331257781,"uuid":"1125930602","full_name":"jordan-castro/pixelscript","owner":"jordan-castro","description":"Multi language scripting runtime","archived":false,"fork":false,"pushed_at":"2026-03-03T04:30:02.000Z","size":1436,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-03T08:35:39.976Z","etag":null,"topics":["easyjs","javascript","lua","python"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordan-castro.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-31T17:05:00.000Z","updated_at":"2026-03-03T04:30:06.000Z","dependencies_parsed_at":"2026-03-08T07:01:32.865Z","dependency_job_id":null,"html_url":"https://github.com/jordan-castro/pixelscript","commit_stats":null,"previous_names":["jordan-castro/pixel_mods","jordan-castro/pixelscript"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jordan-castro/pixelscript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-castro%2Fpixelscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-castro%2Fpixelscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-castro%2Fpixelscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-castro%2Fpixelscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordan-castro","download_url":"https://codeload.github.com/jordan-castro/pixelscript/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordan-castro%2Fpixelscript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30248509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T05:41:50.788Z","status":"ssl_error","status_checked_at":"2026-03-08T05:41:39.075Z","response_time":56,"last_error":"SSL_read: 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":["easyjs","javascript","lua","python"],"created_at":"2026-03-08T07:01:10.710Z","updated_at":"2026-03-08T07:02:19.850Z","avatar_url":"https://github.com/jordan-castro.png","language":"Rust","readme":"# Pixel Script\n\nA multi language scripting runtime built in Rust.\n\nPixelScript lets you expose the same API to multiple different languages in your program. Because it compiles to a C library, you can use it anywhere. \n\n## Why PixelScript?\nBecause most games pick only one language for scripting. PixelScript gives modders and scripters a choice:\n\n- Performance? Go with Lua.\n- Data/science/prototyping? Choose Python.\n- Web developers? You got JavaScript.\n- Love easyjs? You got it!\n\nEach language runtime uses the same PixelScript bindings.\n\n## Version\npixelscript crate is currently at version 0.2.0.\n\n## How to use\nTo use Pixel Script, you will have to clone this repository.\nWhen compiling, if you only want a specific language you will have to set `--no-default-features` and `--features \"\u003clanguage1\u003e,\u003clanguage2\u003e\"`.\nIf you want to compile for all languages simply run the build script under `scripts/` It will compile the library and place the files under `/pxsb`.\n\nFor rust based use I will be adding a Rust wrapper, which is funny because this is written in Rust. But I want all systems that use the pixelscript library (rust included) to use the low level bindings. Which means I will write a High level and safe rust bindings. Until then, hack it using FFI.\n\n## Supported languages\n| Feature flag     | Language          | Engine                | Notes                           |\n|------------------|-------------------|-----------------------|---------------------------------|\n| `lua`            | Lua               | mlua                  | Fast, battle-tested, v5.4       |\n| `python`         | Python            | pocketpy              | Requires MSVC on Windows        |\n| `js`             | JavaScript        | rquickjs              | Quickjs, C library              |\n| `easyjs`         | EasyJS            | easyjsc               | Requires a JS feature           |\n| `php`            | PHP               | PH7                   | Only supports v5.3 and the engine is not maintained anymore |\n| `rustpython`     | Python (CPython compatible)    | rustpython              | Larger binary, Full Python library support, currently leaking memory.                  |\n\u003c!-- | `js-quick`       | JavaScript        | rquickjs              | QuickJS, more complete          | --\u003e\n\nWhen including `easyjs` make sure to also include a JavaScript feature otherwise it will not work.\n\n## CoreLib\nTo include the PixelScript core API, add the `include-core` feature.\n| Module name | Module purpose | Languages Type | Notes |\n|-------------|----------------|-------------------|-------|\n| `ps_json`   | Adds JSON encoding, decoding, and .* properties. | Lua(Tree), Python(object), JS(Prototype), easyjs(struct) | Requires a loader function. Set via `pxs_set_file_reader` and a writer function via `pxs_set_file_writer` |\n\n\u003c!-- ### Examples\n`ps_json` In lua\n```lua\nlocal json = require('ps_json')\nlocal data = json.load('path/to/json.json')\n\n-- Now you can read the data\nlocal name = data.name\n-- Assuming you have a print wrapper\nprint(name)\n-- Set data\ndata.name.set(\"Dude\")\n-- Set internal\ndata.fullname.last.set(\"New\")\nprint(data.fullname)\n```\nIn Python\n```python\nimport ps_json as json\ndata = json.load('path/to/json.json')\n\n# Read\nname = data.name\n# Or via dict\nname = data['name']\nprint(name)\n\ndata.name.set('Dude')\n# Or dict\ndata['name'] = 'Dude'\n# Internal\ndata.fullname.last.set('New')\nprint(data.fullname)\n```\nIn JS\n```js\nimport * as ps_json from \"ps_json\";\n\nlet data = ps_json.load('path/to/json.json');\n// Read\nlet name = data.name;\nprint(name);\n\ndata.name.set('Dude');\ndata['name'] = 'Dude'; // Also works in JS\n\ndata.fullname.last.set('New');\nprint(data.fullname);\n```\nIn easyjs\n```easyjs\nimport 'ps_json'\ndata = ps_json.load('path/to/json.json');\n\nprint(data.name)\nprint(data['name'])\n\ndata.name.set('Dude')\ndata.fullname.last.set('New')\nprint(data.fullname)\n```\n --\u003e\n## Building\nIn order to use pixelscript, you need to first compile it's libraries. Each language could potentially have it's own libraries.\nEach library will be fetched and placed under a pxsb folder in the main directory of your build system.\n\nTo build simply run:\n```bash\ncargo build --release\n```\nOn your rust crate. This will build the pixelscript library and make all language libs accessible.\n\n## Example\nHere is a \"Hello World\" example supporting Lua, Python, PHP, JavaScript, and easyjs.\n```c\n#include \"pixelscript.h\"\n// Optional macros (for C/C++ codespaces)\n#include \"pixelscript_m.h\"\n\n// One with the macro\nPXS_HANDLER(mprintln) {\n    pxs_VarT contents_var = PXS_ARG(1);\n    char* contents_str = pxs_getstring(contents_var);\n\n    printf(\"%s\", contents_str);\n\n    // Free the string\n    pxs_freestr(contents_str);\n}\n\n// One without the macro\npxs_VarT println(pxs_VarT args, pxs_Opaque opaque) {\n    // Get contents\n    pxs_VarT contents_var = pxs_listget(args, 1);\n    char* contents_str = pxs_getstring(contents_var);\n\n    printf(\"%s\", contents_str);\n\n    // Free the string\n    pxs_freestr(contents_str);\n}\n\nint main() {\n    pxs_initialize();\n    \n    // Create a module\n    pxs_Module* main = pxs_newmod(\"main\");\n\n    // Add callbacks\n    pxs_addfunc(main, \"mprintln\", mprintln, NULL);\n    pxs_addfunc(main, \"println\", println, NULL);\n\n    // Lua\n    const char* lua_script = \"local main = require('main')\\n\"\n        \"main.print('Hello World from Lua!')\";\n    char* error = pxs_execlua(lua_script, \"\u003cctest\u003e\");\n    pxs_freestr(error);\n\n    // Python\n    const char* python_script = \"import main\\n\"\n                                \"main.print('Hello World from Python')\\n\";\n\n    char* error = pxs_execpython(python_script, \"\u003cctest\u003e\");\n    pxs_freestr(error);\n\n    // JavaScript\n    const char* js_script = \"import * as main from 'main';\\n\"\n                            \"main.print('Hello World from JavaScript!');\";\n    char* error = pxs_execjs(js_script, \"\u003cctest\u003e\");\n    pxs_freestr(error);\n\n    // easyjs\n    const char* ej_script = \"import 'main'\\n\"\n                            \"main.print('Hello World from easyjs!')\";\n    char* error = pxs_execej(ej_script, \"\u003cctest\u003e\");\n    pxs_freestr(error);\n\n    // PHP!!!! \n    const char* php_script = \"include('main');\\n\" // or require\n                            \"\\\\main\\\\print('Hello World from PHP!');\";\n    char* error = pxs_execphp(php_script, \"\u003cctest\u003e\");\n    pxs_freestr(error);\n\n    pxs_finalize();\n\n    return 0;\n}\n```\n\n## Used in\n- Pixel Ai Dash\n- easyjs (runtime)\n\n## Future\nThis will ideally be used by all future epochtech games since it allows for modding in multiple languages. \nIt's not quite ready to be used in production for anyone other than myself and epochtech. But if you make PRs to fix\nsomething or open issues, I will be responding and merging. Feel free to add a language, just check out /lua or /python for examples on how to use Var, Func, Module, PixelObject, and PixelScripting.\n\nAlso RustPython and Luajit do not currently work.\n\nMade with ❤️ by [@epochtechgames](https://x.com/epochtechgames)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordan-castro%2Fpixelscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordan-castro%2Fpixelscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordan-castro%2Fpixelscript/lists"}