-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Marshal via arrays #146
Comments
Implemented in https://github.com/elringus/bootsharp/tree/arch/marshal-via-arrays. After testing, it doesn't seem worth it, as perf and min build size are roughly the same, while it adds more pressure to GC due to array allocations and it's not clear whether it's possible to support recursive types marshaling. It also adds limitations on the init scenarios of the marshaled types, eg it's not possible to use constructor overloads, as we're not storing parameter names. |
Instead of JSON, explore marshaling via arrays, similar to Embind (https://emscripten.org/docs/porting/connecting_cpp_and_javascript/embind.html#value-types), eg:
And the other way around:
— returns in JavaScript:
["foo",5,true,["bar",6,false,null]]
.Should probably be postponed until #138 is solved; otherwise, we'll break interop with tasks of custom data types, that are currently serialized to JSON.We can actually send arrays as objects:
— the task value is transferred to JavaScript as
["foo",7,true,["bar",8,false,null]]
.The text was updated successfully, but these errors were encountered: