aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Moon Flower <moon@coffin.ir> 2025-03-10 00:11:21 +0330
committerGravatar Moon Flower <moon@coffin.ir> 2025-03-10 00:11:21 +0330
commit4aef86c3e641cbff8e0155589f9cc9172aa1051c (patch)
tree55d0e6d340ded45737959c3cd94fccceddc550a8 /README.md
parentFixed stuff broken woohoo (diff)
New moonshine release! What's changed?
> - New allocator based on sbrk and linked lists > - Hybrid allocator switching mechanism to swap sbrk and mmap whenever needed > - Better internal exception detector to prevent useless uninformative stackoverflow exceptions > - Moved a bunch of the code around, as always! > Have a great night!
Diffstat (limited to 'README.md')
-rw-r--r--README.md17
1 files changed, 12 insertions, 5 deletions
diff --git a/README.md b/README.md
index b6877ea..aee14e5 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,14 @@
# moonshine
This library aims to be a drop-in libc replacement for most C projects, whilst also providing helpful utilies such as variable arrays, bounds checking, better memory allocation, algebraic data types, garbage collection, and more.
-It already supports the system calls and library functions which were necessary for its functionality, but more stdlib support should come soon. This library relies upon nothing but the C language itself, not even the standard library headers that C often uses, such as stdlib.h, unistd.h, etc.
+It already supports the system calls and library functions which were necessary for its functionality, but more stdlib support should come soon.
+This library relies upon nothing but the C language itself, not even the standard library headers that C often uses, such as stdlib.h, unistd.h, etc.
-Its current features are:
+## Current features
- Mark & Sweep garbage collector for responsible memory management (must be manually called, for now)
- Easy array creation: `new(int)`, `new(char, 4)`, `fill(int, 2, 4, 5)`, `fill(string, "hello", "world")`, `single("string")`, `single(22.4)`
-- Global print statement, takes up to 512 arguments of any type, and figures out how to print them out by itself. (Currently does not support custom structs). Example: `print("hello, ", "world!")`, `print("The sum is: ", 2 + 5)`, `print("I have a pointer with size ", pointer_size, " and address ", pointer)`
+- Global print statement, takes up to 512 arguments of any type, and figures out how to print them out by itself.
+ (Currently does not support custom structs). Example: `print("hello, ", "world!")`, `print("The sum is: ", 2 + 5)`, `print("I have a pointer with size ", pointer_size, " and address ", pointer)`
- Algebraic data types using the `datatype` macro, eg. `datatype(binarytree, ((leaf, int), (node, binarytree *, int, binarytree *) ));`
- Self-defined types such as `var` for `void*`, `string` for `char*`, `u8` for `uint64_t`, and const-correct types such as `car` for `const void*` and `ctring` for `const char*`
- Basic type coercion: `auto x = 4; auto y = 9.0; auto z = "Hello!";`
@@ -17,7 +19,7 @@ Its current features are:
- Const-correct stdlib functions: `exit`, `fork`, `getchar`, `putchar`, `strlen`, `memset`, `memmove`, etc
- Made-from-scratch stdout buffer management: `write`, `flush`, etc
- Deprecation warnings for functions such as `malloc`, `realloc` and `free`
-- Intelligent and safe memory management using `alloc`, `remap` and `release`
+- Intelligent and safe memory management using `alloc`, `remap` and `release` which automatically switch allocators to balance performance and load-tolerance.
- Performant hash array implementation
- Pointer ownership trick, using `mine(var ptr)` (requires a revamp)
- Easy array manipulation with `push(array, item)`
@@ -28,6 +30,11 @@ Its current features are:
- Custom `_start` function that initializes moonshine functionality whilst still keeping the ease of use of the libc `main` function.
- Pattern matching using algebraic data types.
-The roadmap for moonshine is:
+## Roadmap
- Achieving more libc compatibility
- Moving common operations to macros for reduced code size and increased conciseness
+
+## Layout
+At the core of moonshine lies its linux systemcalls, which communicate directly with the kernel to exchange information.
+Atop that layer are the allocators, which handle fast dynamic memory allocation and deallocation,
+which are the supporting pillars of the tricky memory manipulations that power the dynamic memory allocations, the general-purpose macros, and more.