Rerumu / Wasynth

WebAssembly to Lua translation library and tool
https://discord.gg/sgm5YcmgyD
GNU General Public License v3.0
126 stars 18 forks source link

wasm2luau option to disable use of Roblox library #38

Open dphfox opened 1 month ago

dphfox commented 1 month ago

wasm2luau seems to rely on Vector3.new from the Roblox standard library (presumably to take advantage of vector optimisations). This prevents its use in standalone runtimes like Lune which don't provide these library members.

RealEthanPlayzDev commented 1 month ago

There was a Rust build option that you could use to have Wasynth generate code with a Luau-based Vector3 implementation. I'm pretty sure it still exists.

Alternatively you can use https://github.com/RealEthanPlayzDev/LuauCeption/blob/main/snippets/VanillaV3.luau (from my project, LuauCeption)

Graicc commented 3 weeks ago

The feature flag in question is vector, which is enabled by default. You have to build from inside the codegen/luau directory for --no-default-features to work properly (see https://github.com/rust-lang/cargo/issues/8366). Also, as of #35, the generated code will check for vector, which lune implements (although I haven't tested this myself).