github-actions[bot] commented on Issue #1436:
Subscribe to Label Action
This issue or pull request has been labeled: "cranelift"
<details> <summary>Users Subscribed to "cranelift"</summary>
- @bnjbvr
</details>
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
alexcrichton commented on Issue #1436:
allow running CLIF functions with varied signatures
I think this is relatively nontrivial unfortunately. If you statically know the function signature it's significantly more easy since you know what to transmute to and how to pass arguments, but a completely dynamic function signature will require a jit stub one way or another. For example in wasmtime if you use
Func::new
we have to create a jit stub which matches a known ABI (passing everything via pointers) to a dynamic ABI (the one specified at runtime viaFunc::new
).If you want to support a small set of signatures you could probably create something like a hash set of shims and make it pretty easily with some macros/traits, but if you want to support "given this list of string arguments from the CLI, parse them and call this jit function" it'll be more involved b/c you'll need to jit a stub at that point.
abrown commented on Issue #1436:
Thanks @alexcrichton for the comment and discussion on Zulip. Yeah, I think I understand what it would take to JIT-compile trampoline-like functions to implement the "given this list of string arguments from the CLI, parse them and call this jit function" idea.
I think this PR still makes sense then as a precursor to that. @alexcrichton, how do you feel about reviewing this Cranelift stuff?
alexcrichton commented on Issue #1436:
Ah sorry I don't know much about the cranelift parser so it may be best for someone else to take a look at that
Last updated: Nov 22 2024 at 16:03 UTC