0. Computer language
Three different languages
1. Machine language
2. Assembly language
3. Advanced language
1, machine language (01 code): In order to speed up the development of developers, so there is a microcode (assembly language)-C compiler (assembly language is through the compiler, can let microcode into 01 code)
2, assembly language: Although the human can be identified, but the assembly language with the chip (CPU) is also a high degree of integration, not only the development of difficult, but also not good transplant, so the assembly language is also low-level language, so the back of the emergence of high-level language (C,java,perl,python)
3, high-level language: This written program, only need to contact with the intermediary equipment, do not need to care whether the underlying CPU is Intel or AMD, there is no need to consider portability.
What are intermediate devices for high-level languages?
这个中间设备就是我们理解的API(也就是库),也可以理解为内核(有些是直接调用内核去获取硬件资源,如苹果系统IOS,是Unix内核的,直接调用Unix内核获取硬件资源,而有一些是通过应用程序接口去调用硬件资源(当然这一种方式需要被内核监督和管理,如安卓系统,他是一个+Linux+JVM(java虚拟机)+java程序构成,所以并不是直接调用硬件资源,而是通过JVM这个java虚拟机实现调用Linux内核资源,所以效率上肯定没有苹果IOS这么快))。
Of course, many organizations can abstract the application interfaces of these intermediate devices.
Application Programming Interface:
简称API(Application Programming Interface),就是软件系统不同组成部分衔接的约定。
When the data is encapsulated, each layer in the network hierarchy interacts with the interface and provides services, where the interface between the application layer and the user is called the Application interface (Api,application programming Interface). The API is actually a collection of functions, or a collection of definitions and protocols, regardless of the set, the essence of which is through abstraction for the user to mask the implementation of the details and complexity.
From the user's point of view, the application interface is represented as a series of API functions that users can use to develop Web applications. From the network point of view, the application interface provides users with a set of methods that users can use to send business requests, information, and data to the application layer, and each layer in the network responds in turn, eventually completing the network data transfer.
Common Application Interfaces
应用层的应用程序接口有很多,并且发展很快,比较常见的如socket、FTP、HTTP以及telnet。这些接口从大类上可分为四类:
Remote Procedure Calls (Rpc,remote Procedure call Protocol)
Data query Interface
File class Interface
Data communication Interface
For example, the FTP protocol is the file class interface, based on FTP, the user can realize the file sharing and transmission between the network. Socket and HTTP can be attributed to data communication interface, based on these two interfaces, users can develop network communication applications, as well as Web page interactive program. Of course, from the perspective of programming development, whether FTP, HTTP or Telnet, is based on the socket interface developed application layer protocol, is the socket interface further encapsulation and abstraction, so as to provide users with a higher level of service and interface.
Sockets are sometimes referred to as "Berkeley sockets", which are the first application interfaces developed by Berkeley.
There are two common types of sockets:
Streaming sockets (SOCK_STREAM) and datagram Sockets (SOCK_DGRAM).
A streaming socket is a connection-oriented socket for connection-oriented TCP service applications.
A datagram socket is a non-connected socket that corresponds to a non-connected UDP service application.
In the sense of user interface, there is also the Tli interface of the transport layer, which is developed by T/T and is sometimes called XTi. It is the application interface provided by the transport layer for the user and can be used for application development at the transport layer.
0. Computer language classification and application interface (API)