Learn and run CuffScript in your browser, with nothing to install.
CuffScript is a small, readable scripting language with a C++ engine. This site is its home on the web. It has an IDE that runs the real engine, compiled to WebAssembly, a full language guide, the complete reference, runnable examples, and a page for every error the engine can raise. Code on every page runs in place with one click.
func greet(str name) do:
return f"Hello, {name}!"
end
list names = ["Ada", "Linus"]
loop each str n in names do:
print(greet(n))
end
- Browser IDE (
/ide/): an editor with syntax highlighting, projects of several files, liveinput()in the console, ready-made examples, and views of the tokens, syntax tree and bytecode. Share link turns a whole program into a URL. - Language guide (
/guide/): the language from the first program to classes, errors, patterns, libraries, embedding and a cookbook of short recipes. Every example in it is run against the real engine before the site is built. - Reference (
/reference/): the language, every built-in and library function, the tools and the limits, taken from the engine's own documentation, with a search that finds a function by its name, its method name or a part of it. Every example in it is run with the real engine when the site is synced. - Examples (
/examples/): complete programs, from Hello World to small real programs, each runnable in the page or in the IDE. - Error reference (
/errors/): every error code with what it means, its usual cause and fix, and the report the engine prints, searchable by code, name or message. An error in the IDE links straight to it. - Changelog (
/changelog/): every release of the engine. - Download (
/download/): the Windows installer, which sets upcuffc, thecuffshshell, a desktop IDE and the examples, and how to build from source on other systems. - Runs in place: a program on any page has a Run button that runs it with the real engine right there, and an Open in IDE link. Inline code that names a function, a library or an error code links to where it is described.
- Always in step with the engine: keywords, library functions, error codes, limits, the reference pages and the changelog are generated from the engine's own source and documentation. A weekly check reports anything in the guide that no longer works.
- Vite and TypeScript, with no UI framework
- CodeMirror 6 for the editor
cuffscript-wasm: the engine compiled to WebAssembly, run in a web worker- The guide is written in Markdown, and the reference is the engine's own Markdown; both are rendered at build time by a small converter of its own
- Hosted on Cloudflare Pages
Node 22 or newer is needed.
git clone https://github.com/cuffscript/site.git
cd site
npm install
npm run dev # http://localhost:5173, reloads as you edit
npm run build # a static site in dist/
npm testCorrections to the guide are welcome: the text lives in content/ as Markdown. How to write it, how the site is built and how it
follows new engine releases are in MAINTAINING.md. Bugs in the language itself belong in the
engine repository.