Stream: git-wasmtime

Topic: wasmtime / issue #4063 Cranelift-object emit_to_file prop...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2022 at 19:11):

InfRandomness opened issue #4063:

Thanks for filing a feature request! Please fill out the TODOs below.

Feature

TODO: Brief description of the feature/improvement you'd like to see in
Cranelift/Wasmtime.

I would like to see in cranelift-object (https://docs.rs/cranelift-object/0.82.3/cranelift_object/struct.ObjectProduct.html#method.emit), where we would create a new function called emit_to_file, essentially passing in a File, and that function would then call https://docs.rs/object/0.27.1/object/write/struct.Object.html#method.emit with the File's buffer.

I think this would be nice instead of having to call ObjectProduct.emit(), and then having to transform the Vec<u8> into a slice to be written into a file;

This may very feel redundant, too

Implementation

TODO: Do you have an implementation plan, and/or ideas for data structures or
algorithms to use? Yes

Alternatives

TODO: What are the alternative implementation approaches or alternative ways to
solve the problem that this feature would solve? How do these alternatives
compare to this proposal?
Transform the Vec<u8> returned by ObjectProduct.emit() into a slice and write it to a file

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2022 at 20:42):

bjorn3 commented on issue #4063:

You can call both product.object.emit() and product.object.write_stream() already.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 22 2022 at 04:53):

InfRandomness closed issue #4063:

Thanks for filing a feature request! Please fill out the TODOs below.

Feature

TODO: Brief description of the feature/improvement you'd like to see in
Cranelift/Wasmtime.

I would like to see in cranelift-object (https://docs.rs/cranelift-object/0.82.3/cranelift_object/struct.ObjectProduct.html#method.emit), where we would create a new function called emit_to_file, essentially passing in a File, and that function would then call https://docs.rs/object/0.27.1/object/write/struct.Object.html#method.emit with the File's buffer.

I think this would be nice instead of having to call ObjectProduct.emit(), and then having to transform the Vec<u8> into a slice to be written into a file;

This may very feel redundant, too

Implementation

TODO: Do you have an implementation plan, and/or ideas for data structures or
algorithms to use? Yes

Alternatives

TODO: What are the alternative implementation approaches or alternative ways to
solve the problem that this feature would solve? How do these alternatives
compare to this proposal?
Transform the Vec<u8> returned by ObjectProduct.emit() into a slice and write it to a file


Last updated: Nov 22 2024 at 16:03 UTC