wasmtime icon indicating copy to clipboard operation
wasmtime copied to clipboard

What is the reason for the `V128` formatting in Wasmtime's CLI?

Open Robbepop opened this issue 9 months ago • 2 comments

When Wasmtime's CLI returns a v128 value, it is formatted as u128 value. In Wasmi I have made some thoughts about the formatting of v128 values and came to the conclusion that it is probably best to format it as hex-dec number with leading zeros. For example: 0x006E006E61635F6E61635F6E61635F6E

Was there a specific reason Wasmtime chose to format v128 as a simple u128?

Ideally Wasmi has the same formatting as Wasmtime (or more generally: Wasm runtimes share the same formatting), but at this point I find the u128 formatting to be very weird and thus I suppose I am missing something here.

Robbepop avatar Mar 29 '25 16:03 Robbepop

Yeah, I also prefer the hex format; that's what I think of when I'm thinking about lanes. Not sure why we used the u128 formatting. Convenience perhaps?

abrown avatar Mar 29 '25 19:03 abrown

Yeah I think the reason for the current formatting is that prior to v128 everything printed as a number, so "why not also print as a number". I think it'd be reasonable to change as we don't guarantee the formatting at this time.

alexcrichton avatar Mar 31 '25 14:03 alexcrichton