Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm2luau option to disable use of Roblox library #38

Open
dphfox opened this issue Jun 11, 2024 · 2 comments
Open

wasm2luau option to disable use of Roblox library #38

dphfox opened this issue Jun 11, 2024 · 2 comments

Comments

@dphfox
Copy link

dphfox commented Jun 11, 2024

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
Copy link
Contributor

RealEthanPlayzDev commented Jun 13, 2024

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
Copy link

Graicc commented Jun 25, 2024

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 rust-lang/cargo#8366). Also, as of #35, the generated code will check for vector, which lune implements (although I haven't tested this myself).

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

No branches or pull requests

3 participants