hash-org / hashc

The Hash programming language compiler :zap:
https://hash-org.github.io/hashc/
MIT License
26 stars 2 forks source link

storage: shrink direct sequence element ids from `16bytes` to `12bytes` #1032

Closed feds01 closed 1 year ago

feds01 commented 1 year ago

Any thoughts on how to remove a bunch of type casts everywhere?

kontheocharis commented 1 year ago

We should never be able to provide an index explicitly; I believe doing so is unsafe behaviour. We need to find a way to mark it unsafe and change the relevant code that explicitly constructs direct sequence element IDs so that it doesn't handle indices directly.

feds01 commented 1 year ago

We should never be able to provide an index explicitly; I believe doing so is unsafe behaviour. We need to find a way to mark it unsafe and change the relevant code that explicitly constructs direct sequence element IDs so that it doesn't handle indices directly.

They have to be constructed somewhere, and sometimes its just mapping things from one type to another. I agree in general that it should be avoided, but without more annoyances. Any suggestions?