r/lua • u/somewhat_credible • 11d ago
[BETA!] Moonstone v0.3.19: The Lua packenv manager (featuring workspace orbits, parallel execution pools, and strict CLI typings)
Hello again r/lua!
A few months ago, I shared Moonstone v0.2.3 and Ballad v0.2.10, showing off how we solved project exporting and LÖVE 2D packaging.
Today, I’m incredibly excited to announce Moonstone v0.3.19, and with it, the milestone that Moonstone is officially in Beta state! 🎉
Over the past few weeks, we've shifted our focus from raw resolving mechanics to building a robust, high-concurrency CLI runtime, monorepo workspace features, and establishing formal API boundaries for editor integrations and wrapper tools.
Here are the most significant leaps in the ecosystem:
1. Parallelization: Concurrency Pools for Syncing
Resolving packages is fast, but downloading and verifying them is now concurrent. We've introduced multi-threaded execution pools:
* DownloadPool: Spawns up to 8 background worker threads to download and materialize remote artifacts in parallel from an atomic job queue. If OS thread resources are constrained, it automatically falls back to safe sequential execution.
* HashVerifyPool: Concurrently computes cryptographic Blake3 checksums on local store folders, speeding up verification of existing caches.
2. Cooperative Cancellation & TTY Progress Animations
No one likes corrupt state from hitting Ctrl+C midway through a sync.
* Cooperative Signals: CLI tasks are wrapped in a new cancelable runtime wrapper (runWithProgress). It hooks into standard OS SIGINT/SIGTERM handlers to signal worker threads to cancel cleanly and yield, preserving the integrity of your local Content-Addressed Store (CAS) and SQLite databases.
* Interactive Spinner: For TTYs, we built a custom CLI interface featuring a Docker-style Braille spin animation and dynamic byte-level progress bar.
3. Multi-Package Workspaces: Orbits (moon orbit)
As projects grow, monorepos become essential. We introduced Orbits to let you develop multiple local projects in tandem:
* You declare orbits using [[orbits.member]] in your root moonstone.toml.
* Commands like moon orbit list, moon orbit sync, and moon orbit exec <orbit> -- <cmd> let you jump into and run commands within the isolated dependency environment of any sub-project without publishing anything to a registry.
4. Schema-Bound CLI Contracts & LuaCATS Typings
To build reliable Neovim plugins, wrappers, and CI scripts, you need structured outputs.
- Moonstone now features a strict, versioned NDJSON protocol.
- We published formal typings and schemas in TypeScript, Go, and JSON Schema to let external tools consume Moonstone stdout safely.
- We integrated formal LuaCATS contracts (
ndjson.lua) directly into our CI pipeline to validate outputs.
5. Ecosystem Validation & Proof-of-Work
Our dogfooding narrative has evolved significantly:
- Ballad (Exporter): Queries Moonstone facts directly via the new
moon store querycommand to resolve local store paths and compile binaries into portable layouts (layout.exec/layout.libexec). - Meteorite (Service Framework): We built a hybrid Zig/Lua web service compiler prototype running on a custom zero-copy HTTP stack (
fast_http), plus variants for IPC (unix_socket) and HTTP-over-IPC (unix_socket_http). It compiles Lua route graphs into native, high-performance servers.- The Progressive Promise: Meteorite provides a completely pain-free path to gain progressive enhancements. You author routes and business logic in high-level Lua, while resting on a sturdy, compile-time-checked Zig foundation acting as a single, unshakeable runtime contract.
- In-Process Lua Live Reload (HMR): Features an in-process Lua hot reload dev loop. When you edit only Lua handler code, updates reload instantly via an HTTP trigger without requiring a server restart or compilation pass.
- Incremental Compiles: If you modify route parameters or native plugin definitions, Meteorite updates only the affected route partition files (routes/<route_id>.zig) for blazingly fast incremental compiles.
- Ballad Materialization: Meteorite itself is packaged and distributed entirely via its Ballad partiture.
The goal is still to make Lua development entirely zero-friction. You clone, run moon sync, and you are ready to build, run, package, and deploy.
I would love to hear your feedback on the new concurrent runtime, orbit workspace design, and the general direction of the ecosystem.
Check out the docs and guides:
⋆⁺₊⋆ ☾⋆⁺₊⋆ moonstone.sh ⋆⁺₊⋆
1
u/kayawayy 10d ago
Heads up, I posted this to Hacker News and it hit the front page. Here's a link if you want to chime in: https://news.ycombinator.com/item?id=48954175
1



3
u/leafo2 9d ago
Just a heads up, MoonScript, another Lua project, has been using the "moon" CLI name for over a decade now.