作祟是什么意思| 沙示汽水有什么功效| 闰六月是什么意思| 双字五行属什么| 兴旺的反义词是什么| 有情人终成眷属是什么意思| 刮骨疗毒的意思是什么| 睾丸是什么形状的| 吃什么好| 愤是什么生肖| 血冲脑是什么原因引起| 什么食物维生素A含量高| 白头翁吃什么食物| 宫颈锥切后需要注意什么| 周杰伦什么病| 地高辛是什么药| 36岁属什么生肖| 尿少是什么原因| 脸部麻木是什么原因引起的| 吃什么去肝火见效快| 幽冥是什么意思| 深藏不露是什么意思| 正因数是什么| 什么叫肺纤维化| 徐峥的老婆叫什么名字| 线人是什么意思| 总是低烧是什么原因造成的| 肆无忌惮是什么意思| 检查肝功能挂什么科| 介入科主要看什么病| 九浅一深什么意思| 低筋面粉能做什么| 软组织是什么| 观音土是什么| 生气容易得什么病| 平顶山为什么叫平顶山| 胃蛋白酶原1偏低是什么意思| 类胡萝卜素主要吸收什么光| 广州有什么特产必带| 一失足成千古恨是什么意思| 连云港有什么好吃的| 泄泻病是什么意思| 陶渊明字什么| 胃不舒服想吐吃什么药| 卑微是什么意思| 人为什么会突然晕倒| 扁桃体肥大有什么症状| 口干是什么原因呢| 省人大代表是什么级别| 骨龄挂什么科| bella什么意思| 黄金变黑是什么原因| 脚气看什么科| 五彩斑斓的意思是什么| 肚脐左下方疼是什么原因| 姐夫的爸爸叫什么| 什么不什么什么| 喝啤酒头疼是什么原因| 酚咖片是什么药| 阴囊潮湿瘙痒是什么原因| 绝育手术对女性有什么危害| 橄榄油什么牌子最好| 儿童肠胃炎吃什么药| 肝功高是什么原因引起的| 胆固醇高是什么引起的| dido是什么牌子| 工作是为了什么| 鸡属于什么科| 梦见前女友是什么预兆| 左眉毛跳是什么预兆| 后背的骨头叫什么| 诸事顺遂是什么意思| 929是什么星座| 官方翻新机是什么意思| 太平鸟属于什么档次| 蜻蜓为什么点水| 足底麻木是什么原因| 长公主是什么意思| 顺理成章是什么意思| 百合什么时候收获| 拉肚子可以吃什么水果| 白细胞阴性什么意思| 农历六月六是什么日子| 户名是什么意思| 喝酒睡不着是什么原因| 父亲节应该送什么| def是什么意思| 左胸下方是什么部位| 酸奶用什么菌发酵| 嗯是什么意思| 抗风疹病毒抗体igg高是什么意思| 急性牙髓炎吃什么药| adp是什么| 痛风可以吃什么食物表| huidr是什么品牌| 喝红茶有什么效果| 于心不忍是什么意思| 减肥吃什么药效果最好| 甲钴胺片治疗什么病| 999足金是什么意思| 配伍是什么意思| 乳腺点状强回声是什么意思| 斑秃吃什么药效果好| 手术后不能吃什么| 卵巢多囊样改变是什么意思| 如梦初醒是什么意思| 什么什么鼎沸| 心电图hr是什么意思| 泥鳅喜欢吃什么食物| 心脑血管挂什么科| 备孕不能吃什么| 镜花水月什么意思| 情人什么意思| 肾绞痛可能由于什么原因引起| 玉米什么时候成熟| 总胆固醇高忌口什么| 狮子座什么性格| 纷至沓来什么意思| 4月25号是什么星座| 滋阴降火吃什么药| 12月23日什么星座| 8月12日是什么星座| 老是拉肚子什么原因| 什么药止血效果最快| 粽子是什么意思| 蚕除了吃桑叶还能吃什么| 船舷是什么意思| 吃了就吐是什么原因| 缄默什么意思| 酒品是什么意思| 甘油三酯高说明什么| 百无一用是什么意思| 生物制剂对人体有什么副作用| 口腔溃疡吃什么好得快| 化作风化作雨是什么歌| 七月七是什么节| 硬不起吃什么药| 荨麻疹是什么样的| 哀伤是什么意思| 什么是子公司| 女性hpv阳性是什么意思| 有恙是什么意思| 急性胰腺炎是什么病| 8月1日是什么星座| 鼓的偏旁部首是什么| 1977年是什么命| 黄柏泡水喝有什么功效| 身体出现小红点是什么原因| 用盐水泡脚有什么好处| 肝实质回声不均匀是什么意思| 甲亢是什么原因引起的| 利湿是什么意思| 黑脸是什么意思| 加尿素起什么作用| 对食是什么意思| 就诊是什么意思| 人工周期是什么意思| 三七粉吃了有什么好处| longines是什么牌子| 公粮是什么意思| 露酒是什么| 农历五月十八是什么日子| vd是什么| 什么季节| 梦见飞机是什么意思| 痘痘肌肤适合用什么牌子的护肤品| 子宫疼是什么原因| 虫草有什么功效| blub是什么意思| 什么病会传染| 男人鼻子大代表什么| 10.31什么星座| 身上长扁平疣是什么原因造成的| 梦见水是什么意思| 钠低是什么原因| gbm是什么意思| 属羊的什么命| 猝死是什么原因造成的| 维生素b12是什么| 副营长是什么军衔| 寒胃有什么症状| 3月16日是什么星座| 子宫是什么样子图片| 火车票无座是什么意思| 快的反义词是什么| 势力是什么意思| 海胆是什么东西| 执迷不悟是什么生肖| 身高用什么单位| 9月3日是什么纪念日| 怀孕什么时候能测出来| 八一是什么节| 看脖子挂什么科| 4月4日是什么星座| 精子什么味道| 肝郁吃什么中成药| 什么是产品| 新疆有什么水果| 属虎和什么属相相冲| 心绞痛是什么原因引起的| 孩子过敏性咳嗽吃什么药好| 蛋白石是什么| 什么是地包天牙齿图片| 脾阳不足吃什么中成药| 老公护着家人说明什么| 人次什么意思| 梦见好多狗是什么预兆| 规整是什么意思| 213什么星座| 洗银首饰用什么清洗| 羽加立念什么| 三叉神经痛挂什么科就诊| 虎是什么结构| 中药为什么要热着喝| 淋巴细胞绝对值偏高是什么原因| doris什么意思| 螺旋杆菌感染吃什么药| 下面痒用什么清洗最好| 空鼻症是什么| 钯金和铂金有什么区别| 冰糖和白糖有什么区别| 羊得布病什么症状| 1988年出生是什么命| 澍在人名中读什么| 孟子叫什么名字| 真菌感染是什么意思| 2010是什么年| 烫伤涂什么药膏| 葡萄糖高是什么原因| 铅是什么颜色| 血糖高吃什么食物最好最佳| eland是什么牌子| 菠菜吃多了有什么害处| 男人阳萎吃什么药最好| 什么时候人流| 心里难受是什么原因| 儿女双全是什么意思| 姹什么嫣什么| 什么食物含维生素k最多| 舌自心念什么| 仿佛是什么意思| twin是什么意思| 阴虱长什么样| 桃子不能和什么一起吃| 什么时候测量血压最准确| cho是什么意思| 皮肤角质化用什么药膏| 什么是射频| 黄痰吃什么药最好| 自恋是什么意思| 升是什么意思| 小儿急性喉炎吃什么药| 黑桃a是什么酒| 向日葵什么时候采摘| 深海鱼油什么时候吃最好| 青花鱼是什么鱼| 染什么颜色| 声优是什么意思| 酷儿是什么意思| 蒸鱼用什么鱼| 市政协副主席是什么级别| 再接再励是什么意思| 补铁有什么好处| 肝肾衰竭有什么症状| 百度

