Skip to content

cianfhoghlaim/cianchosaint / .agents/skills/cocoindex

cocoindex

Verified

references/rust-port.md

View on GitHub
# Rust Port Reference

CocoIndex v1 has a Rust port of most Python flows. The Rust port
is in `cocoindex/rust/` and at the upstream
`docs/cocoindex/rust/` examples (deleted with the docs; the same
examples are in the upstream cocoindex repo).

## When to use the Rust port

- **Performance**: the Rust port is faster (no Python GIL, native
  memory layout for the Arrow types)
- **Single binary deploy**: a Rust app compiles to a single static
  binary (no Python runtime)
- **Edge / WASM**: CocoIndex Rust is the basis for the WASM build

For most Cianfhoghlaim use cases, the Python v1 Apps are sufficient and the
ergonomics of `@coco.fn` + BAML are better.

## Module map (Rust port)

| Python | Rust |
|:--|:--|
| `import cocoindex as coco` | `use cocoindex::prelude::*` |
| `@coco.fn` | `#[coco::fn]` |
| `@coco.fn(memo=True)` | `#[coco::fn(memo)]` |
| `@coco.lifespan` | `#[coco::lifespan]` |
| `ContextKey[T]` | `ContextKey::new_with_state(...)` |
| `mount_table_target` | `mount_table_target!` macro |
| `mount_each(fn, items, target)` | `mount_each!` macro |
| `await coco.use_context(KEY)` | `coco::use_context(KEY)` |

## Cianfhoghlaim example (Rust port)

- `cocoindex/rust/text_embedding/src/main.rs` —
  mirror of `cocoindex/leabharlann_embedding.py`
  (text embedding + LanceDB target)

## Running a Rust port

```bash
cd cocoindex/rust/text_embedding
cargo run -- index    # catch-up
cargo run -- query "irish gaelic"  # query
```
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall