dymokomi/luce-demos
Source of release 0.4.1
0.4.1 / README.md
# Luce demos
Small applications written in Luce, using the Luce Base `luce-ui` and `luce-3d`
packages. Native compilation is the default. The standard library owns window,
input and GPU backend resources; applications own their behavior.
- `src/ui_demo.luc`: a counter, a button and declarative stack layout. A retained
connection calls the counter's bound `increment` method.
- `src/sphere.luc`: a lit sphere and orbiting moon inside luce-ui's `SceneView`, with
pause/resume and reset controls. `Application.on_frame` drives animation.
Check out `luce-base`, `luce`, `luce-ui`, `luce-3d` and what they use alongside this
repository, at main (`python3 ../luce-base/tools/checkout_main.py . ../luce` clones the
missing ones). Build the compilers, then:
```sh
./build.sh
./build/ui
./build/sphere
```
Running the examples requires macOS with Metal. Their portable application and
package code also compiles on Linux; native Vulkan presentation is future work.
The `--smoke` argument closes each window after twelve frames.
`./build.sh` leaves just `build/ui` and `build/sphere`. To choose an optimization
level or output directory, use `python3 tools/build.py --opt 3 --output-directory
/path/to/output`. Dependencies are resolved through their manifests and public
exports. Normal builds keep no generated Base source or staged dependencies.
`./test.sh` compiles both examples and runs their counter/pause/reset/animation
interaction tests at native optimization levels 0–3. It also checks that successful
and failed builds clean up their temporary output. `./test.sh --gui` additionally
runs both windows with Metal API/shader validation. CI runs portable tests on
ARM64 macOS and x86-64 Linux, with GUI smoke tests on macOS.
The examples intentionally retain the language's current explicit `try` syntax.
Error-handling ergonomics are a separate language design discussion, not a
package-level exception suppression policy.
These are development examples with no compatibility promise before the first
release. Licensed under MIT or Apache-2.0, at your option.
## Windows x64
Build sibling `luce-base` and `luce` checkouts with `python tools/build_windows.py` in each compiler repository. Run `python tests/run.py` in this repository; the runner selects the sibling Windows executables.
For real windows and rendering, install the Vulkan SDK and start a fresh terminal with `VULKAN_SDK` set. Run `python tools/build.py`, then `build/ui.exe` or `build/sphere.exe`; `python tests/run.py --gui` exercises actual presentation. CPU tests run in hosted Windows CI; GPU smoke tests require an interactive desktop and Vulkan hardware.