Skip to content
cuffscriptPublic

Repository files navigation

CuffScript Website

TypeScript Vite WebAssembly License

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, and a reference for every error the engine can raise.

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

Features

  • Browser IDE (/ide/): an editor with syntax highlighting, projects of several files, live input() 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.
  • 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.
  • Always in step with the engine: keywords, library functions, error codes and limits are generated from the engine's own source. A weekly check reports anything in the guide that no longer works.

Built with

  • 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 rendered at build time by a small converter of its own
  • Hosted on Cloudflare Pages

Running it locally

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 test

Contributing

Corrections to the guide are welcome: the text lives in content/ as Markdown (writing guide in content/README.md, in Korean). For how the site is built and how it follows new engine releases, see MAINTAINING.md. Bugs in the language itself belong in the engine repository.

License

Apache-2.0

Releases

Packages

Used by

Contributors

Languages