定义

An interface description language or interface definition language (IDL), is a generic term for a language that lets a program or object written in one language communicate with another program written in an unknown language. IDLs describe an interface in a language-independent way, enabling communication between software components that do not share one language, for example, between those written in C++ and those written in Java.

例子

个人理解

IDL说白就是一个中介

image-20221011113637420

因为要发给其他的程序服务,可能出现语言不一样,这个时候对数据做解析就有点问题了。如果基于tcp/ip通信,底层都是c接口,收发的也就是字符串,这个可能会比较好解析,但是传输体积太大了,导致开销大。

像是protobuf这种,我用c++发送数据,java接收,这其中的转换是由protobuf做的,而且protobuf压缩了数据量,用来通信效率也挺高。

参考:

  1. Interface description language - Wikipedia