Wasynth icon indicating copy to clipboard operation
Wasynth copied to clipboard

wasm2luau option to disable use of Roblox library

Open dphfox opened this issue 1 year ago • 2 comments

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.

dphfox avatar Jun 11 '24 19:06 dphfox

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)

RadiatedExodus avatar Jun 13 '24 01:06 RadiatedExodus

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).

Graicc avatar Jun 25 '24 16:06 Graicc