Go · Platform Notes

Platform Notes

3.0.0-rc.1 · 4c3e5023

§ What This Binding Does Not Expose

  • Deferred cursor and stream pulls. The C interface takes a deferred completion on usearch_dense_cursor_next and usearch_dense_search_stream_next, while every pull here blocks on the receiver’s executor.
  • Name parsers. The usearch_*_from_name functions are left out, since enums are never read from strings.
  • Class names and the numeric version. usearch_cpu_class_name, usearch_gpu_class_name and usearch_version are unbound; Version answers the version’s name.

§ Design

  • A thin layer over the C ABI. Every name follows c/usearch/: a C verb usearch_dense_<verb> is a <Verb> method here, and enums mirror C enums, never strings.
  • The receiver chooses, the verb stays. The index runs a verb on the calling goroutine, On(executor) blocks on an executor, and Deferred(executor) submits it, all with the same arguments.
  • Deferred calls use the language’s own idioms. Status polls through usearch_outcome_status and Wait blocks through usearch_outcome_wait; a goroutine calling Wait overlaps the wait, and a select reaches it through a channel that goroutine closes.
  • No life of its own. The binding starts no goroutines and keeps no queues; releasing a Deferred rides Close, which waits for the call first, or the collector’s cleanup, which frees it only once final.
  • Arenas are lent and reused, never shared. Every output whose length scales with the call lands in an arena the caller passes; each rewind bumps the arena’s generation, so a stale view answers StatusUninitialized.
  • Nothing costs anything until it is used. Submitting a call allocates nothing, and an arena allocates only when a call writes into it.
  • Types and configs are the header’s. Every type is its C name without usearch_ and _t, a verb’s argument structure becomes its Dense*Config, and every wrapper’s documentation names the C symbol it calls or says it is binding-only.