Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ Each of these was written wrong at least once and caught in review. Check them w
| "under 100 ms" for every port | True for JS (10 to 70 ms on 10,000 code points) and Rust (under 20 ms, release build). Python takes 40 to 170 ms. The suites enforce 1 s (JS, Python) and 2 s (Rust). Go: 3 to 7 ms (`go test -bench Parse10k` in `go/`, on an i7-4770S, Go 1.24, with other jobs running; JS on the same inputs 4 to 18 ms), ceiling 2 s. C: 1.4 to 5.7 ms (`test_bench` from a CMake Release build, GCC 9 at `-O3`, same i7-4770S, load average 6 from other jobs), ceiling 2 s. So "at most tens of milliseconds" holds for JS, Rust, Go and C, not Python. A 10,000-line tracklist: Go 0.33 to 0.38 s, C 0.34 to 0.39 s, JS 0.8 to 0.9 s. |
| "identical output for any input" | Identical on every fixture input. The Rust crate takes NFC from `unicode-normalization` (Unicode 18), Node 24 has Unicode 17, so 32 new combining marks can be ordered differently. Link `project/ports/#what-the-rust-port-taught`. |
| "zero dependencies" for the project | Zero in JS, Python and Go (the Go tables are generated from Node, not taken from `golang.org/x/text`). Rust has one, `unicode-normalization`. C needs only the C standard library, `libm` and the system's threads (pthreads, or Windows SRW locks); C++ is needed only for the wrapper's tests. |
| "on vcpkg / Conan", "install the C library with a package manager" | No package manager carries it. FetchContent from the release tarball, the amalgamation, or an install from source with `find_package` and pkg-config, all three from the first C release, 0.7.0. |
| "on vcpkg / Conan", "install the C library with a package manager" | No package manager carries it. FetchContent from the release tarball, the amalgamation, or an install from source with `find_package` and pkg-config, the tarball and the amalgamation from 0.7.1, the first C release with files. |
| "no recursion" for C | One recursive function, the JSON writer `tp_json_write`, bounded by the reader's `TP_JSON_MAX_DEPTH` (200). The pipeline has none. |
| a size in mixed units | Core: about 18 kB gzip. Tracklist entry: about 8.4 KiB (8,606 B), budget 9 KiB. Re-measure with `pnpm --filter trackparse build && pnpm --filter trackparse size`. |
| every suite checks "no word goes missing" | Only `rust/tests/properties.rs`, `go/properties_test.go` and `c/tests/test_properties.c` (the check is in `c/tests/hardening.c`) have that test today. |
Expand Down Expand Up @@ -1120,7 +1120,8 @@ Version rules:
`TRACKPARSE_VERSION_MAJOR` / `_MINOR` / `_PATCH` with `x-release-please-major` / `-minor` /
`-patch`) and `src/data_gen.h` (`TP_SPEC_VERSION`, which `c/scripts/gen_data.mjs` writes with the
marker, so `--check` stays clean after the bump). The release PR writes `c/CHANGELOG.md`, and
merging it tags `c-vX.Y.Z` (the default `-` separator). The first C release is 0.7.0. The
merging it tags `c-vX.Y.Z` (the default `-` separator). C was first tagged at 0.7.0, a release
with no files (`publish-c` failed on a test, see below); 0.7.1 is the first with files. The
manifest starts C at the linked 0.6.1, so expect its first changelog to link a `c-v0.6.1` tag
that never existed, as Go's and Rust's first entries did, and to list every commit under `c/`.
- **C publishing is files on the GitHub Release.** The `publish-c` job in `release.yml`
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,17 @@ go get github.com/4matic/trackparse/go@latest
C and C++ ([library README](c/README.md)). C11 (C++17 for the wrapper `trackparse.hpp`), no
dependencies beyond libc, `libm` and threads. Each release attaches a source tarball for CMake and
a single-file amalgamation to its [GitHub Release](https://github.com/4matic/trackparse/releases)
(tags `c-vX.Y.Z`, from 0.7.0):
(tags `c-vX.Y.Z`, from 0.7.1):

```cmake
include(FetchContent)
FetchContent_Declare(trackparse
URL https://github.com/4matic/trackparse/releases/download/c-v0.7.0/trackparse-c-0.7.0.tar.gz)
URL https://github.com/4matic/trackparse/releases/download/c-v0.7.1/trackparse-c-0.7.1.tar.gz)
FetchContent_MakeAvailable(trackparse)
target_link_libraries(app PRIVATE trackparse::trackparse)
```

0.7.0 is not out yet; until the releases page lists `c-v0.7.0`, build from a clone as in
[the C README](c/README.md#from-source).
To build from a clone instead, see [the C README](c/README.md#from-source).

## Quick start

Expand Down
11 changes: 5 additions & 6 deletions c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,24 @@ all of them, and for every fixture input its output is byte-identical to the
**Docs:** [Getting started](https://4matic.github.io/trackparse/start/getting-started/)

There is no package registry for C. Each release attaches two files to its
[GitHub Release](https://github.com/4matic/trackparse/releases) (tags `c-vX.Y.Z`, the first is
`c-v0.7.0`), with a `SHA256SUMS` file next to them:
[GitHub Release](https://github.com/4matic/trackparse/releases) (tags `c-vX.Y.Z`, the first with
files is `c-v0.7.1`), with a `SHA256SUMS` file next to them:

- `trackparse-c-X.Y.Z.tar.gz`: this folder, for CMake;
- `trackparse-c-X.Y.Z-amalgamation.zip`: `trackparse.c`, `trackparse.h` and `trackparse.hpp`, to
copy into a project.

Release files are never replaced: a fix is a new version, so a pinned hash keeps working.

The first release with the C library is 0.7.0. Until the releases page lists `c-v0.7.0`, the
download URLs below do not exist yet: build [from source](#from-source) instead, and leave the
version out of `find_package` (a checkout from before that release still says 0.6.1).
The C library was first tagged in 0.7.0, but that release has no files: its publish job failed
on a test. 0.7.1 is the first C release you can download.

### CMake FetchContent

```cmake
include(FetchContent)
FetchContent_Declare(trackparse
URL https://github.com/4matic/trackparse/releases/download/c-v0.7.0/trackparse-c-0.7.0.tar.gz
URL https://github.com/4matic/trackparse/releases/download/c-v0.7.1/trackparse-c-0.7.1.tar.gz
URL_HASH SHA256=<the tarball's line in SHA256SUMS>)
FetchContent_MakeAvailable(trackparse)

Expand Down
2 changes: 1 addition & 1 deletion go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ difference is described under [Unicode version](#unicode-version).
| Python | [trackparse on PyPI](https://pypi.org/project/trackparse/) | `pip install trackparse` | [README](https://github.com/4matic/trackparse/blob/main/python/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/python/CHANGELOG.md) · [API](https://4matic.github.io/trackparse/reference/parse/) |
| Rust | [trackparse on crates.io](https://crates.io/crates/trackparse) | `cargo add trackparse` | [README](https://github.com/4matic/trackparse/blob/main/rust/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/rust/CHANGELOG.md) · [API on docs.rs](https://docs.rs/trackparse) |
| Go | [github.com/4matic/trackparse/go](https://pkg.go.dev/github.com/4matic/trackparse/go) | `go get github.com/4matic/trackparse/go` | [README](https://github.com/4matic/trackparse/blob/main/go/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/go/CHANGELOG.md) · [API on pkg.go.dev](https://pkg.go.dev/github.com/4matic/trackparse/go) |
| C / C++ | [C library and C++ header](https://github.com/4matic/trackparse/blob/main/c/README.md) | CMake FetchContent from the [release tarball](https://github.com/4matic/trackparse/releases), or the amalgamation (from 0.7.0) | [README](https://github.com/4matic/trackparse/blob/main/c/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/c/CHANGELOG.md) · [header](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) |
| C / C++ | [C library and C++ header](https://github.com/4matic/trackparse/blob/main/c/README.md) | CMake FetchContent from the [release tarball](https://github.com/4matic/trackparse/releases), or the amalgamation (from 0.7.1) | [README](https://github.com/4matic/trackparse/blob/main/c/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/c/CHANGELOG.md) · [header](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) |

## Limitations

Expand Down
2 changes: 1 addition & 1 deletion js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ fixture input. You can parse in one language and read the result in another.
| Python | [trackparse on PyPI](https://pypi.org/project/trackparse/) | `pip install trackparse` | [README](https://github.com/4matic/trackparse/blob/main/python/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/python/CHANGELOG.md) · [API](https://4matic.github.io/trackparse/reference/parse/) |
| Rust | [trackparse on crates.io](https://crates.io/crates/trackparse) | `cargo add trackparse` | [README](https://github.com/4matic/trackparse/blob/main/rust/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/rust/CHANGELOG.md) · [API on docs.rs](https://docs.rs/trackparse) |
| Go | [github.com/4matic/trackparse/go](https://pkg.go.dev/github.com/4matic/trackparse/go) | `go get github.com/4matic/trackparse/go` | [README](https://github.com/4matic/trackparse/blob/main/go/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/go/CHANGELOG.md) · [API on pkg.go.dev](https://pkg.go.dev/github.com/4matic/trackparse/go) |
| C / C++ | [C library and C++ header](https://github.com/4matic/trackparse/blob/main/c/README.md) | CMake FetchContent from the [release tarball](https://github.com/4matic/trackparse/releases), or the amalgamation (from 0.7.0) | [README](https://github.com/4matic/trackparse/blob/main/c/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/c/CHANGELOG.md) · [header](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) |
| C / C++ | [C library and C++ header](https://github.com/4matic/trackparse/blob/main/c/README.md) | CMake FetchContent from the [release tarball](https://github.com/4matic/trackparse/releases), or the amalgamation (from 0.7.1) | [README](https://github.com/4matic/trackparse/blob/main/c/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/c/CHANGELOG.md) · [header](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) |

## Limitations

Expand Down
2 changes: 1 addition & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ fixture input. You can parse in one language and read the result in another.
| Python | [trackparse on PyPI](https://pypi.org/project/trackparse/) | `pip install trackparse` | [README](https://github.com/4matic/trackparse/blob/main/python/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/python/CHANGELOG.md) · [API](https://4matic.github.io/trackparse/reference/parse/) |
| Rust | [trackparse on crates.io](https://crates.io/crates/trackparse) | `cargo add trackparse` | [README](https://github.com/4matic/trackparse/blob/main/rust/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/rust/CHANGELOG.md) · [API on docs.rs](https://docs.rs/trackparse) |
| Go | [github.com/4matic/trackparse/go](https://pkg.go.dev/github.com/4matic/trackparse/go) | `go get github.com/4matic/trackparse/go` | [README](https://github.com/4matic/trackparse/blob/main/go/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/go/CHANGELOG.md) · [API on pkg.go.dev](https://pkg.go.dev/github.com/4matic/trackparse/go) |
| C / C++ | [C library and C++ header](https://github.com/4matic/trackparse/blob/main/c/README.md) | CMake FetchContent from the [release tarball](https://github.com/4matic/trackparse/releases), or the amalgamation (from 0.7.0) | [README](https://github.com/4matic/trackparse/blob/main/c/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/c/CHANGELOG.md) · [header](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) |
| C / C++ | [C library and C++ header](https://github.com/4matic/trackparse/blob/main/c/README.md) | CMake FetchContent from the [release tarball](https://github.com/4matic/trackparse/releases), or the amalgamation (from 0.7.1) | [README](https://github.com/4matic/trackparse/blob/main/c/README.md) · [changelog](https://github.com/4matic/trackparse/blob/main/c/CHANGELOG.md) · [header](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) |

## Limitations

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Install.astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const command = (lang: (typeof pms)[number]["lang"]) => (lang === "c" ? C_FETCHC
</>
) : (
<>
the C library ships as a tarball on <a href={PACKAGE.c.url}>GitHub Releases</a> from 0.7.0, which is not
the C library ships as a tarball on <a href={PACKAGE.c.url}>GitHub Releases</a> from 0.7.1, which is not
out yet; until then, <a href={C_SOURCE}>build it from the repository</a>.
</>
)
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Playground.astro
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ const listExamples: { label: string; title: string; text: string }[] = [
for (const x of document.querySelectorAll<HTMLElement>("[data-lang]"))
x.setAttribute("aria-pressed", String(x.dataset.lang === lang));
const p = PACKAGE[lang];
// Before 0.7.0 there is no C release yet, so the FetchContent URL answers 404.
const pending = lang === "c" && !C_RELEASED ? " (from 0.7.0, not released yet)" : "";
// Before 0.7.1 there is no C release yet, so the FetchContent URL answers 404.
const pending = lang === "c" && !C_RELEASED ? " (from 0.7.1, not released yet)" : "";
const html =
`<span>Install: <code>${escapeHtml(p.install)}</code>${pending}</span>` +
`<a href="${base}/start/getting-started/">Getting started</a>` +
Expand Down
8 changes: 4 additions & 4 deletions site/src/content/docs/project/ports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Tabs, TabItem } from "@astrojs/starlight/components";
| Python | [`trackparse`](https://pypi.org/project/trackparse/) on PyPI | 13,130 / 13,130 fixtures, output identical to JS. Tracklists in `trackparse.tracklist` |
| Rust | [`trackparse`](https://crates.io/crates/trackparse) on crates.io, API docs on [docs.rs](https://docs.rs/trackparse) | 13,130 / 13,130 fixtures, output identical to JS. Tracklists in `trackparse::tracklist` |
| Go | [`github.com/4matic/trackparse/go`](https://pkg.go.dev/github.com/4matic/trackparse/go), API docs on [pkg.go.dev](https://pkg.go.dev/github.com/4matic/trackparse/go) | 13,130 / 13,130 fixtures, output identical to JS. Tracklists in the same package (`trackparse.ParseTracklist`) |
| C | Source tarball and amalgamation on each [GitHub Release](https://github.com/4matic/trackparse/releases) from 0.7.0; the API is [`trackparse.h`](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) | 13,130 / 13,130 fixtures, output identical to JS. Tracklists in the same library (`trackparse_parse_tracklist`) |
| C | Source tarball and amalgamation on each [GitHub Release](https://github.com/4matic/trackparse/releases) from 0.7.1; the API is [`trackparse.h`](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h) | 13,130 / 13,130 fixtures, output identical to JS. Tracklists in the same library (`trackparse_parse_tracklist`) |

<Tabs syncKey="lang">
<TabItem label="JavaScript">
Expand Down Expand Up @@ -74,7 +74,7 @@ import { Tabs, TabItem } from "@astrojs/starlight/components";

| What | C |
|---|---|
| Install | CMake `FetchContent` from the release tarball, or copy the amalgamation (both from 0.7.0) |
| Install | CMake `FetchContent` from the release tarball, or copy the amalgamation (both from 0.7.1) |
| Needs | a C11 compiler (GCC, Clang or MSVC), C++17 for `trackparse.hpp`; CMake 3.16 or newer for the CMake build |
| Dependencies | none beyond libc, `libm` and threads |
| Types | read-only structs, C enums with `_name()` functions, opaque option handles |
Expand All @@ -96,8 +96,8 @@ the tag `go/vX.Y.Z`, which the Go module proxy reads
([published versions](https://proxy.golang.org/github.com/4matic/trackparse/go/@v/list)). C has no
registry either: a C release is the tag `c-vX.Y.Z`, with the source tarball
(`trackparse-c-X.Y.Z.tar.gz`), the amalgamation (`trackparse-c-X.Y.Z-amalgamation.zip`) and
`SHA256SUMS` attached to its GitHub Release, starting with 0.7.0. The
[changelogs](/trackparse/project/roadmap/#next) list what each release brought.
`SHA256SUMS` attached to its GitHub Release, starting with 0.7.1 (0.7.0 was tagged without
files). The [changelogs](/trackparse/project/roadmap/#next) list what each release brought.

## Adding a language

Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/project/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The changelogs list what has shipped so far:
[Rust](https://github.com/4matic/trackparse/blob/main/rust/CHANGELOG.md),
[Go](https://github.com/4matic/trackparse/blob/main/go/CHANGELOG.md) and the
[spec](https://github.com/4matic/trackparse/blob/main/spec/CHANGELOG.md). The C library gets its
changelog (`c/CHANGELOG.md`) with 0.7.0, its first release.
changelog (`c/CHANGELOG.md`) with 0.7.0; 0.7.1 is its first release with files to download.

## See also

Expand Down
16 changes: 8 additions & 8 deletions site/src/content/docs/start/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ import { Aside, Steps, Tabs, TabItem } from "@astrojs/starlight/components";
include(FetchContent)
FetchContent_Declare(
trackparse
URL https://github.com/4matic/trackparse/releases/download/c-v0.7.0/trackparse-c-0.7.0.tar.gz
URL_HASH SHA256=… # the trackparse-c-0.7.0.tar.gz line of SHA256SUMS on the release
URL https://github.com/4matic/trackparse/releases/download/c-v0.7.1/trackparse-c-0.7.1.tar.gz
URL_HASH SHA256=… # the trackparse-c-0.7.1.tar.gz line of SHA256SUMS on the release
)
FetchContent_MakeAvailable(trackparse)
target_link_libraries(my_app PRIVATE trackparse::trackparse)
```

C11, no dependencies beyond libc, `libm` and threads; it builds
with GCC, Clang and MSVC. Each release from 0.7.0 on, the first with the C library,
attaches the source tarball above (CMake 3.16 or newer), `SHA256SUMS` and an amalgamation
to its [GitHub Release](https://github.com/4matic/trackparse/releases). If the 0.7.0
release doesn't list them yet, build from a clone of the repository as the
[C README](https://github.com/4matic/trackparse/blob/main/c/README.md#from-source) shows.
with GCC, Clang and MSVC. Each release from 0.7.1 on attaches the source tarball above
(CMake 3.16 or newer), `SHA256SUMS` and an amalgamation to its
[GitHub Release](https://github.com/4matic/trackparse/releases). To build from a clone of
the repository instead, follow the
[C README](https://github.com/4matic/trackparse/blob/main/c/README.md#from-source).
`cmake --install` also gives you `find_package(trackparse)` and a `trackparse.pc` for
pkg-config. Without CMake, copy `trackparse.c` and `trackparse.h` from
`trackparse-c-0.7.0-amalgamation.zip` into your project and compile them with your
`trackparse-c-0.7.1-amalgamation.zip` into your project and compile them with your
sources (`cc -std=c11 -DTRACKPARSE_STATIC main.c trackparse.c -lm -lpthread`). The API is
one header,
[`trackparse.h`](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h),
Expand Down
2 changes: 1 addition & 1 deletion site/src/content/docs/start/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It comes as five packages with the same behaviour: `trackparse` on
and a C library with one header,
[`trackparse.h`](https://github.com/4matic/trackparse/blob/main/c/include/trackparse.h), released
as a source tarball and an amalgamation on each
[GitHub Release](https://github.com/4matic/trackparse/releases) from 0.7.0 on. Every example on
[GitHub Release](https://github.com/4matic/trackparse/releases) from 0.7.1 on. Every example on
this site has a tab for each language. The API docs of the Rust crate are on
[docs.rs](https://docs.rs/trackparse), and those of the Go module on
[pkg.go.dev](https://pkg.go.dev/github.com/4matic/trackparse/go).
Expand Down
Loading
Loading