An embeddable, thread-safe implementation of the cubescript language
 
 
 
Go to file
Daniel Kolesa 9672a1091e add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
docs add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
tools add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
.gitignore add .so to gitignore 2016-02-26 00:15:08 +09:00
COPYING.md add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
Makefile add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
README.md add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
cs_gen.cc fix format 2016-08-31 20:09:30 +01:00
cs_util.cc simplify float parsing 2016-08-17 17:10:55 +01:00
cs_util.hh cleanups 2016-08-15 18:55:22 +01:00
cs_vm.cc move some code around 2016-08-31 19:54:08 +01:00
cs_vm.hh move some code around 2016-08-31 19:54:08 +01:00
cubescript.cc add support for several line editing approaches (pure stdin, linenoise, libedit, readline) 2016-09-01 17:50:02 +01:00
cubescript.hh fix ambiguous ctor 2016-08-31 21:46:25 +01:00
cubescript_conf.hh initial support for custom allocators 2016-08-21 01:34:33 +01:00
lib_list.cc use CsStackedValue appropriately 2016-08-31 18:49:24 +01:00
lib_math.cc rename TaggedValue 2016-08-18 19:38:30 +01:00
lib_str.cc initial support for custom allocators 2016-08-21 01:34:33 +01:00

README.md

libcubescript

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).

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:

  • Independent implementation that can be embedded in any project
  • No global state - multiple Cubescripts can be present within a single program
  • Modern C++14 API (no macro mess like in the original)
  • C++14 lambdas can be used as commands (including captures and type inference)
  • Clean codebase that is easy to read and contribute to
  • Core types can be changed as needed at compile time (larger floats? no problem)
  • 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/
https://github.com/OctaForge/OctaSTD

If OctaSTD 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).

See COPYING.md for licensing information.