it will work on many systems. ARM / PowerPC may not work correctly.
* procedures can be polymorphic on an array size.
* structures can be polymorphic on any compile-time known value.
+* procedures can be polymoprhic on any compile-time known value, including type expressions.
* basics of operator overloading using `#operator +`.
* multiple return values and multiple assignment / declarations.
* #solidify directive for explicitly specifying type variables in polymorphic procs.
* '-VV' and '-VVV' for very verbose printing. Easier to nail down compiler issues because it stops
printing in the entity where the problem is.
* `io.Stream` API with `io.Reader` and `io.Writer`.
-* `map.empty`
-* `string.compare`
-* `array.copy`
* ranges on switch cases, i.e. `case 4 .. 10`. Note, this is inclusive on the upper end,
unlike most other uses of the range literal.
-* `map.update`
+* miscellaneous core library functions
Removals:
* struct literals can no longer specify values for members brought in through a `use`.
package core.alloc.pool
+// A pool allocator is an O(1) allocator that is capable of allocating and freeing.
+// It is able to do both in constant time because it maintains a linked list of all
+// the free elements in the pool. When an element is requested the first element of
+// linked list is returned and the list is updated. When an element is freed, it
+// becomes the first element. The catch with this strategy however, is that all of
+// the allocations must be of the same size. This would not be an allocator to use
+// when dealing with heterogenous data, but when doing homogenous data, such as
+// game entities, this allocator is great. It allows you to allocate and free as
+// many times as you want, without worrying about fragmentation or slow allocators.
+// Just make sure you don't allocate more than the pool can provide.
+
PoolAllocator :: struct (Elem: type_expr) {
buffer : [] Elem;
first_free : ^Elem;
- struct member names
- array length
- [ ] baked parameters
+ [X] baked parameters
- Compile time known parameters
- Removes the argument from the list and replaces the function with the
baked function
[ ] Make compiler work on MacOS
[ ] Make Onyx easier to use from JS
[ ] Add examples for the following language features:
- - Slices
- - Dynamic Arrays
- - Structs and unions
- - Enums
- - switch statements
- - for loops
- - Maps
+ ✔ Slices
+ ✔ Dynamic Arrays
+ ✔ Structs and unions
+ ✔ Enums
+ ✔ switch statements
+ ✔ for loops
+ ✔ Maps
+ ✔ pipe operator
- varargs
- `use` keyword
- ✔ pipe operator
- Overloaded procedures
- Polymorphic procedures
- WASM directives (#export, #foreign)