Logo Xantham

Xantham

NuGet

A TypeScript → F# bindings generator, built on the TypeScript 7 compiler's own API server.

Xantham is a hard fork of Glutinum. It is mid-rebuild.

The whole project now sits on Xantham.TypeScript.Wire — a .NET client that runs the Go tsc binary as tsc --api, speaks its msgpack protocol over stdio, and reads the binary AST it returns in place, without JSON in the middle. The compiler's own schema generates the API surface, the kinds, the child slots and the typed node layer, so the client tracks upstream rather than paraphrasing it.

The earlier design — a Fable extractor crawling the TypeScript 5 JavaScript compiler API, a common JSON schema as the hand-off point, and a .NET decoder plus generator — has been retired. See .archive/ below.


Xantham.TypeScript.Wire

A standalone NuGet package, usable on its own with no dependency on the rest of Xantham.

Targets net10.0, net8.0 and netstandard2.1. See the package README to get started.

Documentation


The generator

Xantham.Generator turns a package's .d.ts into an F# binding file through four tiers — Harvest, Resolve, Shape, Render — each a linear list of small passes over an accumulating record. Alongside the binding it writes a manifest.json grading every symbol Exact, Ergonomic, Widened or Escape, so what a mapping cost is reported rather than discovered. Each finding carries a stable catalogue key (SI001), the pass that raised it, the qualified symbol and the declaring file, and the manifest tallies findings per pass.

Output targets Fable 5.x only, and depends on Fable.Core together with the Fable.Browser.* family — the DOM binding table is generated by intersecting those packages with the pinned compiler's own lib.*.d.ts. Progress is measured on a ladder of real npm packages pinned by version, each generated into a committed golden that is compiled as F# on every build.


Repository layout

Path

Role

src/Xantham.TypeScript.Wire

The client. Published to NuGet, usable on its own.

src/Xantham.Generator

The bindings generator: Harvest → Resolve → Shape → Render over Wire.

src/Xantham.Fable.Core

The support library generated bindings open (erased keyof, brands).

tests/Xantham.TypeScript.Wire.Tests

Expecto suite against the root pinned typescript 7.x package.

tests/Xantham.Generator.Tests

Expecto suite plus the golden corpus the generator is pinned against.

tests/Xantham.Generator.CompileGate

Compiles the committed goldens as F# on every build.

tools/tsc-ast

Vendors upstream compiler sources and emits the AST and enum F# layers.

tools/proto-gen

Emits the protocol F# layers from the shipped typescript schema.

tools/session-gen

Emits the session layer over the protocol surface.

tools/browser-gen

Emits the generator's DOM binding table from the Fable.Browser.* family.

build.fsx

The build pipeline.

.archive/

Obsolete pre-Wire work. Nothing in here is live.

.archive/

Everything under .archive/ is retired: Xantham.Common, Xantham.Fable, Xantham.Decoder, Xantham.Generator and their tests and docs, the superseded plans, and the old build system. It is kept as a record of obstacles already met, not as a source of truth — it does not build, is not referenced by the solution, and should not be read as a description of how Xantham works today.


Current Status

Component

Status

Notes

Wire (Xantham.TypeScript.Wire)

🟢 Shipped

Generated from the compiler's own schema; packaged for NuGet.

Generator (Xantham.Generator)

🟡 In progress

Phases A–C landed; phase D (erased idioms) is most of the way through. Not yet packaged.

Support (Xantham.Fable.Core)

🟡 In progress

Erased keyof/typekeyof and brand helpers, revived from the archive. Not yet packaged.


See the Docs

Docs are generated from the source.

Type something to start searching.