summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/application/index.md3
-rw-r--r--docs/application/interface.md14
-rw-r--r--docs/application/io.md38
-rw-r--r--docs/application/thread.md8
-rw-r--r--docs/language/operators.md24
-rw-r--r--docs/lifecycle/check.md4
-rw-r--r--docs/type_system/bit.md6
-rw-r--r--docs/type_system/buffer.md2
-rw-r--r--docs/type_system/error.md2
-rw-r--r--docs/type_system/function.md6
-rw-r--r--docs/type_system/map.md1
-rw-r--r--docs/type_system/queue.md2
-rw-r--r--docs/type_system/select.md2
-rw-r--r--docs/type_system/task.md1
14 files changed, 91 insertions, 22 deletions
diff --git a/docs/application/index.md b/docs/application/index.md
index 01287b1..8ead3a8 100644
--- a/docs/application/index.md
+++ b/docs/application/index.md
@@ -33,8 +33,11 @@
## Startup
1. Configuration
+ * `thread_count` - defaults to number of available processors
2. Initialize tasks
+ * Built In Alias
2. Initialize allocators
+ * Slab sizes
4. Initialize types
5. Initialize IO
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/thread.md b/docs/application/thread.md
index 770358f..f871db7 100644
--- a/docs/application/thread.md
+++ b/docs/application/thread.md
@@ -75,12 +75,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/language/operators.md b/docs/language/operators.md
index 35e39c3..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`
@@ -60,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`
@@ -75,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 31685e1..39290c3 100644
--- a/docs/lifecycle/check.md
+++ b/docs/lifecycle/check.md
@@ -10,4 +10,6 @@ Type checking
# Complete Function Definitions
-# Incomplete Function Invocations
+# 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/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 3847941..515550a 100644
--- a/docs/type_system/function.md
+++ b/docs/type_system/function.md
@@ -17,8 +17,8 @@ Function[[MODE | STATELESS | STATEFUL]; JIT; IR; Body; INVOCATION_LIST; RETURN_T
```c
typedef struct {
- void *code;
- kpl_ptr ir, body, invocations, return_type, var_list;
+ void *jit;
+ kpl_ptr ir, body, invocation_list, return_type, var_list;
} kpl_type_body_function;
```
@@ -43,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
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/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..98719a5 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;
```
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;
```