-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weaken Onerous Serialization Restrictions #11
Comments
Pondering this a little more last night, I began wondering what exactly are the things that a value in a compact region are allowed to point to that are outside of its compact region? At the least, it must include the info table. But is that all? What about a CAF? If it’s just the info tables, it might be possible to build a map on the sending side that associates info table pointers with typerep. And then maybe you could clean up those pointers on the receiving end. |
Thinking about this even more, I wonder if it's possible to perform the additional translation step as a separate serialization with the introduction of a variant of |
In
I had forgotten about static data constructors. These would need to be cleaned up on the receiving end as well. |
I did not understand what the term "static constructor" actually meant. I was thinking it was a nullary data constructor. I suspect that the static constructor optimization that CNF allocation does would need to be disabled for what I am proposing to be able to work correctly. |
It might also be possible to fix up those pointers too. But the first problem you have to solve is coming up with a stable name for these things, that is preserved across different binaries... |
Despite my excitement about compact regions ever since it came out, I’ve never actually been able to use it for serialization. The restriction that the server and client be running the exact same binary is huge. It means that you cannot use compact regions to serialize to something like a message bus, where the producer and consumer are almost never running the same code.
What would it take to weaken this requirement, and what would the weaker requirement be? I have pondered a different scheme in which dynamic linking all haskell dependencies is mandatory. The requirement to read a serialized compact regions would be that the types used in the compacted value must come from a shared object that is the same on both systems. That is, the user just have to make sure both applications are dynamically linked to the exact same my-shared-types library.
I suspect that this would be difficult to implement. But I just wanted to get the idea down. I’ve been reading a lot about Cap’n Proto and Flatbuffers lately, and I had started thinking about how great it would be if I could just use the ol’ faithful haskell type system instead of a restricted subset of ADTs (and no GADTs at all)
The text was updated successfully, but these errors were encountered: