3 ms·
Also very, very similar to Java's serialization mechanism.
by brazzy 6y ago
Also very, very similar to Java's serialization mechanism.
- nayuki 6y agoIndeed. The book Effective Java dedicates several chapters to how serialization works, what are the pitfalls, and how to avoid them (with care and effort, not automatic).
- dnautics 6y agoBasically every language with a vm with boxed types has to have this. Erlang has term_to_binary, which has some crazy superpowers, like I can serialize a lambda, put it on a pigeon, and have it run on an airgapped machine (assuming any module referenced in the lambda has an equivalently named version in the airgapped VM). Of course you can see how this could also be a security problem if you're not careful. On the other hand, this is part of how erlang distributed systems (which is crazy easy) can communicate with extremely simple semantics, and the security model for erlang distribution is very explicitly "trusted only; locking down the cluster as a single security domain is YOUR responsibilty".