-
Notifications
You must be signed in to change notification settings - Fork 41
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
Implement circular reference support as a msgpack D language extension #7
Comments
It's a interesting thing. But currently MessagePack itself is now discussing the format specification. Please wait until this discussion is finished. |
Sure thing, I actually saw that discussion before (it's huge) and thought it might be relevant to this. I guess you could bring this topic up with the msgpack team if it's relevant to them. |
https://github.com/msgpack/msgpack/blob/master/spec.md New MessagePack format supports ext type with serveral sizes. |
That's awesome to hear. I really think msgpack-d could become a de-facto library to use for serialization in D. There are other efforts of course, but they all seem to be very complicated and slow. |
Is there any update on that? Dealing with circular references would make serialization a whole lot easier for client code |
Here's a minimal test case: class A{B b;}
class B{A a;}
void main(){
auto a=new A;
auto b=new B;
a.b=b;
b.a=a;
auto data = pack(a);//CRASHES
auto a2 = unpack!A(data);
assert(a2.b.a==a2);
} |
hacked the code to make it work; i can try to make a pull request if anyone is still interested |
Originally filed here: Msgpack-81
A first implementation is provided in this tree: ClassRefs (not tested with latest compiler yet).
I think we should consider implementing the feature as some sort of msgpack extension. Since msgpack-d is very fast, supports binary serialization (Orange doesn't), and is a small codebase with no dependencies it would be a net-win if we supported this even if it's only an extension.
The text was updated successfully, but these errors were encountered: