{"title":"MetaFFI -- 多语言间接互操作系统","authors":"Tsvi Cherny-Shahar, Amiram Yehudai","doi":"arxiv-2408.14175","DOIUrl":null,"url":null,"abstract":"The development of software applications using multiple programming languages\nhas increased in recent years, as it allows the selection of the most suitable\nlanguage and runtime for each component of the system and the integration of\nthird-party libraries. However, this practice involves complexity and error\nproneness, due to the absence of an adequate system for the interoperability of\nmultiple programming languages. Developers are compelled to resort to\nworkarounds, such as library reimplementation or language-specific wrappers,\nwhich are often dependent on C as the common denominator for interoperability.\nThese challenges render the use of multiple programming languages a burdensome\nand demanding task that necessitates highly skilled developers for\nimplementation, debugging, and maintenance, and raise doubts about the benefits\nof interoperability. To overcome these challenges, we propose MetaFFI, a\npluggable in-process indirect-interoperability system that allows the loading\nand utilization of entities from multiple programming languages. This is\nachieved by exploiting the less restrictive shallow binding mechanisms (e.g.,\nForeign Function Interface) to offer deep binding features (e.g., object\ncreation, methods, fields). MetaFFI provides a runtime-independent framework to\nload and \\emph{xcall} (Cross-Call) foreign entities (e.g., functions, objects).\nMetaFFI uses Common Data Types (CDTs) to pass parameters and return values,\nincluding objects and complex types, and even cross-language callbacks. The\nindirect interoperability approach of MetaFFI has the significant advantage of\nrequiring only $2n$ mechanisms to support $n$ languages, as opposed to the\ndirect interoperability approaches that need $n^2$ mechanisms. We have\nsuccessfully tested the binding between Go, Python3.11, and Java in a\nproof-of-concept on Windows and Ubuntu.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-08-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"MetaFFI -- Multilingual Indirect Interoperability System\",\"authors\":\"Tsvi Cherny-Shahar, Amiram Yehudai\",\"doi\":\"arxiv-2408.14175\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The development of software applications using multiple programming languages\\nhas increased in recent years, as it allows the selection of the most suitable\\nlanguage and runtime for each component of the system and the integration of\\nthird-party libraries. However, this practice involves complexity and error\\nproneness, due to the absence of an adequate system for the interoperability of\\nmultiple programming languages. Developers are compelled to resort to\\nworkarounds, such as library reimplementation or language-specific wrappers,\\nwhich are often dependent on C as the common denominator for interoperability.\\nThese challenges render the use of multiple programming languages a burdensome\\nand demanding task that necessitates highly skilled developers for\\nimplementation, debugging, and maintenance, and raise doubts about the benefits\\nof interoperability. To overcome these challenges, we propose MetaFFI, a\\npluggable in-process indirect-interoperability system that allows the loading\\nand utilization of entities from multiple programming languages. This is\\nachieved by exploiting the less restrictive shallow binding mechanisms (e.g.,\\nForeign Function Interface) to offer deep binding features (e.g., object\\ncreation, methods, fields). MetaFFI provides a runtime-independent framework to\\nload and \\\\emph{xcall} (Cross-Call) foreign entities (e.g., functions, objects).\\nMetaFFI uses Common Data Types (CDTs) to pass parameters and return values,\\nincluding objects and complex types, and even cross-language callbacks. The\\nindirect interoperability approach of MetaFFI has the significant advantage of\\nrequiring only $2n$ mechanisms to support $n$ languages, as opposed to the\\ndirect interoperability approaches that need $n^2$ mechanisms. We have\\nsuccessfully tested the binding between Go, Python3.11, and Java in a\\nproof-of-concept on Windows and Ubuntu.\",\"PeriodicalId\":501197,\"journal\":{\"name\":\"arXiv - CS - Programming Languages\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-08-26\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Programming Languages\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2408.14175\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2408.14175","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
MetaFFI -- Multilingual Indirect Interoperability System
The development of software applications using multiple programming languages
has increased in recent years, as it allows the selection of the most suitable
language and runtime for each component of the system and the integration of
third-party libraries. However, this practice involves complexity and error
proneness, due to the absence of an adequate system for the interoperability of
multiple programming languages. Developers are compelled to resort to
workarounds, such as library reimplementation or language-specific wrappers,
which are often dependent on C as the common denominator for interoperability.
These challenges render the use of multiple programming languages a burdensome
and demanding task that necessitates highly skilled developers for
implementation, debugging, and maintenance, and raise doubts about the benefits
of interoperability. To overcome these challenges, we propose MetaFFI, a
pluggable in-process indirect-interoperability system that allows the loading
and utilization of entities from multiple programming languages. This is
achieved by exploiting the less restrictive shallow binding mechanisms (e.g.,
Foreign Function Interface) to offer deep binding features (e.g., object
creation, methods, fields). MetaFFI provides a runtime-independent framework to
load and \emph{xcall} (Cross-Call) foreign entities (e.g., functions, objects).
MetaFFI uses Common Data Types (CDTs) to pass parameters and return values,
including objects and complex types, and even cross-language callbacks. The
indirect interoperability approach of MetaFFI has the significant advantage of
requiring only $2n$ mechanisms to support $n$ languages, as opposed to the
direct interoperability approaches that need $n^2$ mechanisms. We have
successfully tested the binding between Go, Python3.11, and Java in a
proof-of-concept on Windows and Ubuntu.