Date: Wed, 3 Sep 2025 21:35:42 -0400
On Wed, Sep 3, 2025 at 2:57 PM Tiago Freire <tmiguelf_at_[hidden]> wrote:
>
> You can also do this:
>
> auto val = compute_sha(...);
>
> making _BitInt useless, don't need it, I just need whatever the actual concrete type "compute_sha" is returning.
> You haven't so much "got a type to be able to compute sha 384" but more like "look at this type that I used to copy data into".
Why would `compute_sha` not return a _BitInt(384)?
> > "The machine" is relevant to that conversation, but only to the extent that we can ensure that `_BitInt`'s definition does not prevent the compiler/machine from providing optimizations that the user needs.
>
> But that's precisely my point. _BitInt is a concept that is disconnected from any machine that actually exists.
> It doesn't matter how you interpret your programming language, the compiler cannot magically make the machine do something that it can't physically do just because that's how you coded it.
If the machine the compiler is compiling for has registers or other
constructs for handling 384-bit integers, then it certainly can assign
a `_BitInt(384)` to such a register if it sees fit.
>
> You can also do this:
>
> auto val = compute_sha(...);
>
> making _BitInt useless, don't need it, I just need whatever the actual concrete type "compute_sha" is returning.
> You haven't so much "got a type to be able to compute sha 384" but more like "look at this type that I used to copy data into".
Why would `compute_sha` not return a _BitInt(384)?
> > "The machine" is relevant to that conversation, but only to the extent that we can ensure that `_BitInt`'s definition does not prevent the compiler/machine from providing optimizations that the user needs.
>
> But that's precisely my point. _BitInt is a concept that is disconnected from any machine that actually exists.
> It doesn't matter how you interpret your programming language, the compiler cannot magically make the machine do something that it can't physically do just because that's how you coded it.
If the machine the compiler is compiling for has registers or other
constructs for handling 384-bit integers, then it certainly can assign
a `_BitInt(384)` to such a register if it sees fit.
Received on 2025-09-04 01:35:54