-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
builtin,v.gen.wasm: support -b wasm -d no_imports
#24188
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
Conversation
All currently existing WASM targets use some kind of imports by default. This one doesn't.
I do not get it. Why add another mode? Your explanation that:
Does not make sense to me, because |
Can you please describe in more details, the use case/workflow, that is enabled by this, that was not available before, but will be in this PR? |
I did not mean v imports, I meant WASM imports (the imports that the binary does). Browsers mode takes two functions: fn JS.__panic_abort(&u8, int)
fn JS.__writeln(&u8, int) Wasi also takes some: @[wasm_import_namespace: 'wasi_snapshot_preview1']
fn WASM.fd_write(fd FileDesc, iovs &CIOVec, iovs_len usize, retptr &usize) Errno
@[wasm_import_namespace: 'wasi_snapshot_preview1']
@[noreturn]
fn WASM.proc_exit(rval int) |
If you have a custom WASM runtime and can't easily offer the required functions (I am in that situation right now) this is very useful and there aren't any ways to do that at the moment because the requirements are inside the builtins and therefore not removable |
Why not use another mechanism for customization, for example I am afraid, that we already do have too many wasm related modes, and adding more does not look to me like a good idea at all, from a maintenance point of view. |
note that I also made custom comptime flags work with this |
CI seems to have failed during installing dependencies (?), doesn't seem like V even ran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work.
Yes, the CI error is unrelated, and already fixed on master. |
-b wasm -d no_imports
All currently existing WASM targets use some kind of imports by default. This one doesn't.