You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been messing with deno_core a bit and I found it a bit strange that JSON ops only work on loosely typed serde_json::Values given serde is capable of directly converting between JSON and Rust types. This can be changed by simply updating the type signatures of json_op_sync/async. Since serde_json::Value implements Deserialize/Serialize, very little code needs to be changed, however as json_op_sync/async are now generic, type inference is broken in some cases (see cli/build.rs:146).
Since the changes required for this feature are so simple, I've made them on a fork of deno (which can be upgraded to a PR if there is interest) for testing. I've also updated the deno_core examples and found that this change removed a lot of boilerplate. Finally, since serde now has more information about the types it is working with, serialization and deserialization should be faster, but I don't have benchmarks to back up that claim. Is there any interest in making this change? Thanks.
The text was updated successfully, but these errors were encountered:
I've been messing with deno_core a bit and I found it a bit strange that JSON ops only work on loosely typed serde_json::Values given serde is capable of directly converting between JSON and Rust types. This can be changed by simply updating the type signatures of json_op_sync/async. Since serde_json::Value implements Deserialize/Serialize, very little code needs to be changed, however as json_op_sync/async are now generic, type inference is broken in some cases (see cli/build.rs:146).
Since the changes required for this feature are so simple, I've made them on a fork of deno (which can be upgraded to a PR if there is interest) for testing. I've also updated the deno_core examples and found that this change removed a lot of boilerplate. Finally, since serde now has more information about the types it is working with, serialization and deserialization should be faster, but I don't have benchmarks to back up that claim. Is there any interest in making this change? Thanks.
The text was updated successfully, but these errors were encountered: