Skip to content

Support for Rune defined functions#184

Merged
dschwartznyc merged 118 commits into
mainfrom
feature/function_support
Apr 21, 2026
Merged

Support for Rune defined functions#184
dschwartznyc merged 118 commits into
mainfrom
feature/function_support

Conversation

@dschwartznyc
Copy link
Copy Markdown
Contributor

@dschwartznyc dschwartznyc commented Apr 10, 2026

PR Summary

This PR delivers comprehensive function and expression generation support

Runtime Dependency: this release requires rune-python-runtime v2.0.0, which is available on PyPI. The generated pyproject.toml declares rune.runtime>=2.0.0,<3.0.0

What's new

  1. Function support

    • Comprehensive support for Rune defined functions, including stepwise object construction (ObjectBuilder), enum-based dispatch, and pre/post conditions.
    • Integration of externally defined native "hand-crafted" functions where the Rune definition specifies [codeImplementation] or is empty.
    • Support for side-effect-free pass-by-value function inputs.
  2. Completion of support for all Rune defined expressions

    • Closed the gap of missing collection and list operators (sort, min, max, reduce, distinct, flatten, reverse, sum, one-of).
    • Support for implicit closure parameters and closure-based keys for collection operations.
    • Correct null / "nothing" propagation through expression chains.
    • Support for with-meta and as-key.
  3. Circular reference support

    • Closed gaps and resolved issues in the handling of inheritance and attributes.
  4. Significant load performance improvement

    • Load time reduced by approximately 98% (~120 s → ~2 s).
    • Mutually recursive elements partitioned into a small cyclic bundle (~6% of CDM types) with the remainder emitted as standalone files
  5. Completion of support for Type Aliases — type aliases are resolved with flattened naming conventions and collision handling.

  6. Refactored object, attribute, and expression generation — introduced PythonExpressionScope and companion blocks to simplify code and support reuse across the generator.

Test suite

  • Improved testing rigor and coverage.
  • JUnit suite reorganized from 54 to 22 classes with consistent Python* naming and less fragile assertions.
  • Python unit tests restructured so Rune filename, namespace, and pytest filename correspond without exception.

Known gaps

See RUNE_LANGUAGE_GAPS.md


For full details see RELEASE.md.

… reusing virtual environments, and enable conditional CDM builds.
…nd improve CDM development environment setup scripts.
…to be updated and 3 Python Unit Tests failing
…dd symbol shadowing for lambda parameters. Refactor expression generation to maintain its own levels
… update expression generators to utilize it, and refactor related tests.
… variable initialization and enhancing `add` operation handling for many-cardinality attributes and nested paths.
…s with expressions, add a test for `add` operations with aliases, and update the Python runtime setup.
@dschwartznyc dschwartznyc marked this pull request as ready for review April 17, 2026 21:24
@hugohills-regnosys
Copy link
Copy Markdown
Contributor

One general comment about the namespace prefixing for python. Prefixing CDM namespaces with FINOS makes sense, however for the rune-fpml project, it's not on FINOS and is owned by ISDA, so perhaps that should be prefixed with ISDA (or something).

Resolves all merge conflicts taking the feature branch as the source
of truth for all Java source and test files. Updates
rosetta.dsl.version to 9.78.0 from the renovate PR on main.
@dschwartznyc dschwartznyc merged commit 7e7e903 into main Apr 21, 2026
3 checks passed
@dschwartznyc
Copy link
Copy Markdown
Contributor Author

@hugohills-regnosys a sensible suggestion. unfortunately CDM and Rune FpML rune definitions have to be processed together and the generator does not currently support multiple namespace prefixes.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants