makspll / makspll/bevy_mod_scripting
Add a native Luau (.d.luau) backend for LAD files
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 649
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
Add a native Luau (.d.luau) backend for LAD files
Problem
ladfile_builder ships LAD post-processors for the Lua Language Server (--- @class .lua) and mdbook, but there's no native Luau one. luau-lsp can't consume the LuaLS dialect — it expects declare class … end / declare name: T syntax.
The luau runtime feature already exists, so you can run Luau scripts against Bevy, but there's currently no way to type-check them against the reflection registry.
Proposal
A native Luau backend in ladfile_builder, behind a luau_files feature, mirroring how lua_language_server_files is wired:
- a pure
lad_to_luau(&LadFile, …) -> Stringconversion, and - a
LuauLadPluginimplementingLadFilePlugin, added todefault_processors().
It would be a feature-gated module rather than a separate crate (like the LuaLS backend), since it's pure string generation over the ladfile types and needs no new dependencies.
Scope of a first cut:
declare classfor reflected types (withfocus_cratesto keep output readable), host global functions, and non-static instance handles likeworld;- handle Luau grammar edges (reserved words, the unit type, static-vs-instance globals);
- unknown types resolve to
any.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing lua_language_server_files feature in ladfile_builder, especially default_processors() and the LadFilePlugin implementation. Add the feature-gated lad_to_luau conversion and LuauLadPlugin, covering declare class output, host globals, instance handles, grammar edge cases, and unknown types as any. Done means the backend is wired without new dependencies and produces valid Luau declarations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100