summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornodist <kevin.comas.git@gmail.com>2026-06-21 11:51:41 -0400
committernodist <kevin.comas.git@gmail.com>2026-06-21 11:51:41 -0400
commit3a9cf2508dc7341a6d8ff4b8174064600d704994 (patch)
tree63c3196cec86824f237ac82d92aa43c56010e607
parent900445604bc38ef43d89f0c11f0cc61ce3cb0bce (diff)
update memory objs
-rw-r--r--docs/application/buffer.md4
-rw-r--r--docs/application/error.md2
-rw-r--r--docs/application/group.md3
-rw-r--r--docs/application/index.md26
-rw-r--r--docs/application/map.md6
-rw-r--r--docs/application/memory.md55
-rw-r--r--docs/application/name.md11
-rw-r--r--docs/application/namespace.md8
-rw-r--r--docs/application/native.md2
-rw-r--r--docs/application/queue.md6
-rw-r--r--docs/application/shared.md2
-rw-r--r--docs/application/thread.md5
-rw-r--r--docs/application/union.md2
-rw-r--r--docs/index.md4
-rw-r--r--docs/language/index.md2
-rw-r--r--docs/language/ownership.md2
-rw-r--r--docs/lifecycle/parse.md3
-rw-r--r--docs/lifecycle/register.md14
-rw-r--r--docs/type_system/function.md18
-rw-r--r--docs/type_system/map.md2
-rw-r--r--docs/type_system/namespace.md2
-rw-r--r--mkdocs.yml3
22 files changed, 94 insertions, 88 deletions
diff --git a/docs/application/buffer.md b/docs/application/buffer.md
index 4580fec..881fb27 100644
--- a/docs/application/buffer.md
+++ b/docs/application/buffer.md
@@ -6,8 +6,8 @@
```c
typedef struct _kpl_buffer {
- KPL_POOL_HEADER(_kpl_buffer);
- uint32_t byte_length;
+ KPL_POOL_HEADER(struct _kpl_buffer);
+ uint64_t byte_length;
kpl_interface *interface;
uint8_t bytes[];
} kpl_buffer;
diff --git a/docs/application/error.md b/docs/application/error.md
index 77a97cb..e6fae17 100644
--- a/docs/application/error.md
+++ b/docs/application/error.md
@@ -6,7 +6,7 @@
```c
typedef struct _kpl_error {
- KPL_SLAB_HEADER(_kpl_error);
+ KPL_SLAB_HEADER(struct _kpl_error);
char *file, *function;
kpl_class class;
int32_t line;
diff --git a/docs/application/group.md b/docs/application/group.md
index c96c901..286f1ee 100644
--- a/docs/application/group.md
+++ b/docs/application/group.md
@@ -6,8 +6,7 @@
```c
typedef struct _kpl_group {
- KPL_POOL_HEADER(_kpl_group);
- uint32_t item_length;
+ KPL_POOL_HEADER(struct _kpl_group);
kpl_class items[];
} kpl_group;
```
diff --git a/docs/application/index.md b/docs/application/index.md
index b89d79f..a534225 100644
--- a/docs/application/index.md
+++ b/docs/application/index.md
@@ -36,17 +36,19 @@
### Module
-### String
-
-### REPL
-
-1. ##### Parse
-2. ##### Scan
-3. ##### Scope
-4. ##### Check
-5. ##### Eval
-6. ##### Ir
-7. ##### Jit
-8. ##### Exec
+### String/REPL
+
+## Life cycle
+
+1. ##### [Register](../lifecycle/register.md)
+2. ##### [Parse](../lifecycle/parse.md)
+3. ##### Scan
+4. ##### Scope
+5. ##### Check
+6. ##### Eval
+7. ##### Ir
+8. ##### Jit
+9. ##### Exec
+10. ##### Notify
## Shutdown
diff --git a/docs/application/map.md b/docs/application/map.md
index fd412e5..1bc8b40 100644
--- a/docs/application/map.md
+++ b/docs/application/map.md
@@ -6,13 +6,13 @@
```c
typedef struct _kpl_map_bucket {
- KPL_SLAB_HEADER(_kpl_map_bucket);
+ KPL_SLAB_LIST_HEADER(struct _kpl_map_bucket);
kpl_any key, value;
} kpl_map_bucket;
typedef struct _kpl_map {
- KPL_POOL_HEADER(_kpl_map);
- uint32_t length;
+ KPL_POOL_HEADER(strcut _kpl_map);
+ uint64_t length;
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 eda866f..fbc6b67 100644
--- a/docs/application/memory.md
+++ b/docs/application/memory.md
@@ -5,50 +5,27 @@
## Object Definitions
```c
-#define KPL_SLAB_HEADER(STRUCT) struct STRUCT *prev, *next;
+#define KPL_SLAB_HEADER(STRUCT) STRCUT *next
-typedef struct _kpl_slab_obj {
- KPL_SLAB_HEADER(_kpl_slab_obj);
+typdef strcut _kpl_slab_obj {
+ KPL_SLAB_LIST_HEADER(strcut _kpl_slab_obj);
} kpl_slab_obj;
-typedef struct _kpl_slab {
- size_t array_index;
- struct _kpl_slab *next;
- uint8_t array[];
-} kpl_slab_alloc;
+#define KPL_SLAB_LIST_HEADER(STRCUT) STRCUT *prev, *next
-typedef struct {
- uint32_t object_size, array_size;
- _Atomic size_t slab_length;
- kpl_slab *slab;
- kpl_slab_obj *head;
- kpl_mutex mutex;
-} kpl_slab;
+typdef strcut _kpl_slab_list_obj {
+ KPL_SLAB_LIST_HEADER(strcut _kpl_slab_list_obj);
+} kpl_slab_list_obj;
-#define KPL_POOL_HEADER(STRUCT) KPL_SLAB_HEADER(STRUCT); uint32_t obj_byte_size
+#define KPL_SLAB_TREE_HEADER(STRUCT) STRUCT *parent, *left, *right, uint8_t tree_weight
-typedef struct _kpl_pool_obj {
- KPL_POOL_HEADER(_kpl_pool_obj);
-} kpl_pool_obj;
-
-typedef strut {
- uint32_t min_obj_size;
- _Atomic size_t alloc_byte_size;
- kpl_pool_obj *head;
- kpl_mutex mutex;
-} kpl_pool;
-```
-
-## Pool Object Size
-
-The max size of an object in the pool is 2 \*\* 32
+typdef strcut _kpl_slab_tree_obj {
+ KPL_SLAB_TREE_HEADER(struct _kpl_slab_tree_obj);
+} kpl_slab_tree_obj;
-This allows for 4 aligned bytes after the `POOL_HEADER` macro
+#define KPL_POOL_HEADER(STRCUT) STRCUT *parent, *left, *right, uint8_t tree_weight, uint64_t obj_size : 56
-## Slab Leak Detection
-
-On debug builds before each slab is freed, all items removed from the slab should be found on the slabs pool
-
-## List Management
-
-## Tree Management
+typdef struct _kpl_pool_obj {
+ KPL_POOL_HEADER(struct _kpl_pool_obj);
+} kpl_pool_obj;
+```
diff --git a/docs/application/name.md b/docs/application/name.md
index a94789c..afc5880 100644
--- a/docs/application/name.md
+++ b/docs/application/name.md
@@ -8,14 +8,7 @@ Each word representing a var, symbol or type gets an `NAME_IDENTIFIER` -> `kpl_n
```c
typedef struct _kpl_name {
- KPL_POOL_HEADER(_kpl_name);
- uint32_t length;
- char *c_str[];
+ KPL_POOL_HEADER(struct _kpl_name);
+ char c_str[];
} kpl_name;
-
-static kpl_name *kpl_name_head;
```
-
-## Lookup and Storage
-
-All `kpl_name*` objects are stored as a tree under `*kpl_name_head`
diff --git a/docs/application/namespace.md b/docs/application/namespace.md
index ab38d3f..e6809d5 100644
--- a/docs/application/namespace.md
+++ b/docs/application/namespace.md
@@ -6,12 +6,12 @@
```c
typedef struct _kpl_export {
- SLAB_HEADER(_kpl_export);
+ KPL_SLAB_TREE_HEADER(struct _kpl_export);
kpl_type_ptr type;
} kpl_export;
typedef struct _kpl_namespace_native {
- SLAB_HEADER(_kpl_namespace_native);
+ KPL_SLAB_TREE_HEADER(struct _kpl_namespace_native);
kpl_buffer *name;
kpl_export *exports;
} kpl_namespace_native;
@@ -19,12 +19,12 @@ typedef struct _kpl_namespace_native {
static kpl_namespace_native *namespace_native_head;
typedef struct _kpl_namespace_module {
- SLAB_HEADER(_kpl_namespace_module);
+ KPL_SLAB_TREE_HEADER(struct _kpl_namespace_module);
+ kpl_type_ptr ast;
kpl_queue *parents;
kpl_buffer *module_name, *module_string;
kpl_export *exports;
kpl_task *task;
- kpl_type_ptr ast;
_Atomic int32_t children;
} kpl_namespace_module;
diff --git a/docs/application/native.md b/docs/application/native.md
index 8cd8f82..705c4ed 100644
--- a/docs/application/native.md
+++ b/docs/application/native.md
@@ -6,7 +6,7 @@
```c
typedef struct _kpl_native {
- KPL_SLAB_HEADER(_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 a04461e..5e8ae15 100644
--- a/docs/application/queue.md
+++ b/docs/application/queue.md
@@ -6,13 +6,13 @@
```c
typedef struct _kpl_queue_item {
- KPL_SLAB_HEADER(_kpl_queue_item);
+ KPL_SLAB_LIST_HEADER(struct _kpl_queue_item);
kpl_any any;
} kpl_queue_item;
typedef struct _kpl_queue {
- KPL_SLAB_HEADER(_kpl_queue);
- uint32_t length;
+ KPL_POOL_HEADER(strcut _kpl_queue);
+ uint64_t length;
kpl_interface *interface;
kpl_pool_any *head, *tail;
} kpl_queue;
diff --git a/docs/application/shared.md b/docs/application/shared.md
index 88026f9..e68b590 100644
--- a/docs/application/shared.md
+++ b/docs/application/shared.md
@@ -6,7 +6,7 @@
```c
typedef struct _kpl_shared {
- KPL_SLAB_HEADER(_kpl_shared);
+ KPL_SLAB_HEADER(struct _kpl_shared);
kpl_class data;
kpl_mutex mutex;
bool mark;
diff --git a/docs/application/thread.md b/docs/application/thread.md
index 2f85a67..ff03183 100644
--- a/docs/application/thread.md
+++ b/docs/application/thread.md
@@ -59,9 +59,10 @@ On the start of each thread, set the cpu affinity to its thread id
```text
0 -> length
native : arguments
-process : arguments, locals, parent
+process : arguments, locals
closure : arguments, locals, closure function
-iterator : arguments, locals, iterator functions, iterator function index
+iterator : arguments, locals, iterator function index, iterator functions
+regex : captures, function state, regex function
```
## Per Process Task Queue
diff --git a/docs/application/union.md b/docs/application/union.md
index fa19e6d..3626f1c 100644
--- a/docs/application/union.md
+++ b/docs/application/union.md
@@ -6,7 +6,7 @@
```c
typedef struct _kpl_union {
- KPL_SLAB_HEADER(_kpl_union);
+ KPL_SLAB_HEADER(strcut _kpl_union);
kpl_class class;
uint32_t tag;
} kpl_union;
diff --git a/docs/index.md b/docs/index.md
index 5d8ba9d..72a679c 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -31,8 +31,8 @@ readFile("filename", callback(data))
// --- langauge equivalent
// Do Soemthing
([name; callback]
- `use "io" [open; read]
- callback `sync read `sync open `sync name
+ `use "file" [open; read]
+ callback `sync String $ read `sync open `sync name
) `async ("filename"; callback)
// Continue while readFile is running
```
diff --git a/docs/language/index.md b/docs/language/index.md
index c0c4792..679ed36 100644
--- a/docs/language/index.md
+++ b/docs/language/index.md
@@ -58,7 +58,7 @@ Underscores `_` can separate digits in a number
'A'
```
-Any UTF-8 glyph is allowed between `""`
+Any UTF-8 glyph is allowed between `""` or `''`
```text
Ω // Invalid code
diff --git a/docs/language/ownership.md b/docs/language/ownership.md
index 76f28ae..2c5de36 100644
--- a/docs/language/ownership.md
+++ b/docs/language/ownership.md
@@ -32,6 +32,8 @@ float_array : Array[F64] $ ()
`log float_array // Array[F64] $ (1.0; 2.0; 3.0)
```
+#### Functions that take references cannot be called with ``async`
+
# Shared Types
# Locking
diff --git a/docs/lifecycle/parse.md b/docs/lifecycle/parse.md
new file mode 100644
index 0000000..458ba97
--- /dev/null
+++ b/docs/lifecycle/parse.md
@@ -0,0 +1,3 @@
+# Parse
+
+---
diff --git a/docs/lifecycle/register.md b/docs/lifecycle/register.md
new file mode 100644
index 0000000..7fccb05
--- /dev/null
+++ b/docs/lifecycle/register.md
@@ -0,0 +1,14 @@
+# Register
+
+---
+
+# Create Namespace
+
+## Module
+
+1. Init new module with the filename
+2. Add to namespace tree
+
+## String
+
+# Load Module
diff --git a/docs/type_system/function.md b/docs/type_system/function.md
index 57b0abf..baf7337 100644
--- a/docs/type_system/function.md
+++ b/docs/type_system/function.md
@@ -5,9 +5,11 @@
```text
INVOCATION : UNKNOWN | SYNC | ASYNC
-CLASS : INCOMPLETE | NATIVE | TASK | PROCESS | GENERATOR | ITERATOR | CLOSURE | BOUND | REGEX
+STATELESS : INCOMPLETE | NATIVE | NATIVE_INLINE | PROCESS | GENERATOR | REGEX_GENERATOR
-FLAGS : INVOCATION | CLASS
+STATEFUL : TASK | ITERATOR | CLOSURE | BOUND | REGEX
+
+FLAGS : INVOCATION | STATELESS | STATEFUL
Function[[FLAGS]; STATE; List; RETURN_TYPE; Collection[TYPE.SYMBOL]]
```
@@ -37,7 +39,11 @@ A function with an incomplete type, type checking occurs at invocation
## Native
-Native function wrapper
+Native C code that can be called async
+
+## Native Inline
+
+Native C code that cannot be called async
## Task
@@ -51,6 +57,10 @@ A list of tasks with state
A function for creating an iterator
+## Regex Generator
+
+A function for creating Regular Expression matcher
+
## Iterator
A task creator with state, cannot take arguments, can be called until done
@@ -65,7 +75,7 @@ A function with some arguments already set
## Regex
-Regular Expression
+Invoked regular expression matcher
# Returning
diff --git a/docs/type_system/map.md b/docs/type_system/map.md
index 43e1291..68b0464 100644
--- a/docs/type_system/map.md
+++ b/docs/type_system/map.md
@@ -18,6 +18,8 @@ Set[Generic.T] `alias Map[Generic.T; Void]
## ``set`
+## ``has`
+
## Concatenate `,`
# Iterating
diff --git a/docs/type_system/namespace.md b/docs/type_system/namespace.md
index 9ae61ba..8e300b9 100644
--- a/docs/type_system/namespace.md
+++ b/docs/type_system/namespace.md
@@ -10,7 +10,7 @@ Namespace[[NATIVE | MODULE] NAMESPACE_IDENTIFIER]
### \`export
-#### Type must be Fn, Overload, Const or Shared to export
+#### Type must be Fn[STATELESS], Overload, Const, Shared or Namespace to export
#### Re-exporting
diff --git a/mkdocs.yml b/mkdocs.yml
index 5a20b4b..f715fa2 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -56,3 +56,6 @@ nav:
- Namespace: 'application/namespace.md'
- Error: 'application/error.md'
- Testing: 'application/testing.md'
+ - Life Cycle:
+ - Register: 'lifecycle/register.md'
+ - Parse: 'lifecycle/parse.md'