HigherOrderCO/hvm-64

add support for floats

Closed this issue · 0 comments

Depends on #109

I'm making this a separate issue because I think there are more open questions in the design of this.

IMO, floats should have a separate tag at runtime, so that they can be read back correctly. Blurring the edges with the numeric types slightly is fine, IMO, because converting between the representations is easy, but reading back floats as integers is unacceptably opaque IMO.

Luckily, there is room for another tag in the tag enum, so I'd propose we add an F32 tag.

The floating point ops should also be represented as separate ops.

I'm flexible on what the behavior is for using ints in float ops and vice versa; whether that's reinterpreting the bits or casting the value between the types.