Closed uncomputable closed 3 months ago
Done reviewing 490e388e1eea1882239b52eb753407b008ace1a6. I guess this is ok. Rust's awful support for hexadecimal literals is one of its worst syntactic problems, and possibly the only one that has continually bothered me for over a decade without ever getting better or my getting acclimated to it.
So I guess, if this is the only compromise we make for "Rust compatibility" that's okay.... but it's a really big compromise and it makes me want to drop that goal, so we should be mindful if we find ourselves making other bad syntactic choices like this.
ACK other than grammar nits.
I expect that Simfony will never be 100% syntactic Rust because of missing generics or something else that Simfony doesn't support. There will be a mechanical translation of Simfony source code to Rust source code, where we could also convert longer hex literals into shorter, Rust-compatible ones.
I was planning to remove u256
in favor of [u8; u32]
or more specialized types like PublicKey
, but I just realized that this will make Simplicity's 256-bit arithmetic jets really hard to use. It is really annoying to manipulate 256-bit values in Rust. So, I chose to keep u256
and its hex literals.
Make byte strings compatible with Rust by disallowing nibbles and strings longer than 16 bytes. Display erratic length for easier debugging. Allow underscores for visual separation inside the string.