Rayforce Rayforce ← Back to home
GitHub

Quick Start

Build Rayforce from source, start the Rayfall REPL, and run your first query in under 5 minutes.

Prerequisites

Rayforce is a pure C17 library with zero external dependencies. You need:

Build from Source

Clone the repository and build:

git clone https://github.com/singaraiona/rayforce.git
cd rayforce

Debug Build (default)

The default build enables AddressSanitizer (ASan) and UndefinedBehaviorSanitizer (UBSan) for maximum safety during development:

make

Release Build

Optimized build with -O3 and no sanitizers:

make release

Run Tests

Rayforce ships with 563 tests across 32 suites covering every subsystem:

# Run all tests
make test

# Run a single test suite
./rayforce.test --suite /vec

# Run tests matching a pattern
./rayforce.test --suite /lang

Start the REPL

The Rayfall REPL provides an interactive environment with syntax highlighting, bracket matching, tab completion, and multi-line input:

./rayforce

You will see a prompt like:

ray>

Your First Table

Create a table with two columns using the table function. Column names are symbols (quoted identifiers), and column data are vectors:

ray> (set t (table [x y] (list [1 2 3] [A B C])))
x y
-----
1 A
2 B
3 C

Your First Query

Use select to query the table. The where: clause filters rows, and you can project specific columns:

ray> (select {from:t where: (> x 1)})
x y
-----
2 B
3 C

Add computed columns and aggregations:

; Select with a computed column
ray> (select {from:t cols: {x:x x2: (* x x)}})
x  x2
-------
1   1
2   4
3   9

; Group by and aggregate
ray> (select {from:t by: {y:y} cols: {total: (sum x)}})
y  total
---------
A      1
B      2
C      3

Load a CSV File

Load data from CSV files with automatic type inference, parallel parsing, and null handling:

ray> (set data (read-csv "trades.csv"))
ray> (select {from:data where: (> price 100)})

Run a Script

Rayfall scripts use the .rfl extension. Run them directly from the command line:

# Run an example script
./rayforce examples/rfl/pivot.rfl

# Run your own script
./rayforce my-analysis.rfl

REPL Commands

The REPL supports several built-in commands:

Command Description
:helpShow available commands
:timeit exprBenchmark an expression
:envList all global bindings
:clearClear the screen
:quitExit the REPL

What's Next