Compiled programs could only write to the terminal, so the demo editor had no
real window. When CMake finds SDL2 the runtime now exposes a `gui` table and
Demo/guipaint.lua builds a 960x640 editor on top of it.
Frames are collected in Lua, merged into horizontal runs and sent with a single
`gui.rects` call: a full scene goes from 15071 draw calls and 42.9 ms per frame
to 1522 calls and 2.1 ms, and the rendered screenshot stays pixel-identical.
The repository only shipped a spreadsheet demo, so there was no example of an
interactive, stateful program. LuaPaint keeps the whole editor in Lua - canvas
primitives with undo, palette, tools and a scriptable session - and its tests
run without a terminal.
The demo folder only had a toy todo list, which did not show that a
non-trivial application can be written in Lua and shipped as a single
compiled binary. This adds LuaSheet: a tokenizer, a formula parser, a
lazy evaluator with cycle detection, range-aware builtin functions,
ASCII/CSV rendering and a benchmark, all driven by a CLI entry point.
Everything stays plain Lua under Demo/: no C++ change is needed to
build or run it.
Calling the compiled modules required a CMake project and a C++ main, which
contradicted the point of the compiler. A Lua entry script now prints the same
report, and the modules sit next to it so require resolves without any flag.
Writing C++ or CMake to try a Lua file makes the compiler hard to evaluate, so
one command now transpiles the script and its sibling modules, links them and
runs the result. Literal require calls resolve against the compiled modules.
The example duplicated what Demo already covers, and the run mode needs the
runtime include path and Lua link flags at execution time, so they are baked in
at configure time.
A separate CMake project using the compiler as a subproject shows the real
workflow: namespaced facades, require between compiled modules and dynamic
access from C++.