Architecture
One model, from your code to every runtime.
Palamedes has two halves. A native core does the heavy, shared work — extraction, catalogs, checks, compilation. Thin adapters connect it to each framework. That split is why changing or adding a framework doesn’t change your messages or your catalogs.
00 — The wrapper question
One model, several hosts
Your app keeps its decisions. Palamedes keeps the model consistent.
An application owns its routing, locale policy, rendering, and hosting. Palamedes owns the work that must stay consistent when any of those choices changes: authoring, transforms, catalogs, validation, compilation, and the runtime contract.
- 01
Application
Routes, documents, locale policy, rendering
- 02
Toolchain
Author, transform, extract, validate
- 03
Native core
Catalog semantics, audit, merge, compile
- 04
Artifacts
Generated modules, types, locale catalogs
- 05
Runtime
Request-scoped lookup and formatting
Typed N-API boundary · between orchestration and native semantics
01 — Compiled output
A real production artifact
The catalog enters the application as code, not a parser job.
The native compiler renders executable catalog modules. This is exact output from the renderer—not a hand-written approximation. Production hosts load that checked artifact through the parser-free entrypoint.
Generated catalog module
Inspect native renderer →import{defineCompiledCatalog as __palamedesDefineCompiledCatalog}from"@palamedes/core/compiled";const __pm0=(v,r)=>r.join("Hallo ",r.value(v,"name"));const __pb0=(v,r,p)=>r.join(r.pound(p)," Nachricht");const __pb1=(v,r,p)=>r.join(r.pound(p)," Nachrichten");const __pc0={["one"]:__pb0,["other"]:__pb1};const __pm1=(v,r)=>r.plural(v,"count",0,"plural",__pc0);export const messages=__palamedesDefineCompiledCatalog({["greeting"]:__pm0,["inbox"]:__pm1});export default { messages };02 — The machine
Mechanisms, not adjectives
Ten places where the design refuses to split apart.
Rust explains the speed. The rest of the story is where each decision lives and what keeps it from drifting. Every item below points to the code or the accepted decision behind it.
- 01Native catalog renderer →
Compiled, not interpreted
In v2, generated catalogs compile into message functions in development and production. Package roots and compiled subpaths use the same parser-free runtime. Invalid ICU fails compilation; missing compiled entries reach host error handling.
- 02Extraction cache →
The cache trusts the file system, conservatively
Extraction caches source analysis behind conservative file stamps. A cache miss is normal; a result that cannot be trusted is discarded instead of being treated as an optimization win.
- 03Thread-local extraction arena →
Arenas are reused, not allocated per file
Each extraction worker owns a thread-local Oxc arena and resets it between files. On the 1,500-file corpus, replacing per-file allocation removed the allocator pressure that had obscured useful parallel work.
- 04Ferrocat PO scanner →
SIMD is used where it pays
Ferrocat's PO scanner uses vectorized byte search—including a NEON path—then falls back to portable search. The optimization lives below the catalog contract, so host adapters do not need to know it exists.
- 05Worker-count evidence →
Parallelism is earned by measurement
The 1,500-file fixture measured 119 ms serial, reached 45 ms at four workers, then regressed to 197 ms at twenty. Profiling attributed 92.8% of twenty-worker samples to mach_vm_protect, so the default is bounded rather than maximal.
- 06Catalog artifact pipeline →
Ferrocat is one catalog engine
Ferrocat performs catalog parsing, merging, auditing, and compilation as one semantic surface. It exists so catalog correctness does not depend on a set of loosely coordinated scripts.
- 07Node binding surface →
The host boundary is typed and workflow-shaped
The Node binding passes typed values across N-API and exposes meaningful workflow operations. It avoids JSON transport and avoids pushing catalog semantics back into TypeScript orchestration.
- 08Adapter architecture →
Adapters stay thin
Framework integrations own host concerns such as module hooks, routing conventions, and rendering. They do not become alternate implementations of extraction, catalog behavior, or runtime meaning.
- 09Request-scope contract →
Hosts converge on one runtime contract
Servers load the active locale's complete compiled catalog lazily and share immutable messages across requests. Request-local locale and formatter state stays isolated. Browser adapters deliver the document locale's fragments along the module graph.
- 10Public-evidence guards →
Machine checks guard the marketing
The site derives benchmark display, corpus scope, matrix axes, and decision indexes from checked repository data. A changed fixture or missing decision cannot silently become a stronger public claim.
First-party Rust foundations
Three crates from the same open-source family carry the work that is not specific to Palamedes. Each is released separately, so the parsing and traversal layers can be read and reported against on their own.
- ferrocat →
Catalog and ICU semantics: PO and FCL parsing, merging, auditing, and compilation.
- ferromark →
CommonMark and MDX parsing behind the MDX extraction path.
- ferralk →
Parallel source discovery during extraction.