Canonical S-expression serialization.
Mirrors Serializer.lean from the Lean 4 proof library.
Serializer.lean