Skip to content

Conversation

@makspll
Copy link
Owner

@makspll makspll commented Nov 5, 2025

First of all few re-structuring changes in ladfiles, and a bit of refactoring to make this possible:

  • bevy_mod_scripting_bindings_domain crate, which contains definitions that can be shared with the ladfile crate without bringing in bevy crates
    • defines the concept of a operator via ScriptOperatorNames
    • defines reflection primitives via ReflectionPrimitiveKind
  • struct fields are now parsed into TypedThrough like structures, similarly to globals and function arguments, meaning the concept of a "wrapper" type , i.e. Option or Vec dissapears from standalone lad type definitions. Only "pure" types make it, the structure is parsed into ladfile enums.

Finally
lua_language_server_lad_backend is estabilished, and brings in a ladfile processor which generates lua language server files!

Migration Guide

If you were relying on ladfiles or implementing TypedThrough manually, the interfaces will have changed. Some types have moved between crates.

Less types will appear in ladfiles

@semanticdiff-com
Copy link

semanticdiff-com bot commented Nov 5, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  assets/scripts/game_of_life.lua  100% smaller
  crates/languages/bevy_mod_scripting_lua/src/bindings/reference.rs  87% smaller
  xtask/src/main.rs  51% smaller
  crates/lad_backends/mdbook_lad_preprocessor/src/argument_visitor.rs  43% smaller
  crates/ladfile_builder/src/plugin.rs  43% smaller
  crates/lad_backends/mdbook_lad_preprocessor/src/sections.rs  36% smaller
  crates/ladfile_builder/src/lib.rs  30% smaller
  examples/docgen.rs  21% smaller
  crates/bevy_mod_scripting_bindings/src/docgen/typed_through.rs  14% smaller
  crates/lad_backends/mdbook_lad_preprocessor/tests/book_integration_tests.rs  7% smaller
  crates/ladfile/test_assets/test.lad.json  5% smaller
  crates/ladfile/src/lib.rs  3% smaller
  crates/bevy_mod_scripting_bindings/src/docgen/info.rs  2% smaller
  .gitignore Unsupported file format
  .luarc.json  0% smaller
  Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_bindings/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_bindings_domain/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_bindings_domain/src/lib.rs  0% smaller
  crates/bevy_mod_scripting_bindings_domain/src/operators.rs  0% smaller
  crates/bevy_mod_scripting_bindings_domain/src/primitive.rs  0% smaller
  crates/bevy_mod_scripting_core/Cargo.toml Unsupported file format
  crates/bevy_mod_scripting_core/src/lib.rs  0% smaller
  crates/bevy_system_reflection/src/lib.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/Cargo.toml Unsupported file format
  crates/lad_backends/lua_language_server_lad_backend/src/convert.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/src/keywords.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/src/lib.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/src/lua_declaration_file.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/src/main.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/src/plugin.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/src/templating.rs  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/templates/declaration_file.tera Unsupported file format
  crates/lad_backends/lua_language_server_lad_backend/tests/.gitignore Unsupported file format
  crates/lad_backends/lua_language_server_lad_backend/tests/example_ladfile/expected.lua  0% smaller
  crates/lad_backends/lua_language_server_lad_backend/tests/integration_tests.rs  0% smaller
  crates/lad_backends/mdbook_lad_preprocessor/tests/books/example_ladfile/expected/parent/lad/functions/hello_world.md Unsupported file format
  crates/lad_backends/mdbook_lad_preprocessor/tests/books/example_ladfile/expected/parent/lad/globals.md Unsupported file format
  crates/lad_backends/mdbook_lad_preprocessor/tests/books/example_ladfile/expected/parent/lad/types.md Unsupported file format
  crates/ladfile/Cargo.toml Unsupported file format
  crates/ladfile/src/plugin.rs  0% smaller
  crates/ladfile_builder/Cargo.toml Unsupported file format
  crates/languages/bevy_mod_scripting_lua/Cargo.toml Unsupported file format
  docs/src/SUMMARY.md Unsupported file format
  docs/src/ScriptTooling/introduction.md Unsupported file format
  docs/src/Summary/scripting-ide-integrations.md Unsupported file format
  release-plz.toml Unsupported file format
  src/lib.rs  0% smaller

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

🐰 Bencher Report

