diff options
author | Himbeer <himbeer@disroot.org> | 2024-09-05 14:57:48 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-09-05 14:57:48 +0200 |
commit | f5b38b07c632aea3eff8a82edb838b88eb1aed28 (patch) | |
tree | 9270d5bd37c1748efdd2452d87a606dfb30824b4 | |
parent | 00cedaa996ad6c6f36b22d42a3b3000a7d30df14 (diff) |
Convert the type system documentation to plain text
-rw-r--r-- | TYPE_SYSTEM.md | 25 | ||||
-rw-r--r-- | TYPE_SYSTEM.txt | 28 |
2 files changed, 28 insertions, 25 deletions
diff --git a/TYPE_SYSTEM.md b/TYPE_SYSTEM.md deleted file mode 100644 index fb45232..0000000 --- a/TYPE_SYSTEM.md +++ /dev/null @@ -1,25 +0,0 @@ -<!-- -SPDX-FileCopyrightText: 2024 Himbeer <himbeer@disroot.org> - -SPDX-License-Identifier: CC-BY-NC-SA-4.0 ---> - -# Primitive types - -* int8, uint8 -> QBE b, w -* int16, uint16 -> QBE h, w -* int32, uint32 -> QBE w, w -* int64, uint64 -> QBE l, l - -# Coercion - -* Integer widening - -# Declaration and mutability - -* Variables need to be declared before being used -* All declarations (including globals and implicit declarations from imports) must be above their first use -* Redeclarations ("shadowing") are forbidden -* Variables may be changed using the "assign" statement -* Constants cannot be changed, but mutables can -* Local mutables are allocated on the stack, local constants are QBE temporaries diff --git a/TYPE_SYSTEM.txt b/TYPE_SYSTEM.txt new file mode 100644 index 0000000..53aeb78 --- /dev/null +++ b/TYPE_SYSTEM.txt @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: 2024 Himbeer <himbeer@disroot.org> +// +// SPDX-License-Identifier: CC-BY-NC-SA-4.0 + +- 1. Primitive types +-------------------- + + * int8, uint8 -> QBE b, w + * int16, uint16 -> QBE h, w + * int32, uint32 -> QBE w, w + * int64, uint64 -> QBE l, l + +- 2. Coercion +------------- + + * Integer widening + +- 3. Declaration and mutability +------------------------------- + + * Variables need to be declared before being used + * All declarations (including globals and implicit declarations from imports) + must be above their first use + * Redeclarations ("shadowing") are forbidden + * Variables may be changed using the "assign" statement + * Constants cannot be changed, but mutables can + * Local mutables are allocated on the stack, local constants are QBE + temporaries |