Wishing Rust had a way to express limited-size integers other than at the 8/16/32/64 size boundaries.

Even if it was just on arbitrary bit boundaries I'd find it useful in this emulator project, for representing indexes into the register file (u4) or a memory page (u12) to guarantee that additional bounds checks aren't needed on some internal interfaces.

Can probably wrap things into tuple structs that do what I want though, I guess that's the Rust way. :)


@brion especially given LLVM supports arbitrary sized i's and u's

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!