aboutsummaryrefslogtreecommitdiff
path: root/TYPE_SYSTEM.txt
diff options
context:
space:
mode:
Diffstat (limited to 'TYPE_SYSTEM.txt')
-rw-r--r--TYPE_SYSTEM.txt28
1 files changed, 28 insertions, 0 deletions
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