Examples
The Rhyme test suite explores a number of use cases with helpful examples:
- Test Suite Entry Point (test/)
- Advent of Code (aoc/):
- AOC 2023 (aoc_2023.test.js): full implementation of the 2023 advent of code challenges
- C generation (cgen/) generating C code for sparse tensors and SQL-style workloads
- JSONBench (json-bench/) the five queries of JSONBench over a stream of Bluesky events in NDJSON form, compiled to C
- Miscellaneous (original/)
- Grouping (grouping.test.js) demontrate various forms of grouping
- Sorting (sorting.test.js) demontrate how to implement sorting using UDFs
- Recursion (recursion.test.js) demontrate how to implement recursion using an external driver loop
- Tensors (tensors.test.js) demonstrate various matrix and tensor operations, including batched matrix products
- Semantics (semantics/)
- Custom data structures (se-datastruct.test.js) demontrate how to use custom datastructures (red black trees, typed arrays, sparse and dense tensors)
- Recursion (se-recursion.test.js) demontrate how to implement recursion using an external driver loop (additional tests)
- Tree paths (se-tree-paths.test.js) demonstrate shape polymorphism using tree-path variables
- TPC-H (tpch/) all 22 TPC-H queries expressed in Rhyme and compiled to C, using typed schemas for the CSV input tables (plus alternative formulations of q1 and q17)
- Typing (typing/) demonstrate experimental typing facility
- Advent of Code (aoc/):
Interactive Demos
In addition, there are a number of interactive examples for running Rhyme in the browser:
Rhyme also comes with a commond-line tool that can be used interactively or from shell scripts: