edgarfgp/Fabulous.AST
62.0
Adequate · 3 October 2026
23.8k
lines of production code
F#
primary language
2
measurements over time
What this system is
Fabulous.AST is an F\# library that provides a domain-specific language for programmatically constructing and manipulating F\# abstract syntax trees. It enables developers to generate syntactically correct F\# source code from within applications, supporting complex constructs like types, members, expressions, and patterns. The system also includes utilities for transforming existing Fantomas Oak syntax trees and automatically generating F\# record types from JSON schemas.
How it got here
2023 — Initial AST DSL implementation and testing
7 changes.
This period established the foundational structure and dependency management for the Fabulous.AST library, introducing the core Oak DSL for programmatically generating F\# source code. It focused on implementing comprehensive widgets for type definitions and expressions, supported by extensive unit tests to ensure code generation correctness and round-trip fidelity.
2024 — AST DSL feature expansion and optimization
13 changes.
This period focused on significantly expanding the Fabulous.AST DSL by adding comprehensive widget builders and corresponding tests for F\# expressions, patterns, module declarations, member definitions, and type syntax. The work also included a performance-oriented refactor of the DSL layer to reduce heap allocations through stack-optimized data structures.
2025–2026 — AST code generation and rewriting
7 changes.
This period focused on expanding the Fabulous.AST library with new capabilities for generating F\# types from JSON schemas and rewriting Fantomas Oak syntax trees. Key developments included the introduction of MSBuild integration for automated type generation, robust JSON parsing with configuration options, and a bottom-up rewriter for syntax tree transformations. Comprehensive test coverage was added to validate these new features against complex F\# patterns and real-world scenarios.
Features
Add Playground sample with JSON schema generation
A new Playground sample has been added to demonstrate the Fabulous.AST.Build tool. It includes JSON schemas (user.json, complex-api.json) and the corresponding generated F\# types (user.g.fs, complex-api.g.fs), along with a Generator module that uses the Oak DSL to produce formatted source code and a Common module for file-writing utilities.
samples · high confidence
Expanded AST expression widget coverage
The \src/Fabulous.AST/Widgets/Expressions\ module now includes a broad set of new widget builders for F\# AST expression nodes, enabling more comprehensive code generation and manipulation. New capabilities include widgets for anonymous struct records, application expressions (including \failwith\), long-identifiers with single-paren arguments, lambda applications (both standard and match-lambda), array and list literals, expression chains, computation expression bodies and statements, dot-indexed get/set operations, dot-lambda syntax, and named indexed property sets. These additions allow users to construct and transform a wider variety of F\# language constructs within the AST.
src/Fabulous.AST/Widgets/Expressions · high confidence
Initial release of the Fabulous.AST widget DSL for generating F\# source code
This change introduces the \src/Fabulous.AST/Widgets\ module, providing a comprehensive set of widgets and builder methods for constructing F\# Abstract Syntax Trees (AST) that are rendered into valid source code via Fantomas. The new API allows users to programmatically define F\# constructs—including namespaces, modules, types, members, expressions, patterns, attributes, and constants—using a fluent, composable DSL. Key additions include the root \Oak\ widget, namespace and module builders, type and member definitions, expression and pattern widgets, and utility helpers for escaping strings and handling hash directives, enabling the generation of syntactically correct F\# code from within F\# applications.
src/Fabulous.AST/Widgets · high confidence
Initial repository structure and configuration
The repository is initialized with essential configuration files including .editorconfig for code formatting, .gitattributes for line-ending normalization, and a comprehensive .gitignore. A CHANGELOG.md is added following the Keep a Changelog format, documenting the project's history from version 1.0.0-pre15 through 2.0.0-pre08, including breaking changes to the Gen API and record field accessibility. The solution file Fabulous.AST.sln defines the project structure with main library, tests, and extensions. Directory.Build.props sets up shared MSBuild properties for NuGet packaging and F\# compiler flags. A build.fsx script using Fun.Build provides CI pipelines for linting, building, testing, documentation generation with FsDocs, and packaging. The README.md is expanded with installation instructions, usage examples comparing Fantomas vs Fabulous.AST, and links to documentation. Additional documentation files include CONTRIBUTING.md and CODE\_OF\_CONDUCT.md.
(repo-wide) · high confidence
New AST widgets for F\# member definitions
The \src/Fabulous.AST/Widgets/MemberDefinitions\ directory now contains dedicated widget implementations for generating F\# member definitions, including abstract slots, auto-properties, let bindings, default members, explicit constructors, extern bindings, fields, and functions. These new components provide a structured way to define class and module members within the AST, supporting features such as accessibility modifiers, XML documentation, attributes, and parameter handling.
src/Fabulous.AST/Widgets/MemberDefinitions · high confidence
New AST widgets for module declarations
The \src/Fabulous.AST/Widgets/ModuleDeclarations\ area now provides a comprehensive set of new widgets to construct F\# module-level declarations within the Oak DSL. This includes \ExceptionDefn\ for defining exception types with union cases and members, \ModuleAbbrev\ for creating module abbreviations, \NestedModule\ for defining nested modules with recursive and accessibility modifiers, \Open\ for handling \open\ and \open type\ directives, \ParsedHashDirective\ for hash directives like \\#nowarn\ and \\#help\, and \Val\ for declaring values with support for leading keywords (e.g., \static member\), mutability, inlining, and type parameters. These widgets enable users to programmatically generate complex module structures, attributes, and documentation comments using the \Ast\ builder syntax.
src/Fabulous.AST/Widgets/ModuleDeclarations · high confidence
New DSL widgets for F\# pattern matching constructs
The \src/Fabulous.AST/Widgets/Patterns\ directory now contains a comprehensive set of new widget modules that expose F\# pattern matching syntax as first-class DSL elements. This includes builders for logical combinations (Ands, Or), structural patterns (Tuple, StructTuple, List, Array, Record, ListCons), binding patterns (As, Named, NamePatPair, NamePatPairs, OptionalVal, LongIdent), and specialized cases (IsInst, QuoteExpr, ExternBindingPattern, ImplicitConstructor). Users can now construct complex pattern trees using the \Ast\ extension methods (e.g., \AndsPat\, \ListPat\, \RecordPat\) which integrate with the existing \WidgetBuilder\ system.
src/Fabulous.AST/Widgets/Patterns · high confidence
New DSL widgets for F\# type definitions
The \src/Fabulous.AST/Widgets/TypeDefinitions\ directory now provides a comprehensive set of new widgets to generate F\# type definitions via the Oak DSL. This includes dedicated builders for Abbreviations, Augmentations, Delegates, Enums (with cases), Measure types, Records (with field accessibility handling), Unions (with cases), and explicit Class/Struct/Interface definitions. Common modifiers for all type definitions—such as XML documentation, attributes, type parameters, accessibility levels (public/private/internal), and recursion—are standardized in \TypeDefn.fs\.
src/Fabulous.AST/Widgets/TypeDefinitions · high confidence
New DSL widgets for F\# type syntax construction
The \src/Fabulous.AST/Widgets/Types\ directory now contains a comprehensive set of new widget implementations for constructing F\# type AST nodes. This includes dedicated modules for anonymous types (\Anon\, \AnonRecord\), application prefixes and postfixes (\AppPrefix\, \AppPostfix\), arrays, function types (\Funs\), hash constraints, intersections, long identifier applications, measure powers, union types (\Or\), parenthesized types, signature parameters, static constants, struct tuples, standard tuples, type parameter declarations (\TyparDecls\), type constraints (\TypeConstraint\), type variables (\Var\), and global/subtype constraints. Each module provides a registered widget key and builder extensions on the \Ast\ type, enabling users to programmatically build complex type structures using a fluent API.
src/Fabulous.AST/Widgets/Types · high confidence
New Fabulous.AST.Json extension for generating F\# types from JSON
This release introduces the Fabulous.AST.Json extension, which allows users to parse JSON strings and automatically generate corresponding F\# record types, nested types, and type aliases via the Fabulous.AST DSL. The new Json widget supports configuration options such as custom root type names, case-insensitive property matching, and relaxed parsing modes (allowing trailing commas and comments). It also includes robust field name sanitization to ensure generated identifiers are valid F\# code, handling reserved keywords, leading digits, and special characters like backticks.
extensions/Fabulous.AST.Json · high confidence
New MSBuild task for generating F\# types from JSON files
The Fabulous.AST.Build extension now includes a new MSBuild task that automatically generates F\# record types from JSON schema files at build time. By adding a \FabulousAstJson\ item to your project file, the build process will create corresponding F\# types, supporting features like custom root names, file-level modules, and incremental regeneration based on content hashing. Generated files are automatically included in compilation and ordered before user source files, eliminating the need for manual \Compile Include\ entries.
extensions/Fabulous.AST.Build · high confidence
New bottom-up AST rewriter for Fantomas Oak syntax trees
A new \Rewrite\ module has been added to \Fabulous.AST\ that provides a bottom-up rewriter for Fantomas Oak syntax trees. This tool visits every expression reachable from an Oak node—including those within type definitions, member bodies, attributes, patterns, and types—and applies a user-provided transformation function after rebuilding each node's children. The implementation preserves reference equality for unchanged subtrees to avoid unnecessary reallocation, and includes aliases to resolve naming collisions between Fantomas Oak data union names and existing Fabulous.AST widget modules.
src/Fabulous.AST/Rewrite · high confidence
Behavioural changes
Introduces a new stack-optimized DSL implementation for the AST
The DSL layer in src/Fabulous.AST/DSL has been replaced with a new implementation focused on performance. This change introduces stack-allocated collections (StackList) and struct-based primitives to minimize heap allocations and GC pressure. It replaces the previous AttributeCollectionBuilder with a new WidgetBuilder that uses computation expressions to construct Widget structs, which now store attributes in sorted arrays for efficient lookup.
src/Fabulous.AST/DSL · high confidence
Test coverage
Added specialized tests for complex code generation scenarios; Added tests for AST attribute generation; Added tests for AST code generation, parsing, and trivia handling; Added tests for AST expression and type-definition rewrites; Added tests for AST member definition widgets; Added tests for AST pattern generation; Added tests for AST type definition widgets; Added tests for AST type generation widgets; Added tests for JSON-to-AST generation; Added tests for module declaration widgets; Added tests for top-level binding generation in Fabulous.AST; Added unit tests for AST constant, nullness, and XML documentation generation; Expanded test coverage for AST expression widgets.
Dependencies
Initial dependency setup and project structure for Fabulous.AST
This change introduces the foundational project structure and dependency management for the Fabulous.AST library. It adds a centralized \Directory.Packages.props\ file to manage versions for Fantomas.Core (7.0.1), FSharp.Core (10.1.300), and various testing libraries (xunit.v3, FsCheck, FsUnit). It also defines the core \Fabulous.AST\ library targeting net8.0, net10.0, and netstandard2.1, alongside the \Fabulous.AST.Json\ extension and an MSBuild task (\Fabulous.AST.Build\) for generating JSON types. Additionally, a \Playground\ sample project is added to demonstrate the JSON generation feature across multiple .NET versions.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 63 → 62 (-0.8)
- Rubric changed (rubric-2026.09.13 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 80 → 79 (-0.0)
- Architecture 100 → 100 (+0.1)
- Maturity 55 → 55 (+0.0)
- Readiness 59 → 56 (-3.0)
- Security 73 → 73 (+0.0)
Resolved (1)
- Duplicated block (8–10 lines × 13) (src/Fabulous.AST/Widgets/MemberDefinitions/AutoProperty.fs)
New (3)
- Duplicated block (10 lines × 4) (src/Fabulous.AST/Widgets/MemberDefinitions/AutoProperty.fs)
- Duplicated block (8 lines × 13) (src/Fabulous.AST/Widgets/MemberDefinitions/AutoProperty.fs)
- Flaky test: Fabulous.AST.Tests::Fabulous.AST.Tests.Core.PatternTriviaTests.Fabulous.AST.Tests.Core.PatternTriviaTests.Pattern trivia after with line comment
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
edgarfgp/Fabulous.AST was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 1433d801889a03f134fb29e9bd4ac74e2c71ba77 — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-4f4226d619ea.