From 51d055dc7e1a6edbaedb7ea80b1e678eff924fe0 Mon Sep 17 00:00:00 2001 From: nodist Date: Wed, 10 Jun 2026 13:34:38 -0400 Subject: specify type representation --- docs/type_system/shared.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/type_system/shared.md (limited to 'docs/type_system/shared.md') diff --git a/docs/type_system/shared.md b/docs/type_system/shared.md new file mode 100644 index 0000000..db8e6dc --- /dev/null +++ b/docs/type_system/shared.md @@ -0,0 +1,27 @@ +# Shared + +--- + +Hold multiple references to the same object + +```text +Shared[[LOCK] Type] +``` + +### `LOCK` + +The shared type has been detected across asynchronous tasks and needs to lock the mutex on mutation + +# Garbage Collection + +A tracing mark and sweep garbage collector is used + +# Mutating + +```text +x : Shared[Array] $ (1; 2; 3) +^ x {[y] + y `push 4 +} +`log x // Shared[Array[I64]] $ (1; 2; 3; 4) +``` -- cgit v1.2.3