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

Too much noise from write_constant #7

Closed
Rerumu opened this issue Jun 16, 2022 · 0 comments
Closed

Too much noise from write_constant #7

Rerumu opened this issue Jun 16, 2022 · 0 comments

Comments

@Rerumu
Copy link
Owner

Rerumu commented Jun 16, 2022

The WebAssembly specification is not very clear on what a well-formed constant looks like, or how many constant instructions it may allow. As such, right now write_constant implementations for offsets and other values end up creating an entire function just to call it and receive its value.

This makes would would otherwise be 1 line (the expression of the constant) turn into at least 5 lines. It would be great if all this noise could be removed without breaking any unspoken rules.

https://github.com/Rerumu/Wasynth/blob/master/codegen-luajit/src/translator.rs#L51
https://github.com/Rerumu/Wasynth/blob/master/codegen-luau/src/translator.rs#L50

@Rerumu Rerumu closed this as completed in bc64734 Jun 18, 2022
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

1 participant