Thrift is based on the use of an IDL (Interface Definition Language). Using the definition from Wikipedia:
An interface description language (or
alternately, interface definition
language), or IDL for short, is a
specification language used to
describe a software component's
interface. IDLs describe an interface
in a language-neutral way, enabling
communication between software
components that do not share a
language – for example, between
components written in C++ and
components written in Java.
An example on how to use the Thrift interface language is available in the Thrift tutorial.
By the use of a .thrift
file, you're suppose to define the interfaces you need (in terms of types and services). For example, in your .thrift file, you could define a simple function like:
i32 add(1:i32 num1, 2:i32 num2)
that represents a function to sum two integers.
When you're ready with your .thrift
file, you can generate the Java, PHP, Erlang, whatever code that you need (server-side or client-side), using the Thrift generator.
Refer to the Thrift wiki for more information.