2024-10-22 10:53:10 +00:00
|
|
|
# interoperability
|
|
|
|
api needs to facilitate easy interoperability with other languages and tools,
|
|
|
|
for that certain considerations are taken:
|
|
|
|
|
|
|
|
* number of public api calls is kept at the minimum
|
2024-10-22 11:45:30 +00:00
|
|
|
* procedure parameters can only use basic types, no aggregates, with exception of Vec/Matrix types and alike,
|
2024-10-22 17:42:07 +00:00
|
|
|
with no expectation on new additions (see [/include/twn_types.h](../include/twn_types.h))
|
2024-11-03 20:25:06 +00:00
|
|
|
* optionals can be expressed via pointer passage of value primitives, assumed immutable, with the NULL expressing default
|
|
|
|
* no opaque types, only keys
|
|
|
|
* when mutation on input is done, - it shouldn't be achieved from a mutable pointer, but the return value
|
|
|
|
* return value could be a simple aggregate that is translatable to pure data dictionary
|
2024-11-03 20:27:10 +00:00
|
|
|
* module prefix is used for namespacing, actual symbols come after the prefix (`<module>_<symbol>`)
|
2024-11-03 20:30:29 +00:00
|
|
|
* symbols should not contain numerics at the start nor after the namespace prefix
|
2024-11-03 20:25:06 +00:00
|
|
|
* 32 bit floating point is the only numeric type
|
|
|
|
* [/include/twn_api.json](../include/twn_api.json) file is hand-kept with a schema to aid automatic binding generation and tooling
|