From cbddba8390c73331f8565129aa87dad582efef3f Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Wed, 30 Dec 2020 11:57:50 -0600 Subject: [PATCH] deleted old doc file --- docs/struct_fixes | 49 ----------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 docs/struct_fixes diff --git a/docs/struct_fixes b/docs/struct_fixes deleted file mode 100644 index e9310b70..00000000 --- a/docs/struct_fixes +++ /dev/null @@ -1,49 +0,0 @@ -Currently, there are many janky things about structs in Onyx. I want -to revisit all of the code related to them and fix all the issues I -am having. To recap, here are all of the features that are required -for structs to work: - * #union - * #size - * #align - * `use` members - * struct literals - * polymorphic structs - -All of these features work well individually, but when used together -(such as struct literals over polymoprhic structs), they have many -issues. - -Here is a brief explanation of the current data model: - * AstStruct contains: - - an array of AstStructMembers - - the minimum size - - the minimum alignment - - * AstStructMembers contain: - - A symbol (token) for the name - - the initial value - - * AstStructLiterals contain: - - an array of values (unnamed) - - an array of AstStructMembers representing named values - - * AstPolyStructs contain: - - the base AstStruct - - an array of tokens representing the parameters - - the scope the struct was defined in - -In principle, this is the simple way each of the features should work: - * #union - - use 'max' instead of '+' when computing struct size - - all members have offset 0 - * #size - - the size is the minimum of the size given and the computed size - * #align - - the alignment is the minimum of the alignment given and the computed alignment - * `use` members - - adds members of used type to member list, with proper offsets - * struct literals - - ensures all values needed for the struct are present (no - automatic zero values) - * polymorphic structs - - copy the base struct, introduce the type symbols, resolve symbols, win -- 2.25.1