Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditions, Functions and Ensuring Consistency Across Different Programming Languages #3287

Open
dschwartznyc opened this issue Dec 3, 2024 · 2 comments
Labels
TAWG PR to be reviewed by the Technical Architecture Working Group

Comments

@dschwartznyc
Copy link
Contributor

To ensure the potential for CDM implementations to consistently operate across different programming languages, conditions should either be defined in the CDM Rune model directly or, well documented and clearly defined as such if explicitly implemented in a programming language. Further, wherever possible existing implementations in a programming language should be migrated to Rune directly.

Absent this consistency, there is clear potential for divergence in the behavior of the library across different languages.

As example, Trade has a condition that explicitly leverages a Java implementation.

condition FpML_ird_8: <"FpML validation rule ird-8 - If the same party is specified as the payer and receiver, then different accounts must be specified.">
        if tradableProduct -> product -> contractualProduct -> economicTerms -> payout -> interestRatePayout exists
        then FpmlIrd8(tradableProduct, account) = True

This issue should first be reviewed in the TAWG to confirm consensus support for a recommendation and then raised to the SWG for prioritization and on going governance.

@LionelSG-REGnosys
Copy link
Contributor

We have discussed this issue before and I feel that it is actually the function that needs to be documented as externally implemented, rather than the condition (i.e. the func FpmlIrd8 in this case).

I actually raised this as a Rune issue previously: finos/rune-dsl#773

@dschwartznyc
Copy link
Contributor Author

@Oblongs thanks.

In addition to the concerns cited in the issue above, any externally implemented function needs to have a clear definition of its expected behavior and, ideally, include unit tests that confirm that it behaves as expected. Otherwise implementation in other languages will be a challenge and CDM overall might face inconsistencies across different implementations.

It seems that the best route to consistency is to implement functions in Rune directly wherever possible.

@LionelSG-REGnosys LionelSG-REGnosys added the TAWG PR to be reviewed by the Technical Architecture Working Group label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TAWG PR to be reviewed by the Technical Architecture Working Group
Projects
None yet
Development

No branches or pull requests

2 participants