Skip to content

feat(ffi): export kio's clock as moq_clock_* - #390

Draft
kixelated wants to merge 3 commits into
mainfrom
quest/m1/ffi-export/crates
Draft

kixelated wants to merge 3 commits into
mainfrom
quest/m1/ffi-export/crates

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

moq-clock's items exported under the bare prefix: now() and origin() were moq_now and moq_origin, which read like moq-net's origin types. moq has since moved moq-clock into kio::clock (moq-dev/moq#7027), and rs/moq-clock is gone from moq's main.

Approach

  • The exporter's recipes pin moq at 947c91d0, which has kio::clock, and export kio's clock in moq-clock's place: the rule names its items moq_clock_*.
  • The pin is the exporter's own moq_rev in ffi/justfile; just ts's stays where it is (see Decisions needed). ts's moq-pin takes the revision.
  • 947c91d0 is the last commit before fix(net): take a reserved group without asking its cursor again moq#7032, past which moq-tokio's Send check overflows the recursion limit that just ffi moq denies.
  • Two clock renames stay, since the rule still clashes a function with its type: clock::wall is moq_clock_now_wall and clock::interval is moq_clock_interval_every.
  • moq-mux's media Clock held moq_clock, so its now and wall clashed with the clock's. It is renamed to moq_mux_clock, beside moq-mux's other mux_* renames.
  • The 288 commits of moq the pin moves over change what the export refuses (moq-net, moq-tokio's QUIC driver, moq-mux, hang, kio), so the config's excludes follow just ffi census. moq.c, moq.cpp, and moq.kt follow moq-net's renames (path::Error, origin::Consumer::request).

Checks: just ffi moq (C, C++, Kotlin against the export) passes; the bench's export.c, export.cpp, and export.kt build against the new header.

Impact

  • C names of moq's export, recorded in ffi/MIGRATE.md: moq_now is moq_clock_now (C++ moq::clock_now, Kotlin clockNow), and each of moq-clock's items moves under moq_clock_. moq-mux's Clock is moq_mux_clock. moq-net's upstream renames follow.
  • No change to the exporter's own API.

Alternatives

  • Bump the one pin both just ts and just ffi share. moq dropped moq-wasm in chore!: remove WASM support moq#7475, which picked the browser's randomness for moq-net on wasm32, so just ts moq and just ts census fail to build getrandom and uuid past it.
  • Pin moq's main: just ffi moq fails on the recursion limit lint above.
  • Rename kio's clock::now and clock::wall instead of moq-mux's Clock: moq_clock_now is the clock's natural name, and moq-mux's type is the one that borrows the namespace.

Follow-ups

Decisions needed

  1. The split pin. The exporter pins moq ahead of the translator.
    • A (recommended, implemented): keep the split until Translate moq-net without moq-wasm lands.
    • B: hold this PR until the ts quest lands, then bump the one pin.
    • C: fix moq-net's wasm32 randomness for the translator in this PR.
  2. moq-mux's Clock C name.
    • A (recommended, implemented): moq_mux_clock, with TIMESCALE as moq_mux_clock_fixed_timescale.
    • B: moq_media_clock.
    • C: keep moq_clock for moq-mux and rename kio's clashing functions instead.

Review

Round 1: quest review, Codex gpt-6.1-sol at medium effort, on head ee324f6d: no findings. Head 48fd8e12 adds only a conflict-free merge of main.

just ci passes on 48fd8e12, and just ffi moq passes on ee324f6d.

🤖 Generated with Claude Code

@kixelated kixelated changed the title moq-clock's C names once it moves into kio feat(ffi): export kio's clock as moq_clock_* Nov 1, 2026
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision, 2026-11-01: hold this PR until rust2 has one moq pin again, once TypeScript can move to moq's main (quest ts-moq-pin).

(written by Claude Opus 5.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant