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

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!