CuffScript is a lightweight scripting language designed for readable, natural-language-like syntax and simple general-purpose scripting. This repository includes its language engine, command-line runner, built-in libraries, and runnable examples.
The engine can be used through the command-line interpreter or embedded in a C++ application.
Before building CuffScript, make sure you have:
- A C++17 compatible compiler
makeavailable on your system- On Windows, MinGW or a similar toolchain that supports
mingw32-make
If you are using Linux or macOS, the standard system make should work. If you are on Windows, install MinGW and ensure it is on your PATH before running the build commands below.
On Linux or macOS:
makeOn Windows with MinGW:
mingw32-make -f Makefile.winThe executable is cuffc on Linux/macOS and cuffc.exe on Windows.
./cuffc examples/01_hello.cuffOn Windows:
.\cuffc.exe examples\01_hello.cuffTo read a script from standard input, run cuffc without a file. Use --help to see available command-line options.
set str name to "World"
set returnable func greet(person) do:
return f"Hello, {person}!"
end
print(greet(name))
- Variables, constants, functions, conditionals, and loops
- Lists, ordered maps, indexing, and slicing
- A built-in pattern-matching language
- Async functions, modules, and recoverable runtime errors
- Built-in libraries for math, strings, collections, time, JSON, and more
- A C++ API for embedding the engine, plus a WebAssembly build target
- Language specification
- Pattern syntax
- Security policy
- Runnable examples
- Contributing
- WebAssembly package
make
bash tests/run.shOn Windows, use mingw32-make -f Makefile.win followed by powershell -File tests\run.ps1.
CuffScript is licensed under the Apache License 2.0.