Skip to content

feat: add strict numeric stdlib functions - #56

Merged
tiye merged 1 commit into
chore/msrv-contractfrom
feat/stdlib-numeric-functions
Aug 23, 2026
Merged

feat: add strict numeric stdlib functions#56
tiye merged 1 commit into
chore/msrv-contractfrom
feat/stdlib-numeric-functions

Conversation

@tiye

@tiye tiye commented Aug 22, 2026

Copy link
Copy Markdown
Member

Summary

  • define RFC 0113 for strict numeric standard-library functions
  • add abs, sum, min, and max without prototype or implicit conversion semantics
  • extend qtest standard-library coverage and host NaN/error-boundary tests
  • update and regenerate the Chinese, classical Chinese, English, Latin, and Devanagari manuals

Validation

  • make docs
  • make check

This PR is stacked on PR #55 and is intentionally not merged independently.

Copilot AI lite review requested due to automatic review settings August 22, 2026 17:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds strict numeric standard-library functions (abs, sum, min, and max) with finite-number validation, tests, RFC updates, and regenerated multilingual manuals. This PR is stacked on #55.

Changes:

  • Adds strict numeric built-ins and boundary coverage.
  • Extends qtest and Rust tests.
  • Updates RFCs, syntax documentation, and five multilingual manuals.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/scripts/stdlib.qc Extends executable standard-library coverage.
tests/rfc_core.rs Tests numeric behavior and error cases.
src/vm.rs Implements numeric built-ins and validation.
RFCs/0113-numeric-standard-library.md Defines numeric function semantics.
RFCs/0001-language-core.md Updates the built-in function inventory.
RFCs/0000-project-scope.md Registers RFC 0113.
README.md Links the latest RFC.
manuals/manual.zh-CN.qc Updates the Chinese manual source.
manuals/manual.latin.qc Updates the Latin manual source.
manuals/manual.en.qc Updates the English manual source.
manuals/manual.devanagari-sa.qc Updates the Devanagari manual source.
manuals/manual.classical-zh.qc Updates the classical Chinese manual source.
docs/syntax.zh-CN.md Documents numeric built-ins in Chinese.
docs/syntax.en.md Documents numeric built-ins in English.
docs/manual.zh-CN.md Regenerated Chinese manual.
docs/manual.zh-CN.html Regenerated Chinese HTML manual.
docs/manual.latin.md Regenerated Latin manual.
docs/manual.latin.html Regenerated Latin HTML manual.
docs/manual.en.md Regenerated English manual.
docs/manual.en.html Regenerated English HTML manual.
docs/manual.devanagari.sa.md Regenerated Devanagari manual.
docs/manual.devanagari-sa.html Regenerated Devanagari HTML manual.
docs/manual.classical-zh.md Regenerated classical Chinese manual.
docs/manual.classical-zh.html Regenerated classical Chinese HTML manual.
Suppressed comments (2)

tests/rfc_core.rs:1344

  • RFC 0000 (RFCs/0000-project-scope.md:21) requires every runtime addition to include a bytecode-verification test. This test only executes the new functions through Context::eval, so a verifier regression affecting programs containing these calls would not be covered. Add a compile(...).verify() assertion covering the new call forms.
fn numeric_standard_library_is_strict_and_total() {

tests/rfc_core.rs:1367

  • The finite-input contract includes both infinities, but this host-boundary test injects only NaN. A regression that removes the is_finite() guard for f64::INFINITY or f64::NEG_INFINITY would still pass; add both infinity cases to verify that abs and the aggregators reject all non-finite host numbers.
    host.set_global("nan", Value::Number(f64::NAN));
    assert!(host.eval("abs(nan)").is_err());
    assert!(host.eval("sum([nan])").is_err());

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Base automatically changed from feat/qbench-selection to chore/release-test-gate August 22, 2026 17:48
Base automatically changed from chore/release-test-gate to test/qtest-stdlib-showcase August 22, 2026 17:49
Base automatically changed from test/qtest-stdlib-showcase to chore/msrv-contract August 22, 2026 17:49
@tiye
tiye force-pushed the feat/stdlib-numeric-functions branch from 1784c57 to a212a66 Compare August 22, 2026 18:07
@tiye
tiye force-pushed the chore/msrv-contract branch from a18671b to 73b0533 Compare August 22, 2026 18:08
@tiye
tiye force-pushed the feat/stdlib-numeric-functions branch from a212a66 to 6b6ba36 Compare August 22, 2026 18:31
@tiye
tiye force-pushed the chore/msrv-contract branch 2 times, most recently from ba62c10 to 6528d38 Compare August 22, 2026 18:34
@tiye
tiye force-pushed the feat/stdlib-numeric-functions branch from 6b6ba36 to 6d95923 Compare August 22, 2026 18:35
@tiye
tiye force-pushed the chore/msrv-contract branch from 6528d38 to 271321b Compare August 22, 2026 18:52
@tiye
tiye force-pushed the feat/stdlib-numeric-functions branch from 6d95923 to b55fd9b Compare August 22, 2026 18:53
@tiye
tiye merged commit d0dbfa7 into chore/msrv-contract Aug 23, 2026
4 checks passed
@tiye
tiye deleted the feat/stdlib-numeric-functions branch August 23, 2026 04:12
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.

2 participants