---
epic: 8
story: 8.2
title: "Engine Integration (Direct Linking)"
status: draft
---

## Epic 8 — Windows App (Rust + iced)
**Goal:** Fast, lightweight native Windows app -- single .exe, no runtime dependencies.

### Story 8.2: Engine Integration (Direct Linking)

As a **Windows developer** building CalcPad,
I want the iced app to directly link the Rust CalcPad engine with zero serialization overhead,
So that the app is as fast as possible with no FFI boundary costs.

**Acceptance Criteria:**

**Given** the iced app's `Cargo.toml` includes `calcpad_engine` as a dependency
**When** the app is compiled
**Then** the engine is statically linked into the single `.exe` binary

**Given** the app calls `SheetContext::new()` and `context.evaluate_line("2 + 2")`
**When** the engine processes the call
**Then** the result is returned as a native Rust type (no JSON/string serialization boundary)

**Given** the app evaluates a full sheet
**When** `context.evaluate_sheet(text)` is called
**Then** all lines are evaluated with full dependency resolution and results are returned as a `Vec<LineResult>`

**Given** the engine is used directly via `use calcpad_engine::SheetContext;`
**When** the app binary is built in release mode
**Then** the engine code is inlined and optimized by the Rust compiler as if it were part of the app itself
