#30492
stdlib parity wave 2: API-level gap tracking
Summary
Tracking issue for wave 2 of the stdlib parity program — API-level (not module-level) gaps found by a deeper cross-language comparison against Rust std, Go std, Zig std, Odin core, Python stdlib and Node. Method and raw data: public-API inventories built from source and name-normalized against vlib's 7,984 library names across 501 modules; wave-1-shipped names excluded.
Prior art: #639 (closed), #30345 (wave-1 tracking). No duplicates found for any item below (searches run before filing).
Issues
- #30482 math.stats: variance/stdev/quantiles/correlation + normal distribution
- #30483 datatypes: heapq-compatible heap API
- #30484 arrays: bisect_left/right + insort_left/right
- #30485 math: lgamma, remainder, fma, classify, next_power_of_two, to_degrees…
- #30486 strings/arrays: cut, split_after, equal_fold, index_byte, is_sorted…
- #30487 io: reader combinators (read_byte, read_full, limited/tee/multi/section)
- #30488 os: same_file, is_absolute, copy_file, user_*_dir, volume_name…
- #30489 strconv.parse_bool + time add_date/weekday/clock
- #30490 rand: Zipf distribution
- #30491 difflib: unified/context/ndiff + get_close_matches
Each issue carries verified-absent evidence (names grepped in the vlib tree), a
V-idiomatic API proposal, and a red-first test plan; each PR lands new files
with v test / v fmt -verify / v missdoc / module-suite gates.
Deliberately excluded (verified not real gaps)
- Name-only aliases: hasprefix↔starts_with, basename↔os.base, extension↔os.file_ext, itoa↔str, month/year↔Time fields
- Inflated counts from Odin/Zig typed variants, compiler internals, Python internals (functools comparison wrappers, shutil _fastcopy block sizes)
- Language-coupled design: Rc/Arc (sync.arc shipped in #30361), is_dst (needs timezone rules — noted as follow-up in #30489), read_at (needs a read_at method on os.File — noted as follow-up in #30487)
Final status: wave 2 complete (10/10)
math/stats/regress.vdatatypes/heapq.varrays/bisect.vmath/float_ops.vstrings/text_ops.v,arrays/is_sorted.vio/reader_ops.vos/path_ops.v,os/same_file_windows.c.vstrconv/parse_bool.v,time/date_ops.vrand/zipf.vstrings/close_matches.vWhat verification changed (documented in each PR)
Name-level comparison said these were missing; source verification showed several already existed under other names, and each PR shipped only the real gap:
population_variance,sample_stddev,quantile,covarianceinmath.statscut→string.split_once;split_lines→split_into_lines;index_byte→index_u8;has_prefix→starts_withvlib/arrays/diff.generate_patch; similarity →strings.similarity(Levenshtein/Dice/Jaro-Winkler)Cross-cutting findings worth remembering
os.cpcreates hard links — "a copy is a distinct object" needs a real read/write copy in tests.__global/init()in vlib: a__globalbreaks every in-module test in the same module (calrified during the park/unpark work).vlib/time:days_from_unix_epochuses Hinnant's March-based months anddays_in_monthtakes(month, year).strings.Builderdoes not satisfyio.Writerfrom another module.All 10 PRs are open on
metif12/vbranches againstvlang/v:master, each with red-first-proven tests and thev test/v fmt -verify/v missdocgates.