The Slice Language
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
2 min read
The Slice IDL is the fundamental abstraction mechanism for separating object interfaces from their implementations. Slice establishes a contract between client and server that describes the interfaces, operations and data types used by an application. This description is independent of the implementation language, so it does not matter whether the client is written in the same language as the server.
Slice definitions are compiled for a particular implementation language by a compiler. The language-specific Slice compiler translates the language-independent Slice definitions into language-specific type definitions and APIs. These types and APIs are used by the developer to provide application functionality and to interact with Ice. The translation algorithms for various implementation languages are known as language mappings, and Ice provides a number of language mappings (for C++, C#, Java, JavaScript, Python, Swift and more).
Because Slice describes interfaces and types (but not implementations), it is a purely declarative language; there is no way to write executable statements in Slice.
Slice definitions focus on object interfaces, the operations supported by those interfaces, and exceptions that may be thrown by operations. Much of Slice is concerned with the definition of data types, because a client and a server can exchange only data whose types are defined in Slice: to send application data, you define a Slice type for it.