diff options
| author | nodist <kevin.comas.git@gmail.com> | 2026-07-11 19:52:56 -0400 |
|---|---|---|
| committer | nodist <kevin.comas.git@gmail.com> | 2026-07-11 19:52:56 -0400 |
| commit | 730faa451fbc3e7ae37c8a3b32b9d4d99007c666 (patch) | |
| tree | 52bf7f4941b3d51bba67adf3b96e24753edb6ed9 /docs | |
| parent | 20106935981d50971da0a7708a5bfdbec256049c (diff) | |
remove compressed pointers
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/application/identifier.md | 4 | ||||
| -rw-r--r-- | docs/application/interface.md | 6 | ||||
| -rw-r--r-- | docs/application/namespace.md | 13 | ||||
| -rw-r--r-- | docs/application/thread.md | 2 | ||||
| -rw-r--r-- | docs/application/type.md | 29 | ||||
| -rw-r--r-- | docs/language/index.md | 6 | ||||
| -rw-r--r-- | docs/lifecycle/parse.md | 6 | ||||
| -rw-r--r-- | docs/type_system/function.md | 2 | ||||
| -rw-r--r-- | docs/type_system/group.md | 2 | ||||
| -rw-r--r-- | docs/type_system/ir.md | 2 | ||||
| -rw-r--r-- | docs/type_system/list.md | 2 | ||||
| -rw-r--r-- | docs/type_system/lock.md | 2 | ||||
| -rw-r--r-- | docs/type_system/map.md | 2 | ||||
| -rw-r--r-- | docs/type_system/name.md | 2 | ||||
| -rw-r--r-- | docs/type_system/op.md | 2 | ||||
| -rw-r--r-- | docs/type_system/overload.md | 2 | ||||
| -rw-r--r-- | docs/type_system/select.md | 2 | ||||
| -rw-r--r-- | docs/type_system/symbol.md | 2 | ||||
| -rw-r--r-- | docs/type_system/task.md | 2 | ||||
| -rw-r--r-- | docs/type_system/union.md | 2 | ||||
| -rw-r--r-- | docs/type_system/value.md | 5 | ||||
| -rw-r--r-- | docs/type_system/var.md | 5 |
22 files changed, 44 insertions, 58 deletions
diff --git a/docs/application/identifier.md b/docs/application/identifier.md index 47dcd79..ed4f3e7 100644 --- a/docs/application/identifier.md +++ b/docs/application/identifier.md @@ -7,9 +7,9 @@ Store vars, types and symbols as compressed strings ## Object Definitions ```c -#define KPL_IDENTIFIER_PARTS 6 +#define KPL_IDENTIFIER_PARTS 5 -// TODO 60 charaters of [A-Za-z0-9_] in 48 bytes +// TODO 50 charaters of [A-Za-z0-9_] in 40 bytes typedef struct { uint64_t parts[KPL_IDENTIFIER_PARTS]; diff --git a/docs/application/interface.md b/docs/application/interface.md index 9a7fa22..de9eebe 100644 --- a/docs/application/interface.md +++ b/docs/application/interface.md @@ -49,12 +49,6 @@ kpl_result kpl_result_error(error *er); kpl_result kpl_result_null(void); kpl_result kpl_result_value(any value); - -typdef struct { - uint16_t slab_index, array_index; -} kpl_ptr; - -#define KPL_PTR_NULL (kpl_ptr) { .slab_index = UINT16_MAX, .array_index = UINT16_MAX } ``` ## `kpl_interface` diff --git a/docs/application/namespace.md b/docs/application/namespace.md index ac382de..f8653f7 100644 --- a/docs/application/namespace.md +++ b/docs/application/namespace.md @@ -6,13 +6,13 @@ ```c typedef struct _kpl_export { - size_t tree_weight; + int32_t tree_weight; struct _kpl_export *tree_left, *tree_right; - kpl_type_ptr type; + kpl_type *type; } kpl_export; typedef struct _kpl_namespace_native { - size_t tree_weight; + int32_t tree_weight; struct _kpl_namespace_native *tree_left, *tree_right; const char *name; kpl_export *export_tree; @@ -21,12 +21,13 @@ typedef struct _kpl_namespace_native { static kpl_namespace_native *namespace_native_tree; typedef struct _kpl_namespace_module { - size_t tree_weight; + uint32_t module_id; + int32_t tree_weight; struct _kpl_namespace_module *tree_left, *tree_right; kpl_buffer *module_string, *module_name; kpl_export *export_tree; kpl_mutex export_mutex; - kpl_type_ptr ast; + kpl_type *ast; } kpl_namespace_module; static kpl_namespace_module *namespace_module_tree; @@ -34,6 +35,8 @@ static kpl_namespace_module *namespace_module_tree; kpl_mutex namespace_modul_tree_mutex; static kpl_namespace_module namespace_string; + +static kpl_namespace_module *module_array[KPL_MODULE_SIZE]; // module_id refers to index ``` Each `NAMESPACE_IDENTIFIER` maps to `kpl_namespace_native*` or `kpl_namespace_module*` depending on flags diff --git a/docs/application/thread.md b/docs/application/thread.md index 956c8ff..e5b3981 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -33,8 +33,6 @@ typedef struct { } dummy; } kpl_task_queue; -// TODO RING BUFFER ALLOCATOR - typedef struct { kpl_task_queue queue; _Atomic size_t priority; diff --git a/docs/application/type.md b/docs/application/type.md index bb9534b..25a5863 100644 --- a/docs/application/type.md +++ b/docs/application/type.md @@ -21,28 +21,21 @@ typedef union { // 64 Bytes Max } kpl_type_body; -typedef struct { +typedef struct _kpl_type { kpl_type_template template; uint8_t qualifiers; uint16_t modifiers; - uint16_t token_length, token_line; - uint32_t token_position; + union { + struct { + uint16_t length, line; + uint32_t position, module_id; + } token; + struct { + int32_t id, tree_weight; + } var; + } meta; _Atomic int32_t ref_count; - kpl_ptr self, prev, next; - kpl_namespace_module *module; + struct _kpl_type *prev, *next; kpl_type_body body; } kpl_type; - -uint16_t array_index, slab_count; - -typedef struct _kpl_type_slab { - struct _kpl_type_slab *next; - kpl_type array[UINT16_MAX]; -} kpl_type_slab; - -kpl_type_slab *type_slab; - -kpl_ptr type_pool; - -kpl_mutex type_mutex; ``` diff --git a/docs/language/index.md b/docs/language/index.md index 85d1a04..1f50a17 100644 --- a/docs/language/index.md +++ b/docs/language/index.md @@ -76,13 +76,13 @@ Start with a lowercase letter Variables starting with `_` are treated as unused -### Variables names have a 60 character limit +### Variables names have a 50 character limit ## Type Names Start with an uppercase letter created with either \`alias or \`unique -### Type names have a 60 character limit +### Type names have a 50 character limit ## Type Qualifiers @@ -117,7 +117,7 @@ Start with a `.` .symbol ``` -### Symbols have a 60 character limit +### Symbols have a 50 character limit # Lists diff --git a/docs/lifecycle/parse.md b/docs/lifecycle/parse.md index 1016a28..4bfa6ba 100644 --- a/docs/lifecycle/parse.md +++ b/docs/lifecycle/parse.md @@ -14,13 +14,13 @@ Build initial AST ## Char `'\\?.' -# Name `[_a-z][a-zA-z0-9_]{0,59}` +# Name `[_a-z][a-zA-z0-9_]{0,49}` -# Type `[A-Z][a-zA-z0-9_]{0,59}` +# Type `[A-Z][a-zA-z0-9_]{0,49}` On type completion look up if type is a builtin -# Symbol `\.[a-zA-z0-9_]{0,60}` +# Symbol `\.[a-zA-z0-9_]{0,50}` # Op diff --git a/docs/type_system/function.md b/docs/type_system/function.md index d972b57..bca4c7e 100644 --- a/docs/type_system/function.md +++ b/docs/type_system/function.md @@ -18,7 +18,7 @@ Function[[MODE | STATELESS | STATEFUL]; JIT; IR; Body; INVOCATION_LIST; RETURN_T ```c typedef struct { void *jit; - kpl_ptr ir, body, invocation_list, return_type, var_list; + kpl_type *ir, *body, *invocation_list, *return_type, *var_list; } kpl_type_body_function; ``` diff --git a/docs/type_system/group.md b/docs/type_system/group.md index 213e3e0..0664276 100644 --- a/docs/type_system/group.md +++ b/docs/type_system/group.md @@ -12,7 +12,7 @@ Group[[INDEX | SYMBOL] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] ```c typedef struct { - kpl_ptr var_tree, var_list; + kpl_type *var_tree, *var_list; } kpl_type_body_group; ``` diff --git a/docs/type_system/ir.md b/docs/type_system/ir.md index 5593bc3..77c6139 100644 --- a/docs/type_system/ir.md +++ b/docs/type_system/ir.md @@ -12,6 +12,6 @@ Ir[[IR_NAME] Address[3]] ```c typedef struct { - kpl_ptr address[3]; + kpl_type *address[3]; } kpl_type_body_ir; ``` diff --git a/docs/type_system/list.md b/docs/type_system/list.md index b3c6dd7..518727e 100644 --- a/docs/type_system/list.md +++ b/docs/type_system/list.md @@ -10,6 +10,6 @@ List[[ROOT | STATEMENT | DEFINE | ACTION | LOOP | IF | MATCH | MUTATION] PARENT; ```c typedef struct { - kpl_ptr parent, target, defined, named, var_tree, statement_list; + kpl_type *parent, *target, *defined, *named, *var_tree, *statement_list; } kpl_type_body_list; ``` diff --git a/docs/type_system/lock.md b/docs/type_system/lock.md index d03dbfa..151c1aa 100644 --- a/docs/type_system/lock.md +++ b/docs/type_system/lock.md @@ -10,7 +10,7 @@ Lock[[] TARGET] ```c typedef struct { - kpl_ptr target; + kpl_type *target; } kpl_type_body_lock; ``` diff --git a/docs/type_system/map.md b/docs/type_system/map.md index 839d511..adf227d 100644 --- a/docs/type_system/map.md +++ b/docs/type_system/map.md @@ -10,7 +10,7 @@ Map[[] KEY_TYPE; VALUE_TYPE] ```c typedef struct { - kpl_ptr key, value; + kpl_type *key, *value; kpl_interface *interface; } kpl_type_body_map; ``` diff --git a/docs/type_system/name.md b/docs/type_system/name.md index 1f0c332..b329521 100644 --- a/docs/type_system/name.md +++ b/docs/type_system/name.md @@ -10,7 +10,7 @@ Name[[UNKNOWN | DATA_TYPE | ALIAS_TYPE | UNIQUE_TYPE] TYPE; IDENTIFIER] ```c typedef struct { - kpl_ptr type; + kpl_type *type; kpl_interface identifier; } kpl_type_body_name; ``` diff --git a/docs/type_system/op.md b/docs/type_system/op.md index f9b2173..f5b935a 100644 --- a/docs/type_system/op.md +++ b/docs/type_system/op.md @@ -12,5 +12,5 @@ Op[[OP_NAME] RETURN_TYPE; LEFT_TYPE; RIGHT_TYPE] ```c typedef struct { - kpl_ptr return_type, statement_left, statement_right; + kpl_type *return_type, *statement_left, *statement_right; } kpl_type_body_op; diff --git a/docs/type_system/overload.md b/docs/type_system/overload.md index bc083e2..467d898 100644 --- a/docs/type_system/overload.md +++ b/docs/type_system/overload.md @@ -12,7 +12,7 @@ Overload[[] Collection[VAR_LIST; Function[]]] ```c typedef struct { - kpl_ptr var_list; + kpl_type *var_list; } kpl_type_body_overload; ``` diff --git a/docs/type_system/select.md b/docs/type_system/select.md index e68fc32..85528e0 100644 --- a/docs/type_system/select.md +++ b/docs/type_system/select.md @@ -12,7 +12,7 @@ Select[[SINGLE | MULTIPLE] Type; Collection[VAR_TREE_LIST; .symbol : %const Valu ```c typedef struct { - kpl_ptr var_tree, var_list; + kpl_type *var_tree, *var_list; } kpl_type_body_select; ``` diff --git a/docs/type_system/symbol.md b/docs/type_system/symbol.md index ae5595f..da8faa7 100644 --- a/docs/type_system/symbol.md +++ b/docs/type_system/symbol.md @@ -10,7 +10,7 @@ Symbol[[] TYPE; TARGET; IDENTIFIER] ```c typedef struct { - kpl_ptr type, target; + kpl_type *type, *target; kpl_identifier identifier; } kpl_type_body_symbol; ``` diff --git a/docs/type_system/task.md b/docs/type_system/task.md index ae547b2..56d232c 100644 --- a/docs/type_system/task.md +++ b/docs/type_system/task.md @@ -12,7 +12,7 @@ Task[[] TYPE] ```c typedef struct { - kpl_ptr type; + kpl_type *type; kpl_interface *interface; } kpl_type_body_task; ``` diff --git a/docs/type_system/union.md b/docs/type_system/union.md index 1bc84da..26429f1 100644 --- a/docs/type_system/union.md +++ b/docs/type_system/union.md @@ -10,7 +10,7 @@ Union[TAG | TRANSIENT] Collection[VAR_TREE_LIST; TYPE.SYMBOL]] ```c typedef struct { - kpl_ptr var_tree, var_list; + kpl_type *var_tree, *var_list; } kpl_type_body_union; ``` diff --git a/docs/type_system/value.md b/docs/type_system/value.md index 19b150a..5f50794 100644 --- a/docs/type_system/value.md +++ b/docs/type_system/value.md @@ -3,15 +3,14 @@ --- ```text -Value[[] TYPE; ID; KPL_CLASS] +Value[[] TYPE; KPL_CLASS] ``` ## Type Body Object Definitions ```c typedef struct { - kpl_ptr type; - int32_t id; + kpl_type *type; kpl_class *class; } kpl_type_body_value; ``` diff --git a/docs/type_system/var.md b/docs/type_system/var.md index 1a5119f..8af2da5 100644 --- a/docs/type_system/var.md +++ b/docs/type_system/var.md @@ -3,15 +3,14 @@ --- ```text -Var[[SYMBOL | SCOPE | ARG | LOCAL | LOOP | IF | MATCH | MUTATE] TYPE; LEFT_VAR; RIGHT_VAR; TREE_WEIGHT; IDENTIFIER] +Var[[SYMBOL | SCOPE | ARG | LOCAL | LOOP | IF | MATCH | MUTATE] TYPE; LEFT_VAR; RIGHT_VAR; IDENTIFIER] ``` ## Type Body Object Definition ```c typedef struct { - kpl_ptr type, tree_left, tree_right; - uint32_t tree_weight; + kpl_type *type, *tree_left, *tree_right; kpl_identifier identifier; } kpl_type_body_var; ``` |
