Xantham
A schema-driven TypeScript → F# bindings generator.
Xantham is a hard fork of Glutinum that tackles the TypeScript-to-.NET bindings problem differently. Instead of a single end-to-end pipeline it separates concerns into extract, encode/decode, and generate phases across Fable and .NET boundaries. The common JSON schema is the only hand-off point; generators consume Xantham.Decoder and never touch the extraction layer.
Glutinum vs Xantham
Both tools read .d.ts files and emit F# bindings. They make different trade-offs.
Glutinum |
Xantham |
|
|---|---|---|
Try it now |
Web playground — browser, no install |
CLI only — requires Node.js + .NET SDK |
Setup |
Zero |
Moderate |
Input scope |
One |
Entire type graph, recursively across all referenced files |
Import statements |
Not generated — wired by hand |
Generated automatically; provenance is tracked through the full type tree |
Output style |
Single built-in format |
User-defined — bring your own strategy (string concat, Fabulous.AST, SyntaxOak, …) |
Encoder replaceability |
N/A — monolithic |
TSC can be swapped (e.g. TSGO) without touching decoders or generators |
Decoder reuse |
N/A |
Any consumer takes a dependency on |
Complexity |
Low |
Higher — three distinct phases |
Choose Glutinum when you need a quick answer for a single file and want zero friction.
Choose Xantham when you need the full picture: multi-file type graphs, generated imports, and control over how the output looks.
How It Works
Glutinum
Xantham
Xantham's extractor follows every type reference recursively. By the time the decoder receives the schema it has the complete type graph — all the information needed to resolve cross-file references and emit accurate open / import statements.
Modules
Module |
Role |
|---|---|
Xantham.Common |
Shared discriminated union schema ( |
Xantham.Fable |
TypeScript extractor compiled to JS via Fable. Crawls |
Xantham.Fable.Core |
Minimal Fable bindings stub. Provides F# representations of TypeScript type-system idioms ( |
Xantham.Decoder |
.NET library. Decodes the JSON schema into strongly-typed F# structures and provides a utility layer for generator consumption. |
Xantham.Generator |
Core rendering library — path system, type-ref model, and F# AST helpers. |
Current Status
Component |
Status |
Notes |
|---|---|---|
Schema ( |
🟡 RC |
Near-stable; breaking changes require coordinated updates across all layers. |
Reader ( |
🟡 RC |
Handles large hierarchies (e.g. solid-js). Stack-based traversal avoids JS stack overflows. |
Decoder ( |
🟡 RC |
Review documentation and testing. |
Generator ( |
🟠 In progress |
Structural output works. |