CupidScript is a C99 interpreter and embeddable scripting runtime. It includes classes, generators, async/await, pattern matching, comprehensions, and collection types.
Install a C compiler, Make, and the OpenSSL/zlib development libraries. Tests also use Python 3 and the OpenSSL command-line tool.
make -j
make test
./bin/cupidscript script.csThe build produces bin/cupidscript, bin/libcupidscript.a, and the C API tests. Set CS_NO_TLS=1 to build without TLS support. Use separate OBJDIR and BINDIR values for sanitizer builds; commands are in the test guide.
Include cupidscript.h, create a VM with cs_vm_new, register native functions, and execute code with cs_vm_run_file or cs_vm_run_string. Check return codes and read cs_vm_last_error when execution fails.
Constructors and retained getters return owned references. Setters retain stored values, so release the caller's references after storing them. cs_to_cstr returns a borrowed pointer. Release host-held values before destroying the VM with cs_vm_free.
The embedding guide includes a complete, tested C example and describes tuple builders, cycle collection, and shutdown ownership.
- Wiki home: language topics and standard library.
- Full reference or its source copy: syntax, examples, and host use.
- Embedding API: retained values and C examples.
- Tuples: positional/named fields, length, and destructuring.
- Tests: normal and sanitizer commands.
The blocking HTTP client supports content-length, chunked, and close-delimited responses. TLS verifies peer names against the OpenSSL trust store. See the reference for network limits.
The runtime includes filesystem, JSON/CSV/YAML/XML, regex, process, and network APIs. Host applications can configure execution limits. See the reference for platform dependencies and supported behavior.
See LICENSE for licensing terms.