{"id":15988629,"url":"https://github.com/croydon/cubescript","last_synced_at":"2025-09-17T10:56:47.978Z","repository":{"id":74744624,"uuid":"319157202","full_name":"Croydon/cubescript","owner":"Croydon","description":"A CubeScript implementation which can be embedded in other applications","archived":false,"fork":false,"pushed_at":"2020-12-12T06:22:05.000Z","size":1388,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-27T13:42:21.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Croydon.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":"2020-12-06T23:52:33.000Z","updated_at":"2024-01-02T11:14:36.000Z","dependencies_parsed_at":"2023-07-11T16:34:21.320Z","dependency_job_id":null,"html_url":"https://github.com/Croydon/cubescript","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Croydon/cubescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Croydon%2Fcubescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Croydon%2Fcubescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Croydon%2Fcubescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Croydon%2Fcubescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Croydon","download_url":"https://codeload.github.com/Croydon/cubescript/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Croydon%2Fcubescript/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275583377,"owners_count":25490651,"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-09-17T02:00:09.119Z","response_time":84,"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":[],"created_at":"2024-10-08T04:20:25.115Z","updated_at":"2025-09-17T10:56:47.484Z","avatar_url":"https://github.com/Croydon.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CubeScript\n\n![CubeScript REPL](https://ftp.octaforge.org/q66/random/libcs_repl.gif)\n\n\n## Overview\n\nCubeScript is an embeddable implementation of the CubeScript scripting\nlanguage. CubeScript is the console/config language of the Cube engines/games\n(and derived engines/games). It's a simplistic language defined around the\nidea of everything being a string, with Lisp-like syntax (allowing various\ncontrol structures to be defined as commands).\n\n\n## Benefits and use cases\n\nCubeScript is suitable for any use that calls for a simple scripting language\nthat is easy to embed. It's particularly strong at macro processing, so it can\nbe used as a preprocessor, or for any string-heavy use. Since it has descended\nfrom a console language for a video game, it can still be used for that very\npurpose, as well as a configuration file language.\n\nIts thread-friendliness allows for usage in any context that requires parallel\nprocessing and involvement of the scripting system in it.\n\nAs far as benefits over the original implementation go, while it is based on\nthe original implementation, it's largely rewritten; thus, it's gained many\nadvantages, including:\n\n* Independent implementation (can be embedded in any project)\n* No global state (multiple CubeScripts in a single program)\n* Modern C++17 API (no macros, use of strongly typed enums, lambdas, ranges etc.)\n* C++17 lambdas can be used as commands (including captures and type inference)\n* Error handling including recovery (protected call system similar to Lua)\n* Stricter parsing (strings cannot be left unfinished etc.)\n* Loop control statements (`break` and `continue`)\n* No manual memory mangement, values manage themselves\n* Clean codebase that is easy to read and contribute to\n* Support for arbitrary size integers and floats (can be set at compile time)\n* Allows building into a static or shared library, supports `-fvisibility=hidden`\n\nThere are some features that are a work in progress and will come later:\n\n* More helpful debug information (proper line infos at both parse and run time)\n* A degree of thread safety (see below)\n* Custom allocator support (control over how heap memory is allocated)\n* Coroutines\n\nThe API is currently very unstable, as is the actual codebase. Therefore you\nshould not use the project in production environments just yet, but you're\nalso free to experiment - feedback is welcome.\n\n**The project is also open for contributions.** You can use pull requests on\nGitHub and you can issues for suggestions and discussions.\n\n\n## Threads and coroutines\n\n*(In progress)*\n\nCubeScript supports integration with coroutines and threads by providing a\nconcept of threads itself. You can create a thread (child state) using the\nmain state and it will share global data with the main state, but it also\nhas its own call stack.\n\nThe \"global\" state is thread safe, allowing concurrent access from multiple\nthreads. The \"local\" state can be yielded as a part of the coroutine without\naffecting any other threads.\n\nThis functionality is not exposed into the language itself, but it can be\nutilized in the outside native code.\n\n\n## Build requirements\n  * a compiler with C++20 support\n  * Python \u003e= 3.6\n  * Conan \u003e= 1.29.2\n  * CMake \u003e= 3.15\n  * Meson \u003e= 0.46\n\n\n## Building and usage\n\nYou have to build it in a subdirectory, hence a typical build should look like this:\n\n~~~\nmkdir build \u0026\u0026 cd build\ncmake ..\ncmake --build .\n~~~\n\nLink the CubeScript library together with your application and everything should\nwork.\nIt also builds the REPL.\n\nThe project also bundles the linenoise line editing library which has been modified\nto compile cleanly as C++ (with the same flags as CubeScript). It's used strictly\nfor the REPL only (you don't need it to build CubeScript itself). The version\nin the repository tracks Git revision https://github.com/antirez/linenoise/commit/c894b9e59f02203dbe4e2be657572cf88c4230c3.\n\n\n## Licensing\n\nThis is a fork of [libcubescript](https://github.com/OctaForge/libcubescript)\n(which relied on [libostd](https://github.com/OctaForge/libostd)).\nLibcubescript is a fork of [Cube 2: Sauerbraten](http://sauerbraten.org).\n\nCubeScript and Libcubescript is provided to you under the terms of the zlib license, just\nlike the source it was originally derived from.\n\nThe software is originally based on the CubeScript implementation in the Cube 2\ngame/engine, which by now serves mostly as an inspiration, as the code has been\nlargely rewritten (though isolated bits of the original source may remain).\n\nFor copyright holders beyond just CubeScript, please refer to Cube 2's original\nlicense file.\n\nSee the LICENSE file for licensing information.\n\n\n### Licensing exception\n\nCubeScript bundles the linenoise line editing library for REPL usage.\nThis library is available under the BSD 2-clause license, which is available\nwithin its source code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcroydon%2Fcubescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcroydon%2Fcubescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcroydon%2Fcubescript/lists"}