santoku
santoku

santoku

A Lua framework for building applications end to end

Lua 5.1 from the build system to the server to the browser. Every example on this site runs in your browser. Edit one and run it.


santoku targets Lua 5.1, because 5.1 is the version its platforms actually share. LuaJIT implements 5.1 and OpenResty embeds LuaJIT, so server code, client code and the build harness all run the same language. Compiled to WebAssembly, the 5.1 core is smaller to embed, and its single number type sidesteps the integer and float split introduced in 5.3, which keeps numeric values crossing the JavaScript boundary simple. Support for newer versions is meant to come from compatibility shims layered over the 5.1 core rather than version branches in the tree; contributions and design ideas for that layer are welcome.

santoku-cli: project initializer

View on LuaRocks

pick toku init's flags, browse the project it writes file by file, and copy the setup and init lines

Pick an example and the flags, then browse the project toku init writes for them, file by file. Copy runs nothing: it copies the setup-toku.sh lines from https://santoku.dev/install and the toku init line for your fields.

Details
  • The site build runs the real toku init once for each example, license choice and --comments setting. The navigator shows that output unchanged, under the example's project name, such as my-lib or my-app, and the holder Example Org. Your name and holder go only into the copied line.
  • --example NAME picks the example, and toku init with no --example creates the lib example. --example needs santoku-cli 8.0.0 and santoku-make 13.0.0.
  • The examples page describes each example and shows its files: https://santoku.dev/examples
  • Every example file is plain text at https://santoku.dev/santoku-cli/init/examples/<example>/<path>. This tab's llms.txt lists every example, its toku init line and its files.
  • --license takes an SPDX id whose text has a copyright line toku init can fill: MIT, ISC, BSD-2-Clause or BSD-3-Clause. toku init refuses an id such as Apache-2.0, whose text has no such line.
  • --license needs --copyright. --copyright alone writes an all-rights-reserved LICENSE.
  • --comments adds a note to each file that explains it and links the santoku.dev page that covers it. It needs santoku-cli 5.1.0 and santoku-make 9.1.0.
  • The getting-started tabs walk through each project type: https://santoku.dev/start-lib, https://santoku.dev/start-web and https://santoku.dev/start-server.
Example (--example)
curl -fSLO https://santoku.dev/setup-toku.sh
sh setup-toku.sh
toku init --example lib my-lib