diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-29 20:01:56 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-29 20:01:56 -0500 |
| commit | a68e9a19429b0b5e08800e8ec90be2f7402d9ff3 (patch) | |
| tree | a0b6b6433370a78e674eb56b69a8c01db63139d5 | |
| parent | 69613e6c03809bcb82ffdaee7820df5a0ead7a6f (diff) | |
Update docs and minor bugfix
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | compile.c | 2 | ||||
| -rw-r--r-- | docs/serialization.md | 7 |
3 files changed, 9 insertions, 2 deletions
@@ -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 @@ -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. |
