diff options
Diffstat (limited to 'docs/type_system')
| -rw-r--r-- | docs/type_system/gc.md | 35 | ||||
| -rw-r--r-- | docs/type_system/index.md | 2 | ||||
| -rw-r--r-- | docs/type_system/shared.md | 24 | ||||
| -rw-r--r-- | docs/type_system/task.md | 2 | ||||
| -rw-r--r-- | docs/type_system/var.md | 4 |
5 files changed, 39 insertions, 28 deletions
diff --git a/docs/type_system/gc.md b/docs/type_system/gc.md new file mode 100644 index 0000000..3fcf88e --- /dev/null +++ b/docs/type_system/gc.md @@ -0,0 +1,35 @@ +# Gc + +--- + +Hold multiple references to the same object + +```text +Gc[Type; GC_FLAGS] +``` + +# Alias + +```text +Shared[Generic.T] `alias Gc[Generic.T; GC_FLAGS] +``` + +## `GC_FLAGS` + +### Lock Mutex + +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) +``` diff --git a/docs/type_system/index.md b/docs/type_system/index.md index 8aadc98..3601459 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -66,7 +66,7 @@ Denotes that a field that does not resolve to anything * #### [Ref](./ref.md) -* #### [Shared](./shared.md) +* #### [Gc](./gc.md) ## Function Templates diff --git a/docs/type_system/shared.md b/docs/type_system/shared.md deleted file mode 100644 index b6e9ded..0000000 --- a/docs/type_system/shared.md +++ /dev/null @@ -1,24 +0,0 @@ -# Shared - ---- - -```text - -Shared[TYPE] -``` - -# Use in Asynchronous Functions - -# 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) -``` diff --git a/docs/type_system/task.md b/docs/type_system/task.md index 33879b6..e0d9db3 100644 --- a/docs/type_system/task.md +++ b/docs/type_system/task.md @@ -5,7 +5,7 @@ A segment of code assigned to a process, task code can be recursive ```text -Task[TYPE; FN] +Task[TYPE] ``` ## \`await diff --git a/docs/type_system/var.md b/docs/type_system/var.md index 1cab8ed..737263e 100644 --- a/docs/type_system/var.md +++ b/docs/type_system/var.md @@ -3,7 +3,7 @@ --- ```text -Var_class `alias Enum[Void; .arg; .local; .loop; .match] +Var_class `alias Enum[Void; .arg; .local; .loop; .if; .match; .mutate] -Var[Var_class; TYPE; SCOPE; VAR_IDENTIFIER] +Var[Var_class; TYPE; Parent; VAR_IDENTIFIER] ``` |
