Requirements
This document describes different solutions that have been investigated on behalf of the FINOS Financial Objects Working Group to:
...
- All the others are already implemented within the FDC3 program activity, using TypeScript, TypeDoc and GitHub Pages as solution, read more on ODP Wiki page
- There is no standard approach for “DSL for object definitions that binds into all (main) languages (mentioned above on #3)”
- TypeScript, which is, by far, the most adopted language within FINOS for this purpose, doesn’t provide transpiling features into many other languages; there are several libraries that tackle 1:1 transformations, but none of them seem to be widely adopted or be supported by a solid open source community.
Solutions
The solution space is basically split in 2, language-driven and data-driven solutions.
Language-driven
Adopt a programming language to define objects and rely on the language compilers/transpilers to produce language-specific bindings (ie an NPM or JAR package)
- Protocol Buffers (from Google) is a strong solution for defining objects (and implementation) that comply with RPC semantics using the strongly-typed binary data format (of protocol buffers); for this reason, generated objects and interfaces comply with a custom data format, they are not plain old objects.
- Kotlin is a JVM-based programming language, so it’s natively compatible with Java, which provides Interop capabilities for Javascript, C, Swift and others. For Typescript, there’s a Gradle plugin that allows Typescript generation from Kotlin, although it’s maintained by a humble community (3 contributors). Kotlin is also the most trending language in 2018, with a growth of 260% on GitHub public repositories.
- Haxe, similar to Kotlin, but with a wider support for language bindings; the downside is that there is some custom coding needed in order to bind to TypeScript, which is - by far - the most important binding to deliver
Data-driven
Define a format, using a general purpose markup language (like YAML), that allows to define object definitions (as described on #1) and build custom solution to generate site documentation and language-specific bindings.
...