网店商品傍上人民的名义热销 李达康水杯爆款

百度 作为国内唯一全面推进混合动力、纯电动、燃料电池三条技术路线的汽车企业,上汽已自主掌控了电池、电驱动、电控三电核心技术,并具有强大的产业链体系和完备的产品组合优势。

A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written or compiled in another one. An FFI is often used in contexts where calls are made into a binary dynamic-link library.

Naming

edit

The term comes from the specification for Common Lisp, which explicitly refers to the programming language feature enabling for inter-language calls as such;[citation needed] the term is also often used officially by the interpreter and compiler documentation for Haskell,[1] Rust,[2] PHP,[3] Python, and LuaJIT (Lua)[4][5]:?35?.[6] Other languages use other terminology: Ada has language bindings, while Java has Java Native Interface (JNI), Java Native Access (JNA), or since Java 22, Foreign Function and Memory API. Foreign function interface has become generic terminology for mechanisms which provide such services.

Operation

edit

The primary function of a foreign function interface is to mate the semantics and calling conventions of one programming language (the host language, or the language which defines the FFI), with the semantics and conventions of another (the guest language). This process must also take into consideration the runtime environments and application binary interfaces of both. This can be done in several ways:

  • Requiring that guest-language functions which are to be host-language callable be specified or implemented in a particular way, often using a compatibility library of some sort.
  • Use of a tool to automatically wrap guest-language functions with appropriate glue code, which performs any necessary translation.
  • Use of a wrapper library
  • Restricting the set of host language abilities which can be used cross-language. For example, C++ functions called from C may not (in general) include reference parameters or throw exceptions.

FFIs may be complicated by the following considerations:

  • If one language supports garbage collection (GC) and the other does not; care must be taken that the non-GC language code does nothing to cause GC in the other to fail. In JNI, for example, C code which "holds on to" object references that it receives from Java must communicate this information successfully to the Java virtual machine or Java Runtime Environment (JRE), otherwise, Java may delete objects before C finishes with them. (The C code must also explicitly release its link to any such object once C has no further need of that object.)
  • Complicated or non-trivial objects or datatypes may be difficult to map from one environment to another.
  • It may not be possible for both languages to maintain references to the same instance of a mutable object, due to the mapping issue above.
  • One or both languages may be running on a virtual machine (VM); moreover, if both are, these are often different VMs.
  • Cross-language inheritance and other differences, such as between type systems or between object composition models, may be especially difficult.

