mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[Feature Request] Add `endianness` to `TargetInfo`

Open lsh opened this issue 1 year ago • 1 comments

Review Mojo's priorities

What is your request?

I believe getting the endianness of a target is useful for working with binary data and the like.
This method could look something like:

struct Endianness:
    alias little = 0
    alias big = 1

# in TargetInfo
fn endianness() -> Endianness:


### What is your motivation for this change?

```shell
Knowing if a target wants little or big endian is useful when working with binary data.

Any other details?

No response

lsh avatar May 29 '23 20:05 lsh

Sounds like a great suggestion and is simple to implement. Thanks

abduld avatar May 29 '23 21:05 abduld