19 Commits
Author SHA1 Message Date
BlackAngelTV a8364972da feat(cli): find the runtime headers next to the binary
A downloaded release has no checkout to refer to, and the include directory was
baked in at configure time. `luacpp run` now looks for include/luacpp/rt.hpp
beside its own executable and honours LUACPP_INCLUDE before falling back to that
path. CMake gained install rules producing the bin/include/share tree the
tarball is built from.
v0.2.0
2026-11-18 10:40:24 +01:00
BlackAngelTV 9587d1ed49 feat(gui): draw windowed apps through a batched SDL2 surface
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.
2026-11-18 10:18:44 +01:00
BlackAngelTV 0fc96b243a feat(demo): add a full-screen terminal paint editor
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.
2026-11-18 10:18:44 +01:00
BlackAngelTV e71907ea86 feat(demo): add a spreadsheet engine written in Lua
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.
2026-11-18 09:19:32 +01:00
BlackAngelTV 4bf42d9179 chore: merge the remote initial commit 2026-11-18 08:50:29 +01:00
BlackAngelTV abfbac6414 docs: add repository instructions for AI agents 2026-11-18 08:48:05 +01:00
BlackAngelTV 1bfbe79cba feat(cli): create a build directory next to the Lua sources
The generated files landed in a luacpp-build folder named after the script, so
the executable could not be found where a build directory is usually expected.
The default layout is now build/<script> for the binary and build/src for the
generated sources, and the path is printed relative to the working directory.
2026-11-18 08:48:05 +01:00
BlackAngelTV fbdb3e73ba refactor(demo): keep the demo Lua-only
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.
2026-11-18 08:48:05 +01:00
BlackAngelTV ac8353e2c0 chore: trim the ignore rules and drop stale build output
The gitignore came from a generic C++ template in which almost no pattern
applies here, and build/ still held files from the removed example project.
The generated luacpp-build directory is now ignored too.
2026-11-18 08:48:05 +01:00
BlackAngelTV fb8688890c docs: document the one-command workflow
The previous instructions described a CMake-only flow; the new entry point is
building the compiler once and running a script directly.
2026-11-18 08:48:05 +01:00
BlackAngelTV 274daa7b1d feat(cli): add a run mode that compiles and executes a Lua script
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.
2026-11-18 08:48:05 +01:00
BlackAngelTV a71f27d04a build: build only the compiler and drop the example project
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.
2026-11-18 08:48:05 +01:00
BlackAngelTV d8bd30918a docs: describe the transpiler, its C++ API and known limits
Users need to know how to build the compiler, integrate it in CMake and which
Lua features are not supported yet.
2026-11-18 08:48:05 +01:00
BlackAngelTV ff9d380846 feat(demo): add a standalone project exercising compiled modules
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++.
2026-11-18 08:48:05 +01:00
BlackAngelTV a06bad1b0e test: compare compiled modules with the Lua 5.4 interpreter
The generated code can only be trusted if it behaves like the reference
implementation, so the same script runs both ways and the outputs are diffed.
2026-11-18 08:48:05 +01:00
BlackAngelTV 11a2e1ba6a build: add build script and CMake helper for compiled packages
Compiling the compiler, the example and the demo by hand is error prone, so a
single script keeps the whole flow reproducible and ignores build outputs.
2026-11-18 08:48:05 +01:00
BlackAngelTV 517ed0bf4d feat(compiler): add a Lua 5.4 to C++ module transpiler
Each Lua module becomes a header/source pair exposing a C++ namespace, so Lua
code can be linked and consumed like any C++ package while keeping the exact
semantics of the official 5.4 VM.
2026-11-18 08:48:05 +01:00
BlackAngelTV 62e950dbc5 Initial commit 2026-11-18 08:48:05 +01:00
BlackAngelTV 690f2b6fec Initial commit 2026-11-17 11:39:05 +01:00