diff options
34 files changed, 316 insertions, 199 deletions
diff --git a/docs/application/buffer.md b/docs/application/buffer.md index 92de6ae..40c58e4 100644 --- a/docs/application/buffer.md +++ b/docs/application/buffer.md @@ -6,16 +6,20 @@ ```c typedef struct _kpl_buffer { - KPL_ALLOC_HEADER(struct _kpl_buffer); - size_t byte_length : KPL_ALLOC_POOL_SIZE; - int32_t io_register_index : KPL_ALLOC_WEIGHT; + KPL_DYNAMIC_OBJ_HEADER(); + int32_t byte_length; kpl_interface *interface; + int16_t io_register_index; uint8_t bytes[]; } kpl_buffer; + +typedef struct { + // TODO RING BUFFERS BY POWERS OF TWO +} kpl_buffer_registered_pool; ``` -## Io uring buffer register +## Io uring buffer sparse register -### Set `io_register_index` to -1 of not used +### Set `io_register_index` to -1 if not used ## Unicode Methods diff --git a/docs/application/error.md b/docs/application/error.md index e6fae17..f0d844a 100644 --- a/docs/application/error.md +++ b/docs/application/error.md @@ -6,9 +6,8 @@ ```c typedef struct _kpl_error { - KPL_SLAB_HEADER(struct _kpl_error); + int32_t line; char *file, *function; kpl_class class; - int32_t line; } kpl_error; ``` diff --git a/docs/application/group.md b/docs/application/group.md index 65566b7..1294afe 100644 --- a/docs/application/group.md +++ b/docs/application/group.md @@ -6,7 +6,7 @@ ```c typedef struct _kpl_group { - KPL_ALLOC_HEADER(struct _kpl_group); + KPL_DYNAMIC_OBJ_HEADER(); kpl_class items[]; } kpl_group; ``` diff --git a/docs/application/index.md b/docs/application/index.md index 01287b1..e315baf 100644 --- a/docs/application/index.md +++ b/docs/application/index.md @@ -33,10 +33,14 @@ ## Startup 1. Configuration + * `thread_count` - defaults to number of available processors 2. Initialize tasks 2. Initialize allocators + * Slab sizes 4. Initialize types + * Built In Alias 5. Initialize IO + * Size of registered sparse buffers ## Main diff --git a/docs/application/interface.md b/docs/application/interface.md index 831090b..9a7fa22 100644 --- a/docs/application/interface.md +++ b/docs/application/interface.md @@ -22,15 +22,7 @@ typedef union { void *ptr; } kpl_any; -typedef size_t kpl_any_hash_fn(const kpl_any a); - -typedef ssize_t kpl_any_cmp_fn(const kpl_any a, const kpl_any b); - -typedef int32_t kpl_write(const kpl_ant a, FILE *file, int32_t idnt, uint32_t opts); - -// TODO GC FUNCTION - -typedef void kpl_any_free_fn(kpl_any a); +typedef void kpl_interface_free(kpl_any a); typedef struct { // TODO @@ -38,7 +30,7 @@ typedef struct { typedef struct { kpl_any *any; - kpl_interface *interflace; + kpl_interface *interface; } kpl_class; typedef enum : uint8_t { @@ -66,3 +58,5 @@ typdef struct { ``` ## `kpl_interface` + +See [Operators](../language/operators.md) diff --git a/docs/application/io.md b/docs/application/io.md index 9ab786c..a292718 100644 --- a/docs/application/io.md +++ b/docs/application/io.md @@ -1,5 +1,39 @@ -# Io +# Io (io_uring) --- -All Io is done through linux io uring +# Design + +## Io Ring + +## Fixed Buffers + +## Fixed Files + +## Buffer Rings + +# Io Tasks + +Tasks for each IO operation are stored in the `user_data` field + +## Ring Submission `struct io_uring_sqe` + +## Ring Completion `struct io_uring_cqe` + +# Usage + +## File + +### Open + +### Statx + +### Read + +### Write + +## Directory + +## Timers + +## Network diff --git a/docs/application/map.md b/docs/application/map.md index 01ba57f..18fa7a8 100644 --- a/docs/application/map.md +++ b/docs/application/map.md @@ -6,13 +6,13 @@ ```c typedef struct _kpl_map_bucket { - KPL_SLAB_LIST_HEADER(struct _kpl_map_bucket); + struct _kpl_map_bucket *prev, *next; kpl_any key, value; } kpl_map_bucket; typedef struct _kpl_map { - KPL_ALLOC_HEADER(struct _kpl_map); - uint32_t used_buckets, available_buckets; + KPL_DYNAMIC_OBJ_HEADER(); + int32_t available_buckets; kpl_interface *key_interface, *value_interface; kpl_map_bucket *head, *tail; kpl_map_bucket *buckets[]; diff --git a/docs/application/memory.md b/docs/application/memory.md index e7f05ba..44a3786 100644 --- a/docs/application/memory.md +++ b/docs/application/memory.md @@ -1,151 +1,39 @@ -# Memory Pool +# Memory --- -## Object Definitions - -```c -#define KPL_ALLOC_POOL_SIZE 40 - -#define KPL_ALLOC_WEIGHT 24 - -#define KPL_ALLOC_HEADER(STRCUT) size_t obj_size : KPL_ALLOC_POOL_SIZE; uint32_t tree_weight : KPL_ALLOC_WEIGHT; STRCUT *prev - -typedef struct _kpl_alloc_obj { - KPL_ALLOC_HEADER(_kpl_alloc_obj); -} kpl_alloc_obj; - -#define KPL_ALLOC_TREE_HEADER(STRCUT) KPL_ALLOC_HEADER(STRUCT); STRUCT *next; - -typdef struct _kpl_alloc_tree_obj { - KPL_ALLOC_TREE_HEADER(struct _kpl_alloc_tree_obj); -} kpl_alloc_tree_obj; +An allocator per Object definition with ring buffer pooling based -typedef struct kpl_alloc { - _Atomic size_t bytes_allocated; - kpl_mutex mutex; - kpl_alloc_obj *pool[KPL_ALLOC_POOL_SIZE] -} kpl_alloc; +# Single Allocation -#define KPL_SLAB_HEADER(STRUCT) STRCUT *prev +Once created never freed until shutdown -typdef strcut _kpl_slab_obj { - KPL_SLAB_HEADER(strcut _kpl_slab_obj); -} kpl_slab_obj; +# Pooling Allocations -#define KPL_SLAB_LIST_HEADER(STRCUT) STRCUT *prev, *next +## Ring Buffer -typdef strcut _kpl_slab_list_obj { - KPL_SLAB_LIST_HEADER(strcut _kpl_slab_list_obj); -} kpl_slab_list_obj; +## Fixed Sized Objects -#define KPL_SLAB_TREE_HEADER(STRUCT) STRUCT *prev, *next; uint32_t tree_weight : KPL_ALLOC_WEIGHT +## Dynamic Sized Objects -typdef strcut _kpl_slab_tree_obj { - KPL_SLAB_TREE_HEADER(struct _kpl_slab_tree_obj); -} kpl_slab_tree_obj; +Dynamically sized objects must be aligned to a power of two -typdef struct _kpl_slab_bucket { - struct _kpl_slab_bucket *next; - uint8_t byte_obj_array[]; -} kpl_slab_bucket; +Requires a ring buffer for each power of two -typedef struct _kpl_slab { - uint16_t obj_count, obj_index; - uint32_t obj_size; - kpl_slab_obj *pool; - kpl_slab_bucket *bucket; - kpl_mutex mutex; -} kpl_slab; -``` - -# Alloc - -All allocated objects size must be aligned to the power of two - -## Pooling - -Each bucket in the `kpl_alloc.pool` represents two to the power of the bucket index +## Object Definitions -# Slab +```c +#define KPL_DYANMIC_OBJ_MIN_BITS 7 -## Pooling +#define KPL_DYNAMIC_OBJ_MAX_BITS 27 -Objects for reuse are stored as a list by the `kpl_slab_obj.prev` on `kpl_slab.pool` +#define KPL_DYNAMIC_OBJ_MIN_SIZE (1 << KPL_DYANMIC_OBJ_MIN_BITS) -# AVL Tree For Slab And Alloc +#define KPL_DYNAMIC_OBJ_MAX_SIZE (1 << KPL_DYNAMIC_OBJ_MAX_BITS) -## AVL Tree Example +#define KPL_DYNAMIC_OBJ_HEADER() int32_t obj_size; -```c -typedef struct _avl { - int val, count; - struct _avl *left, *right; -} avl; - - -int get_count(const avl *node) { - return node ? node->count : 0; -} - -int get_balance(const avl *node) { - if (!node) - return 0; - return get_count(node->left) - get_count(node->right); -} - -void right_rotate(avl **right) { - avl *left = (*right)->left, *left_right = left->right; - left->right = *right; - (*right)->left = left_right; - (*right)->count = MAX(get_count((*right)->left), get_count((*right)->right)) + 1; - left->count = MAX(get_count(left->left), get_count(left->right)) + 1; - *right = left; -} - -void left_rotate(avl **left) { - avl *right = (*left)->right, *right_left = right->left; - right->left = *left; - (*left)->right = right_left; - (*left)->count = MAX(get_count((*left)->left), get_count((*left)->right)) + 1; - right->count = MAX(get_count(right->left), get_count(right->right)) + 1; - *left = right; -} - -void insert(avl **parent, avl *node) { - if (!*parent) { - *parent = node; - return; - } - if (node->val < (*parent)->val) - insert(&(*parent)->left, node); - else - insert(&(*parent)->right, node); - (*parent)->count = MAX(get_count((*parent)->left), get_count((*parent)->right)) + 1; - int balance = get_balance(*parent); - if (balance > 1 && get_balance((*parent)->left) >= 0) - right_rotate(parent); - if (balance > 1 && get_balance((*parent)->left) > 0) { - left_rotate(&(*parent)->left); - right_rotate(parent); - } - if (balance < -1 && get_balance((*parent)->right) <= 0) - left_rotate(parent); - if (balance < -1 && get_balance((*parent)->right) > 0) { - right_rotate(&(*parent)->right); - left_rotate(parent); - } -} - -struct TreeNode* sortedListToBST(struct ListNode* head) { - avl *root = NULL; - while (head) { - avl *node = calloc(1, sizeof(avl)); - node->val = head->val; - node->count = 1; - head = head->next; - insert(&root, node); - } - return (struct TreeNode*) root; -} +typedef struct { + KPL_DYNAMIC_OBJ_HEADER(); +} kpl_dynamic_obj; ``` diff --git a/docs/application/namespace.md b/docs/application/namespace.md index c6b8cea..ac382de 100644 --- a/docs/application/namespace.md +++ b/docs/application/namespace.md @@ -6,28 +6,27 @@ ```c typedef struct _kpl_export { - KPL_SLAB_TREE_HEADER(struct _kpl_export); + size_t tree_weight; + struct _kpl_export *tree_left, *tree_right; kpl_type_ptr type; } kpl_export; typedef struct _kpl_namespace_native { - KPL_SLAB_TREE_HEADER(struct _kpl_namespace_native); + size_t tree_weight; + struct _kpl_namespace_native *tree_left, *tree_right; const char *name; kpl_export *export_tree; } kpl_namespace_native; -static kpl_namespace_native namespace_native_tree; - -typedef enum : uint8_t { - // ... -} namespace_lifecycle; +static kpl_namespace_native *namespace_native_tree; typedef struct _kpl_namespace_module { - KPL_SLAB_TREE_HEADER(struct _kpl_namespace_module); - kpl_type_ptr ast; + size_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_namespace_module; static kpl_namespace_module *namespace_module_tree; @@ -93,3 +92,80 @@ Since the native modules are loaded statically the `native_module_tree` becomes 2. Add a get export task to the namespaces `export_mutex` 3. The `export_mutex` will not start processing it's queue until the namespace notifies that it's and unlocks its `export_mutex` 4. The importer will get a copy of the read only `export_tree` + +# AVL Tree Storage and Lookup + +## AVL Tree Example + +```c +typedef struct _avl { + int val, count; + struct _avl *left, *right; +} avl; + + +int get_count(const avl *node) { + return node ? node->count : 0; +} + +int get_balance(const avl *node) { + if (!node) + return 0; + return get_count(node->left) - get_count(node->right); +} + +void right_rotate(avl **right) { + avl *left = (*right)->left, *left_right = left->right; + left->right = *right; + (*right)->left = left_right; + (*right)->count = MAX(get_count((*right)->left), get_count((*right)->right)) + 1; + left->count = MAX(get_count(left->left), get_count(left->right)) + 1; + *right = left; +} + +void left_rotate(avl **left) { + avl *right = (*left)->right, *right_left = right->left; + right->left = *left; + (*left)->right = right_left; + (*left)->count = MAX(get_count((*left)->left), get_count((*left)->right)) + 1; + right->count = MAX(get_count(right->left), get_count(right->right)) + 1; + *left = right; +} + +void insert(avl **parent, avl *node) { + if (!*parent) { + *parent = node; + return; + } + if (node->val < (*parent)->val) + insert(&(*parent)->left, node); + else + insert(&(*parent)->right, node); + (*parent)->count = MAX(get_count((*parent)->left), get_count((*parent)->right)) + 1; + int balance = get_balance(*parent); + if (balance > 1 && get_balance((*parent)->left) >= 0) + right_rotate(parent); + if (balance > 1 && get_balance((*parent)->left) > 0) { + left_rotate(&(*parent)->left); + right_rotate(parent); + } + if (balance < -1 && get_balance((*parent)->right) <= 0) + left_rotate(parent); + if (balance < -1 && get_balance((*parent)->right) > 0) { + right_rotate(&(*parent)->right); + left_rotate(parent); + } +} + +struct TreeNode* sortedListToBST(struct ListNode* head) { + avl *root = NULL; + while (head) { + avl *node = calloc(1, sizeof(avl)); + node->val = head->val; + node->count = 1; + head = head->next; + insert(&root, node); + } + return (struct TreeNode*) root; +} +``` diff --git a/docs/application/native.md b/docs/application/native.md index 705c4ed..c5108aa 100644 --- a/docs/application/native.md +++ b/docs/application/native.md @@ -6,7 +6,6 @@ ```c typedef struct _kpl_native { - KPL_SLAB_HEADER(struct _kpl_native); kpl_class class; } kpl_native; ``` diff --git a/docs/application/queue.md b/docs/application/queue.md index cd9f363..a770ac7 100644 --- a/docs/application/queue.md +++ b/docs/application/queue.md @@ -6,13 +6,12 @@ ```c typedef struct _kpl_queue_item { - KPL_SLAB_LIST_HEADER(struct _kpl_queue_item); + struct _kpl_queue_item *prev, *next; kpl_any any; } kpl_queue_item; typedef struct _kpl_queue { - KPL_SLAB_HEADER(struct _kpl_queue); - size_t item_length; + int32_t item_length; kpl_interface *interface; kpl_pool_any *head, *tail; } kpl_queue; diff --git a/docs/application/shared.md b/docs/application/shared.md index 89ba292..0528645 100644 --- a/docs/application/shared.md +++ b/docs/application/shared.md @@ -6,10 +6,9 @@ ```c typedef struct _kpl_shared { - KPL_SLAB_HEADER(struct _kpl_shared); + bool mark; kpl_class data; kpl_mutex mutex; - bool mark; } kpl_shared; _Atomic uint32_t shared_threads_makred; diff --git a/docs/application/thread.md b/docs/application/thread.md index 770358f..6d3f76f 100644 --- a/docs/application/thread.md +++ b/docs/application/thread.md @@ -22,13 +22,6 @@ typedef struct _task { _Atomic bool join_ready; } task; -#define KPL_TASK_SLAB_SIZE 50 - -typedef struct _kpl_task_slab { - struct _kpl_task_slab *next; - kpl_task array[KPL_TASK_SLAB_SIZE]; -} kpl_task_slab; - #define KPL_QUEUE_ASYNC -1 #define KPL_MAIN_THREAD 0 @@ -40,13 +33,11 @@ typedef struct { } dummy; } kpl_task_queue; +// TODO RING BUFFER ALLOCATOR + typedef struct { kpl_task_queue queue; _Atomic ssize_t priority; - uint32_t slab_array_index; - _Atomic uint32_t pool_size; - kpl_task_slab *slab; - kpl_task *pool; sem_t counter; pthread_t thread; } kpl_thread; @@ -75,12 +66,20 @@ regex : captures, function state, regex function ## Sync +Queue task on selected thread + ## Async +Queue task on thread with lowest `priority` + # Running ## Joining +# Thread Pool Management + +Run task to check thread pool sizes and create tasks to spread out a large pool across other threads + # Example ```c diff --git a/docs/application/union.md b/docs/application/union.md index 3626f1c..984253c 100644 --- a/docs/application/union.md +++ b/docs/application/union.md @@ -6,8 +6,7 @@ ```c typedef struct _kpl_union { - KPL_SLAB_HEADER(strcut _kpl_union); - kpl_class class; uint32_t tag; + kpl_class class; } kpl_union; ``` diff --git a/docs/language/operators.md b/docs/language/operators.md index 85ca162..2b843ec 100644 --- a/docs/language/operators.md +++ b/docs/language/operators.md @@ -8,9 +8,17 @@ ## Cast `$` +```c +typedef kpl_result kpl_interface_cast(kpl_type to, const kpl_any from); +``` + ## ``log` -Configurable logger, output format and destination can be changed +Configurable logger, destination can be changed + +```c +typedef void kpl_interface_log(kpl_type type, const kpl_any any, const FILE *file, int32_t idnt, uint32_t options); +``` ## ``debugger` @@ -20,6 +28,8 @@ Configurable logger, output format and destination can be changed Thread_id `unique I32 ``` +## ``thread_count` + ## ``format` ```text @@ -58,6 +68,10 @@ WHITE `#NAME#NAME#` use single `#` to apply multiple colors at once +```c +typedef kpl_result kpl_interface_format(const kpl_buffer *format, [const kpl_any]..., NULL); +``` + ## ``panic` Stops execution and prints `Any` to `stdout` @@ -73,3 +87,13 @@ Stops execution and prints `Any` to `stdout` ## ``async_type` ## ``copy` + +```c +typedef kpl_result kpl_interface_copy(const kpl_any any); +``` + +## ``hash` + +```c +typedef uint64_t kpl_interface_hash(const kpl_any any); +``` diff --git a/docs/lifecycle/check.md b/docs/lifecycle/check.md index 3e8177e..39290c3 100644 --- a/docs/lifecycle/check.md +++ b/docs/lifecycle/check.md @@ -1,3 +1,15 @@ # Check --- + +Type checking + +# Ops + +# Actions + +# Complete Function Definitions + +# Incomplete Function Definitions + +Can only type check on invocation, check if invocation is in the `INVOCATION_LIST` if not add new invocation diff --git a/docs/lifecycle/eval.md b/docs/lifecycle/eval.md index 8572f21..11081a6 100644 --- a/docs/lifecycle/eval.md +++ b/docs/lifecycle/eval.md @@ -1,3 +1,5 @@ # Eval --- + +Reduce AST size by evaluating expressions diff --git a/docs/lifecycle/import.md b/docs/lifecycle/import.md index bf7635d..669e67b 100644 --- a/docs/lifecycle/import.md +++ b/docs/lifecycle/import.md @@ -1,3 +1,5 @@ # Import --- + +Find each import node and wait for the import to complete life cycle, then get a copy of its `export_tree` diff --git a/docs/lifecycle/ir.md b/docs/lifecycle/ir.md index fb5d70d..5db8091 100644 --- a/docs/lifecycle/ir.md +++ b/docs/lifecycle/ir.md @@ -1,3 +1,5 @@ # Ir --- + +Convert an AST into a list of 3 address instructions diff --git a/docs/lifecycle/jit.md b/docs/lifecycle/jit.md index 5515f55..3243385 100644 --- a/docs/lifecycle/jit.md +++ b/docs/lifecycle/jit.md @@ -1,3 +1,55 @@ # Jit --- + +Convert Ir Into X64 (X86_64) + +## Limitations + +#### No Segmentation Registers + +#### No X87 Support + +#### No access to the upper 8 bits of the lower 16 bits of registers AX, BX, CX, DX + +## Required Implicit Registers + +Instructions that implicitly modify a register now require the register as an operation + +# Operation + +Each instruction is written with varardic c functions with `TYPE`, `DATA` syntax + +## TYPE + +### General Registers Width + +### General Register Addresses Width + +### General Register Scale + +### General Register Id + +### General Register Memory Displacement + +### XMM Registers + +### MM Registers + +### Immediate Value + +### Relative Address + +### Label + +## DATA + +## Object Definitions + +```c +kpl_x64_lable(label) + +kpl_x64_inst(INSTRUCTION, [TYPE, VALUE]..., END) + +kpl_x64_inst_pfx(PREFIX, INSTRUCTION, [TYPE, VALUE]..., END) +``` diff --git a/docs/lifecycle/parse.md b/docs/lifecycle/parse.md index c9da979..1016a28 100644 --- a/docs/lifecycle/parse.md +++ b/docs/lifecycle/parse.md @@ -35,3 +35,5 @@ On type completion look up if type is a builtin ## Define `[]` ## Action `{}` + +# Operation diff --git a/docs/lifecycle/scope.md b/docs/lifecycle/scope.md index 849c52d..37ca355 100644 --- a/docs/lifecycle/scope.md +++ b/docs/lifecycle/scope.md @@ -10,6 +10,8 @@ Traverse AST and: ## Initialize Functions +## Split Process Into Tasks by `await` + ## Register Imports On finding an import node add a register task for the imported string diff --git a/docs/type_system/bit.md b/docs/type_system/bit.md index e30a536..f730563 100644 --- a/docs/type_system/bit.md +++ b/docs/type_system/bit.md @@ -18,7 +18,7 @@ Bit[[SIZE_FLAGS | REPRESENTATION_FLAGS]] ```c typedef struct { - // EMPTY + kpl_interface *interface; } kpl_type_body_bit; ``` @@ -113,6 +113,10 @@ Bool `alias Bit[[BIT8 | BOOL]] ### Compare `<=>` +```c +typedef ssize_t kpl_interface_compare(const kpl_any any_a, const kpl_any any_b); +``` + # Char ```text diff --git a/docs/type_system/buffer.md b/docs/type_system/buffer.md index f351b4f..554a467 100644 --- a/docs/type_system/buffer.md +++ b/docs/type_system/buffer.md @@ -12,7 +12,7 @@ Buffer[[TYPE | UTF8 | UTF16 | UTF32] TYPE] ```c typedef struct { - kpl_ptr type; + kpl_interface *interface; } kpl_type_body_buffer; ``` diff --git a/docs/type_system/error.md b/docs/type_system/error.md index fbd15eb..7931e0e 100644 --- a/docs/type_system/error.md +++ b/docs/type_system/error.md @@ -12,7 +12,7 @@ Error[[]] ```c typedef struct { - // EMPTY + kpl_interface *interface; } kpl_type_body_error; ``` diff --git a/docs/type_system/function.md b/docs/type_system/function.md index ed1cf9d..515550a 100644 --- a/docs/type_system/function.md +++ b/docs/type_system/function.md @@ -6,20 +6,19 @@ MODE: INCOMPLETE | COMPLETE -INVOCATION : SYNC | ASYNC - STATELESS : NATIVE | NATIVE_INLINE | PROCESS | GENERATOR | REGEX_GENERATOR STATEFUL : TASK | ITERATOR | CLOSURE | BOUND | REGEX -Function[[MODE | INVOCATION | STATELESS | STATEFUL]; INVOCATION_LIST; Body; RETURN_TYPE; Collection[VAR_LIST; TYPE.SYMBOL]] +Function[[MODE | STATELESS | STATEFUL]; JIT; IR; Body; INVOCATION_LIST; RETURN_TYPE; Collection[NAME_LIST; TYPE.SYMBOL]] ``` ## Type Body Object Definitions ```c typedef struct { - kpl_ptr body, return_type, var_list; + void *jit; + kpl_ptr ir, body, invocation_list, return_type, var_list; } kpl_type_body_function; ``` @@ -44,7 +43,7 @@ A function with an incomplete type, type checking occurs at invocation its compl ## Complete -A function with a complete type, its sync/async invocations are stored in the `INVOCATION_LIST` +A function with a complete type, it stores it's `IR` and `JIT` ## Native @@ -52,7 +51,7 @@ Native C code that can be called async ## Native Inline -Native C code that cannot be called async +Native C code that cannot be called async, has to be inline ## Task diff --git a/docs/type_system/index.md b/docs/type_system/index.md index 4c2fe73..456be2f 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -113,3 +113,5 @@ Denotes that a field that does not resolve to anything * #### [Lock](./lock.md) * #### [Namespace](./namespace.md) + +* #### [Ir](./ir.md) diff --git a/docs/type_system/ir.md b/docs/type_system/ir.md new file mode 100644 index 0000000..5593bc3 --- /dev/null +++ b/docs/type_system/ir.md @@ -0,0 +1,17 @@ +# Ir + +--- + +```text +Ir[[IR_NAME] Address[3]] +``` + +`IR_NAME` is a single value + +## Type Body Object Definitions + +```c +typedef struct { + kpl_ptr address[3]; +} kpl_type_body_ir; +``` diff --git a/docs/type_system/map.md b/docs/type_system/map.md index 44cd6cf..839d511 100644 --- a/docs/type_system/map.md +++ b/docs/type_system/map.md @@ -11,6 +11,7 @@ Map[[] KEY_TYPE; VALUE_TYPE] ```c typedef struct { kpl_ptr key, value; + kpl_interface *interface; } kpl_type_body_map; ``` diff --git a/docs/type_system/op.md b/docs/type_system/op.md index 79f0953..f9b2173 100644 --- a/docs/type_system/op.md +++ b/docs/type_system/op.md @@ -5,12 +5,12 @@ ```text Op[[OP_NAME] RETURN_TYPE; LEFT_TYPE; RIGHT_TYPE] ``` + +`OP_NAME` a single value + ## Type Body Object Definitions ```c typedef struct { kpl_ptr return_type, statement_left, statement_right; } kpl_type_body_op; -``` - -The `OP_NAME` a single value diff --git a/docs/type_system/queue.md b/docs/type_system/queue.md index 3b17512..800aa43 100644 --- a/docs/type_system/queue.md +++ b/docs/type_system/queue.md @@ -10,7 +10,7 @@ Queue[[] TYPE] ```c typedef struct { - kpl_ptr type; + kpl_interface *interface; } kpl_type_body_queue; ``` diff --git a/docs/type_system/select.md b/docs/type_system/select.md index 4ef3bbb..e68fc32 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 type, var_tree, var_list; + kpl_ptr var_tree, var_list; } kpl_type_body_select; ``` @@ -21,7 +21,7 @@ typedef struct { ```text Enum[Generic.T; Collection[.symbol : %const Value]] `alias Select[[SINGLE]; Generic.T; Collection[VAR_TREE_LIST; .symbol : %const Value]] -Mask[Generic.T; Collection[.symbol : %const Value]] `alias Select[[MULTIPLE]; Generic.T; Collection[VAR_TREE_LIST; .symbol : %const Value]] +Mask[Generic.T; Collection[.symbol]] `alias Select[[MULTIPLE]; Generic.T; Collection[VAR_TREE_LIST; .symbol]] ``` ## Definition Example diff --git a/docs/type_system/task.md b/docs/type_system/task.md index 3561737..ae547b2 100644 --- a/docs/type_system/task.md +++ b/docs/type_system/task.md @@ -13,6 +13,7 @@ Task[[] TYPE] ```c typedef struct { kpl_ptr type; + kpl_interface *interface; } kpl_type_body_task; ``` @@ -37,6 +37,7 @@ nav: - List: 'type_system/list.md' - Lock: 'type_system/lock.md' - Namespace: 'type_system/namespace.md' + - Ir: 'type_system/ir.md' - Application: - Runtime: 'application/index.md' - Interface: 'application/interface.md' |
