Skip to content

Commit

Permalink
Updated docs and milestones
Browse files Browse the repository at this point in the history
  • Loading branch information
checkroom committed Jan 17, 2025
1 parent e1d18fa commit 92dac36
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 13 deletions.
16 changes: 12 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@
- [ ] In the UI for the demo, add a loader as the first boot is quite slow
- [ ] Fill in the docs at least of the public interface

## `v0.4.2`

- [ ] Rework the mechanisms used in `order-by` and fill missing comparisons in the RPN
- [ ] Support for string natural order (111 > 22).
- [ ] Strings in dot notation when ordering by random should apply hashing and comparison to each block sequentially.
- [ ] String support in RPN

## `v0.4.3`

- [ ] Properly show ctx information while logging

## `v0.4.x`

- [ ] Much more robust test-suite with higher coverage.
- [ ] Optimization for lower-end systems by reducing explicit memory allocations if possible and adopting string views.
- [ ] Support for string natural order (111 > 22).
- [ ] Properly show ctx information while logging
- [ ] Expose a mechanism to allow externally defined expressions? Not sure about this one, but it might be good when embedding this library.\
- [ ] Strings in dot notation when ordering by random should apply hashing and comparison to each block sequentially.
- [ ] Expose a mechanism to allow externally defined expressions? Not sure about this one, but it might be good when embedding this library.

## `v1.0.0`

Expand Down
43 changes: 34 additions & 9 deletions docs/ordering.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,60 @@
Ordering criteria are used in two situations:

- in `order-by` attributes of cycles of every type except `for-range`
- as basic boolean binary operator in the RPN vm
- in the `order-by` attributes of cycles for each type but `for-range`
- as basic boolean binary operator in the RPN virtual machine

The two implementations are not unified, so feature parity is desired but not intrinsic.

## Order types

### `ASC` & `DESC`

Whatever ordinal is assigned to the entries, sorting is just based on an ascending or descending order.

### `RANDOM`

Data of any type is first hashed.
For integers, floats and booleans this only involves their immediate data.
For strings the characters buffer. Order will be based on the numerical comparison of the hash.
For strings adopting the dot notation, each token is handled separately in hashing and comparing.
Data of any type is first hashed, and `ASC` is applied to those hashes.
For integers, floats and booleans this just involves their immediate data.
For strings the characters buffer is used as the hash source. If the dot notation is needed, each token separated by `.` will be hashed and compared on its own.
Nodes should not be directly compared. Doing so is not illegal, just nonsensical.

## Comparison operators for supported types.

### Nodes

Nodes should not be directly compared. Doing so is not illegal, just nonsensical and UB. A more precise semantic for this case might be introduced later on.

### Attributes

By default, they are cast to string before evaluation.

### Integers

Comparison as expected from any basic math class.

### Floats

Comparison as expected from any basic math class.

### Booleans

`true` is smaller than `false`.

### Strings

Strings are by far the most complex to handle as multiple criteria are possible.
Strings

#### Encoding ordering

Based on the binary representation of UTF-8 encoding.

#### Natural ordering

#### Lexicographic ordering
`hello10` bigger than `hello2`.

#### Pseudo-random ordering
#### Lexicographic ordering

#### Dot modifier
For symbols in the Latin alphabet this is more or less equivalent to the encoding ordering.
However, different languages have totally different customary approaches, and are not often based on alphabets.
Basically any criteria rooted in linguistic arguments goes in here.

0 comments on commit 92dac36

Please sign in to comment.