packages feed

aihc-cabal-syntax-1.0.0.1: README.md

<!-- Generated by scripts/readme.py. Do not edit. -->
# aihc-cabal-syntax

A small Haskell library that parses `.cabal` files for the aihc compiler.
It provides package data, version ranges, and condition evaluation without a runtime dependency on Cabal or Cabal-syntax.
It uses Megaparsec. It does not solve dependencies or build packages.

## Hackage results

The fixed Hackage index contains **200,642 file revisions**.
The reference parser is **Cabal-syntax 3.18.1.0**.

| Result | Files | All files |
| --- | ---: | ---: |
| aihc-cabal-syntax accepts | 200,642 | 100.00% |
| Cabal-syntax accepts | 200,642 | 100.00% |
| Equal converted data | 200,642 | 100.00% |

An accepted file does not prove full compliance.
The equality test compares complete `GenericPackageDescription` values after conversion of our AST.
Conversion limits can also cause differences. This library is not a complete replacement for Cabal-syntax.

## Stackage LTS results

The Stackage test uses **Stackage LTS 24.38** with **3,370 packages**.
The pinned Nixpkgs revision supplies the package list.
The test uses the last revision of each package version in the fixed Hackage index.

| Result | Packages | All packages |
| --- | ---: | ---: |
| aihc-cabal-syntax accepts | 3,370 | 100.00% |
| Cabal-syntax accepts | 3,370 | 100.00% |
| Equal converted data | 3,370 | 100.00% |

The Nix check fails if a package in the snapshot does not have equal converted data.

## Parse benchmark

Each parser reads all **200,642 revisions** in a separate process on the same machine.

| Measurement | aihc-cabal-syntax | Cabal-syntax | aihc / Cabal-syntax |
| --- | ---: | ---: | ---: |
| Elapsed time | 47.64 s | 132.77 s | 0.36× |
| Peak process memory (RSS) | 23.20 MiB | 37.56 MiB | 0.62× |

A ratio below 1 means less time or memory than Cabal-syntax.
Measured on `aarch64-darwin` with GHC 9.10.3, `-O2`, and one RTS capability.
Time includes archive input, parsing, and result evaluation through `show`.
The benchmark includes rejected files. It discards each result before the next file.
Each parser has one measured run. Machine load and file caching affect the time.
The parsers produce different data and accept different numbers of files; these ratios include that difference.

## Build and update

```sh
nix build --no-update-lock-file
nix flake check --no-update-lock-file
nix run .#update-readme --no-update-lock-file
```

The update command runs the full comparison and a new benchmark, then writes this README and the measurement data.
Nix pins the tools and test data. See [test details](docs/hackage.md) and [API use and limits](docs/api.md).