Branchfeat/lua-declaration-files
Testbedlinux-gha
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
component/access Lua📈 view plot
🚷 view threshold
3,888.20 ns
(-8.36%)Baseline: 4,242.83 ns
4,787.65 ns
(81.21%)
component/access Rhai📈 view plot
🚷 view threshold
5,609.00 ns
(-6.96%)Baseline: 6,028.89 ns
6,583.01 ns
(85.20%)
component/get Lua📈 view plot
🚷 view threshold
2,558.80 ns
(-3.46%)Baseline: 2,650.52 ns
3,167.31 ns
(80.79%)
component/get Rhai📈 view plot
🚷 view threshold
4,295.50 ns
(-5.02%)Baseline: 4,522.72 ns
5,003.00 ns
(85.86%)
conversions/Mut::from📈 view plot
🚷 view threshold
92.54 ns
(-3.68%)Baseline: 96.07 ns
119.70 ns
(77.31%)
conversions/Ref::from📈 view plot
🚷 view threshold
100.75 ns
(+6.73%)Baseline: 94.40 ns
115.09 ns
(87.54%)
conversions/ScriptValue::List📈 view plot
🚷 view threshold
390.32 ns
(+3.75%)Baseline: 376.21 ns
413.13 ns
(94.48%)
conversions/ScriptValue::Map📈 view plot
🚷 view threshold
1,012.50 ns
(-10.72%)Baseline: 1,134.04 ns
1,301.73 ns
(77.78%)
conversions/ScriptValue::Reference::from_into📈 view plot
🚷 view threshold
28.43 ns
(+3.38%)Baseline: 27.50 ns
31.66 ns
(89.79%)
conversions/Val::from_into📈 view plot
🚷 view threshold
304.80 ns
(-1.39%)Baseline: 309.09 ns
369.54 ns
(82.48%)
function/call 4 args Lua📈 view plot
🚷 view threshold
1,898.00 ns
(-4.13%)Baseline: 1,979.71 ns
2,275.23 ns
(83.42%)
function/call 4 args Rhai📈 view plot
🚷 view threshold
1,339.60 ns
(-11.21%)Baseline: 1,508.76 ns
1,705.71 ns
(78.54%)
function/call Lua📈 view plot
🚷 view threshold
382.96 ns
(+23.52%)Baseline: 310.04 ns
520.67 ns
(73.55%)
function/call Rhai📈 view plot
🚷 view threshold
475.95 ns
(+4.75%)Baseline: 454.37 ns
544.00 ns
(87.49%)
loading/empty Lua📈 view plot
🚷 view threshold
1,536,300.00 ns
(+64.14%)Baseline: 935,987.80 ns
1,908,611.20 ns
(80.49%)
loading/empty Rhai📈 view plot
🚷 view threshold
2,004,400.00 ns
(+69.74%)Baseline: 1,180,833.00 ns
2,283,058.30 ns
(87.79%)
math/vec mat ops Lua📈 view plot
🚷 view threshold
7,094.50 ns
(-11.63%)Baseline: 8,028.62 ns
9,429.97 ns
(75.23%)
math/vec mat ops Rhai📈 view plot
🚷 view threshold
6,621.20 ns
(-8.09%)Baseline: 7,204.03 ns
8,202.65 ns
(80.72%)
query/10 entities Lua📈 view plot
🚷 view threshold
21,151.00 ns
(-6.35%)Baseline: 22,584.30 ns
26,651.93 ns
(79.36%)
query/10 entities Rhai📈 view plot
🚷 view threshold
19,207.00 ns
(-10.61%)Baseline: 21,485.60 ns
24,267.22 ns
(79.15%)
query/100 entities Lua📈 view plot
🚷 view threshold
41,695.00 ns
(-7.10%)Baseline: 44,883.80 ns
50,043.13 ns
(83.32%)
query/100 entities Rhai📈 view plot
🚷 view threshold
32,212.00 ns
(-9.22%)Baseline: 35,484.10 ns
40,108.06 ns
(80.31%)
query/1000 entities Lua📈 view plot
🚷 view threshold
247,350.00 ns
(-15.55%)Baseline: 292,911.00 ns
348,493.17 ns
(70.98%)
query/1000 entities Rhai📈 view plot
🚷 view threshold
162,180.00 ns
(-9.28%)Baseline: 178,776.00 ns
205,115.91 ns
(79.07%)
reflection/10 Lua📈 view plot
🚷 view threshold
5,544.20 ns
(-11.41%)Baseline: 6,258.47 ns
7,052.01 ns
(78.62%)
reflection/10 Rhai📈 view plot
🚷 view threshold
14,969.00 ns
(-6.16%)Baseline: 15,951.20 ns
16,950.93 ns
(88.31%)
reflection/100 Lua📈 view plot
🚷 view threshold
47,407.00 ns
(-10.43%)Baseline: 52,924.80 ns
59,377.62 ns
(79.84%)
reflection/100 Rhai📈 view plot
🚷 view threshold
719,580.00 ns
(-9.08%)Baseline: 791,449.00 ns
863,228.94 ns
(83.36%)
resource/access Lua📈 view plot
🚷 view threshold
3,602.30 ns
(-6.21%)Baseline: 3,840.86 ns
4,327.78 ns
(83.24%)
resource/access Rhai📈 view plot
🚷 view threshold
4,957.50 ns
(-9.75%)Baseline: 5,493.22 ns
6,110.71 ns
(81.13%)
resource/get Lua📈 view plot
🚷 view threshold
2,105.00 ns
(-7.10%)Baseline: 2,265.86 ns
2,789.75 ns
(75.45%)
resource/get Rhai📈 view plot
🚷 view threshold
3,751.50 ns
(-6.74%)Baseline: 4,022.67 ns
4,480.20 ns
(83.74%)
🐰 View full continuous benchmarking report in Bencher

@makspll makspll enabled auto-merge (squash) November 5, 2025 23:15
@makspll makspll merged commit 0a9a37d into main Nov 6, 2025
26 checks passed
@makspll makspll deleted the feat/lua-declaration-files branch November 6, 2025 09:29
This was referenced Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants