libcubescript/README.md

48 lines
2.2 KiB
Markdown
Raw Normal View History

2015-07-31 20:53:29 +02:00
# libcubescript
2016-08-27 20:26:52 +02:00
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).
2015-07-31 20:53:29 +02:00
2016-08-27 20:26:52 +02:00
Libcubescript is originally based on the implementation from the Cube 2 engine,
but it's largely rewritten. Here are some of the benefits over the original
implementation:
2015-08-08 18:24:05 +02:00
2016-09-10 17:13:43 +02:00
* Independent implementation (can be embedded in any project)
* No global state (multiple CubeScripts in a single program)
* Modern C++14 API (no macros, strongly typed enums, lambda support, range support etc.)
2016-08-27 20:26:52 +02:00
* C++14 lambdas can be used as commands (including captures and type inference)
2016-09-10 17:13:43 +02:00
* Error handling including recovery (protected call system similar to Lua)
* No manual memory mangement, values manage themselves
2016-08-27 20:26:52 +02:00
* Clean codebase that is easy to read and contribute to
2016-09-10 17:13:43 +02:00
* Support for arbitrary size integers and floats (can be set at compile time)
2016-08-27 20:26:52 +02:00
* Allows building into a static or shared library, supports `-fvisibility=hidden`
Upcoming features:
* Thread safety (safely call into a single Cubescript state from multiple threads)
* Custom allocator support (control over how heap memory is allocated)
The API is currently unstable and a work in progress. The codebase itself is
also changing very quickly.
The only dependency is OctaSTD:
https://git.octaforge.org/tools/octastd.git/
2015-08-08 18:24:05 +02:00
https://github.com/OctaForge/OctaSTD
2016-08-27 20:26:52 +02:00
If OctaSTD can work on your system, so can libcubescript.
2015-08-08 18:24:05 +02:00
2016-08-27 20:26:52 +02:00
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
2016-09-01 18:51:39 +02:00
for the REPL only (you don't need it to build libcubescript itself). The version
2016-09-04 21:46:16 +02:00
in the repository tracks Git revision https://github.com/antirez/linenoise/commit/c894b9e59f02203dbe4e2be657572cf88c4230c3.
2016-02-23 23:26:23 +01:00
2016-02-07 22:22:39 +01:00
See COPYING.md for licensing information.