|Daniel Kolesa 8c873d9788 meson: update pkg-config descr||1 year ago|
|docs||3 years ago|
|include/cubescript||1 year ago|
|src||1 year ago|
|subprojects||1 year ago|
|tools||1 year ago|
|.gitignore||1 year ago|
|COPYING.md||3 years ago|
|README.md||1 year ago|
|meson.build||1 year ago|
|meson_options.txt||1 year ago|
Libcubescript is an embeddable implementation of the CubeScript scripting language. CubeScript is the console/config language of the Cube engines/games (and derived engines/games). It’s a simplistic language defined around the idea of everything being a string, with Lisp-like syntax (allowing various control structures to be defined as commands).
CubeScript is suitable for any use that calls for a simple scripting language that is easy to embed. It’s particularly strong at macro processing, so it can be used as a preprocessor, or for any string-heavy use. Since it has descended from a console language for a video game, it can still be used for that very purpose, as well as a configuration file language.
Its thread-friendliness allows for usage in any context that requires parallel processing and involvement of the scripting system in it.
As far as benefits over the original implementation go, while it is based on the original implementation, it’s largely rewritten; thus, it’s gained many advantages, including:
There are some features that are a work in progress and will come later:
The API is currently very unstable, as is the actual codebase. Therefore you should not use the project in production environments just yet, but you’re also free to experiment - feedback is welcome.
The project is also open for contributions. You can use pull requests on
GitHub and there is also a discussion channel
#octaforge on FreeNode; this
project is a part of the larger OctaForge umbrella.
Libcubescript supports integration with coroutines and threads by providing a concept of threads itself. You can create a thread (child state) using the main state and it will share global data with the main state, but it also has its own call stack.
The “global” state is thread safe, allowing concurrent access from multiple threads. The “local” state can be yielded as a part of the coroutine without affecting any other threads.
This functionality is not exposed into the language itself, but it can be utilized in the outside native code.
The only dependency is libostd:
If libostd can work on your system, so can libcubescript.
The supplied Makefile builds a static library on Unix-like OSes. Link this library together with your application and everything should just work. It also builds the REPL.
The project also bundles the linenoise line editing library which has been modified
to compile cleanly as C++ (with the same flags as libcubescript). It’s used strictly
for the REPL only (you don’t need it to build libcubescript itself). The version
in the repository tracks Git revision
See COPYING.md for licensing information.