Expose IDL serialisation as primitives
serialize : T -> Blob
deserialise : Blob -> (ex T)
Not sure if these are really a net win, but we discussed this when wondering why testing is currently slow (drun).
How to create existential packages for deserialise, is also not clear, since we have no type reflection.
We'd be facing the same problems as for debug_show, so the best thing we can do right now, I think, is add these as their own AST form. I would not mind them. Maybe prefaced with debug_. Doesn’t scale in the long run.
Also, the types will change once we have references (for the reference array).
Related:
- c6e0ea6df62c3d94f1cadb02a48a6b9f6d7a36ab (exposing this as
prim …) - https://github.com/dfinity-lab/motoko/issues/1655 (thoughts about how to expose this as functions)
- the discussion around non-parametric polymorphism (no issue yet, I think)
We now have to_candid and from_candid, can this be closed? @crusso?