Files
periscope/.cursor/rules/30-rust.mdc
T
michele 2f2e35e802 Replace paraphrased constitution with the 1224-line master.
Copy CODING_CONSTITUTION.md from the AgentStore docs/development path and split
the seven always-on .mdc files from that exact text.
2026-09-20 18:24:29 +02:00

95 lines
1.4 KiB
Plaintext

---
alwaysApply: true
---
# 33. RUST IS NOT A DEFAULT
Rust must not be introduced simply because code is new.
Rust is justified only when there is a demonstrated engineering requirement.
Valid reasons include:
* measured performance bottleneck;
* computationally intensive geometry;
* large-scale spatial processing;
* numerical computation;
* graph processing;
* memory pressure;
* deterministic high-performance computation.
Do not use Rust speculatively.
---
# 34. MEASURE BEFORE MOVING TO RUST
Required sequence:
```text
correct implementation
measurement
profiling
identified bottleneck
Rust implementation
benchmark
accept/reject based on evidence
```
Do not introduce Rust based on assumptions about performance.
---
# 35. RUST BOUNDARIES MUST BE COARSE-GRAINED
Prefer:
```text
Python
structured input
Rust engine
structured result
Python
```
Avoid excessive Python ↔ Rust calls for individual operations.
Rust should encapsulate meaningful computational workloads.
---
# 36. DO NOT PREMATURELY FREEZE THE CORE IN RUST
The semantic model should first become correct and well understood.
Prefer:
```text
semantic model
correctness
tests
architecture stabilization
profiling
Rust where justified
```
Do not rewrite the entire Periscope core in Rust simply to establish a Rust architecture.
---