?

Many FFIs can be generated automatically: for example, SWIG. However, in the case of an extension language a semantic inversion of the relationship of guest and host can occur, when a smaller body of extension language is the guest invoking services in the larger body of host language, such as writing a small plugin[7] for GIMP.[8]

Some FFIs are restricted to free standing functions, while others also allow calls of functions embedded in an object or class (often called method calls); some even permit migration of complex datatypes or objects across the language boundary.

In most cases, an FFI is defined by a higher-level language, so that it may employ services defined and implemented in a lower-level language, typically a system programming language like C or C++. This is typically done to either access operating system (OS) services in the language in which the OS API is defined, or for performance goals.

Many FFIs also provide the means for the called language to invoke services in the host language also.

The term foreign function interface is generally not used to describe multi-lingual runtimes such as the Microsoft Common Language Runtime, where a common substrate is provided which enables any CLR-compliant language to use services defined in any other. (However, in this case the CLR does include an FFI, P/Invoke, to call outside the runtime.) In addition, many distributed computing architectures such as the Java remote method invocation (RMI), RPC, CORBA, SOAP and D-Bus permit different services to be written in different languages; such architectures are generally not considered FFIs.

Special cases

edit

There are some special cases, in which the languages compile into the same bytecode VM, like Clojure and Java, as well as Elixir and Erlang. Since there is no interface, it is not an FFI, strictly speaking, while it offers the same functions to the user.

See also

edit

References

edit
  1. ^ "FFI Introduction". HaskellWiki. Retrieved 19 June 2015. Haskell's FFI is used to call functions from other languages (basically C at this point), and for C to call Haskell functions.
  2. ^ "std::ffi". Rust-lang.org. Retrieved 1 April 2021. This module provides utilities to handle data across non-Rust interfaces, like other programming languages and the underlying operating system. It is mainly of use for FFI (Foreign Function Interface) bindings and code that needs to exchange C-like strings with other languages.
  3. ^ "PHP FFI Manual". PHP Manual. Retrieved 31 August 2023. Defined C variables are made available as properties of the FFI instance.
  4. ^ Mike Pall. "FFI Library". Luajit.org. Retrieved 2025-08-14.
  5. ^ Heintz, Joachim; Hofmann, Alex; McCurdy, Iain (2013). Ways Ahead: Proceedings of the First International Csound Conference. Newcastle upon Tyne: Cambridge Scholars Publishing. ISBN?978-1-4438-5122-0. OCLC?855505215.
  6. ^ "CFFI documentation". Retrieved 19 June 2015. C Foreign Function Interface for Python. The goal is to provide a convenient and reliable way to call compiled C code from Python using interface declarations written in C.
  7. ^ "4. A sample script". Gimp.org. 2025-08-14. Retrieved 2025-08-14.
  8. ^ "Script-Fu and plug-ins for The GIMP". Gimp.org. Retrieved 2025-08-14.
edit


脚面疼痛什么原因 砧木是什么意思 茴三硫片主治什么 彘是什么意思 左肾尿盐结晶是什么意思
不爱说话的人是什么性格 百毒不侵是什么意思 手脚发抖是什么原因引起的 感染幽门螺杆菌吃什么药 泉州和晋江什么关系
c14检查前需要注意什么 牡丹什么时候开放 红颜知己是什么关系 夫人是什么生肖 什么动物有三个心脏
婴幼儿吃什么奶粉好 复方北豆根氨酚那敏片是什么药 冰爽丝是什么面料 灰色裤子配什么上衣 阴虚吃什么中成药
什么牌子的冰箱好hcv8jop2ns7r.cn 马可以加什么偏旁hcv9jop4ns8r.cn 小腹隐隐作痛是什么原因女性dayuxmw.com 急性扁桃体发炎吃什么药hcv9jop7ns5r.cn 茶色是什么颜色hcv8jop1ns7r.cn
1958年属什么hcv8jop9ns3r.cn 排卵期同房要注意什么wzqsfys.com 什么的森林hcv8jop2ns1r.cn 图片px是什么意思hcv8jop2ns8r.cn 睡觉被口水呛醒是什么原因hcv9jop0ns2r.cn
狮子的天敌是什么动物hcv8jop4ns9r.cn 嘴巴苦是什么原因引起的hcv9jop3ns2r.cn 后话是什么意思hcv9jop2ns4r.cn 娘是什么意思hcv8jop5ns4r.cn 尼特族是什么意思hcv9jop2ns6r.cn
比丘什么意思hcv9jop0ns4r.cn 14是什么意思hcv7jop5ns0r.cn 跖疣去医院挂什么科室qingzhougame.com 1963年是什么年hcv8jop9ns9r.cn 老婆饼是什么馅hcv7jop7ns4r.cn
百度