[RFC] Extend bit/byte conversion RFC.

Add an alternative in which we go to methods directly. This seems more likely at
this point, given that we seem to have a fairly simple and quick way to support
methods on scalar types that does not involve turning scalar types into circuit
types.
This commit is contained in:
Alessandro Coglio 2021-08-16 10:44:10 -07:00
parent 87db1bfdb6
commit 6e264b86ef

View File

@ -263,3 +263,14 @@ such as `u64_to_u16s_le`, which would turn a `u64` into a `[u16; 4]`.
In general, it makes sense to convert between `uN` or `iN` and `[uM; P]` when `N == M * P`.
If Leo were extended with types `uN` and `iN` for all positive `N` as proposed elsewhere,
there could be a family of all such conversions.
## Methods Directly
Given that we eventually plan to use methods on scalar types for these conversions,
it may make sense to do that right away.
This is predicated on having support for methods on scalar types,
for which a separate RFC is in the works.
If we decide for this approach, we will revise the above proposal to reflect that.
The concepts and (essential) names and input/output types remain unchanged,
but the conversions are packaged in slightly different form.