aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--compile.c2
-rw-r--r--docs/serialization.md7
3 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index ca61a18b..6b41144c 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ of many language features or the other example programs/modules in
- [Easy interoperability with C](docs/c-interoperability.md)
- Support for [POSIX threads](docs/threads.tm) and thread-safe message passing
queues over [channels](docs/channels.tm).
-- Built-in data serialization and deserialization for datatypes.
+- Built-in [data serialization and deserialization](docs/serialization.md).
## Dependencies
diff --git a/compile.c b/compile.c
index 33073785..8c82c4bc 100644
--- a/compile.c
+++ b/compile.c
@@ -3717,7 +3717,7 @@ CORD compile_type_info(env_t *env, type_t *t)
type_t *non_optional = Match(t, OptionalType)->type;
return CORD_asprintf("Optional$info(%zu, %zu, %r)", type_size(t), type_align(t), compile_type_info(env, non_optional));
}
- case TypeInfoType: return CORD_all("TypeInfo$info(", CORD_quoted(type_to_cord(Match(t, TypeInfoType)->type)), ")");
+ case TypeInfoType: return CORD_all("Type$info(", CORD_quoted(type_to_cord(Match(t, TypeInfoType)->type)), ")");
case MemoryType: return "&Memory$info";
case VoidType: return "&Void$info";
default:
diff --git a/docs/serialization.md b/docs/serialization.md
index ac3c0bfe..ea21f900 100644
--- a/docs/serialization.md
+++ b/docs/serialization.md
@@ -67,3 +67,10 @@ c.next = @Cycle("B", next=c)
The deserialized version of the data correctly preserves the cycle
(`roundtrip.next.next == roundtrip`). The representation is also very compact:
only 9 bytes for the whole thing!
+
+## Unserializable Types
+
+Unfortunately, not all types can be easily serialized. In particular,
+`Thread`s, types, and functions cannot be serialized because their data
+contents cannot be easily converted to portable byte arrays. All other
+datatypes _can_ be serialized.