* reduce codegen in sorting macros
* remove testing file...
* Fix and some renaming, removing some sub-modules that should not be in use.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* add deprecations to macro slot builtins
* refactor all stdlib uses of now-deprecated EMPTY_MACRO_SLOT; release notes
* update incorrect releasenotes ref to this pr
* remove leftover comments from refactoring
* remove unnecessary `EmptySlot`-like type in countingsort; use private macro directly
* Doc comment improvements
* update `compression/qoi.c3` to use const enums
* revert sweeping doc comment changes that impacted readability for now
* Some tweaks.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* fix typos in comments and strings
* fix typos in symbols (and some comments/strings)
* fix typos in releasenotes.md
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
* sort: add is_sorted
Add is_sorted function to check whether a list is sorted or not. Sort
order (ascending or descending) will be detected by looking at the data.
Add tests.
* update the release notes
* refactor: use lambda
* sort: extract partition from quicksort
Extract the partition logic from quicksort into a macro. This allows to
reuse the partition logic for, e.g., the quickselect algorithm.
* sort: implement quickselect
implement Hoare's selection algorithm (quickselect) on the basis of the
already implemented quicksort. Quickselect allows to find the kth
smallest element in a unordered list with an average time complexity of
O(N) (worst case: O(N^2)).
* add quicksort benchmark
Create a top-level benchmarks folder. Add the benchmark implementation
for the quicksort algorithm.
Benchmarks can then be run in the same way as unit tests from the
root folder with:
c3c compile-benchmarks benchmarks/stdlib/sort
Tracks the three potential cases for each fallback, item counts ranging from [2,32], [33,128], [128, ...] and uses a loop specifically for each fallback.
* compiler: fix typo in error message about failed name resolution
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
* lib/std/sort: add List support to quicksort
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
* lib/std/collections: add HashMap.@each
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
* lib/std/sort: unify binarysearch and binarysearch_with; add comments to quicksort
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
* lib/std/collections: mark List.{len, is_empty, get} with @inline
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
* lib/std/collections: add PriorityQueueMax; add tests for PriorityQueue and PriorityQueueMax
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
---------
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>