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

data.length opcode #1546

Open
SoniEx2 opened this issue Dec 24, 2024 · 1 comment
Open

data.length opcode #1546

SoniEx2 opened this issue Dec 24, 2024 · 1 comment

Comments

@SoniEx2
Copy link

SoniEx2 commented Dec 24, 2024

we should have data.length opcode

(it should return 0 for dropped segments ofc)

@SoniEx2
Copy link
Author

SoniEx2 commented Dec 27, 2024

for context: memory.init (already) needs to know the data segment length so it can trap, but trapping isn't particularly useful for programs. a data.length would expose the length in an useful way (non-trapping).

a hypothetical single-pass compiler could use a data.length opcode for generated data segments, since data segments come after code segments. such data.length opcode also happens to be oddly convenient when hand-writing wasm/wat.

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